Page 1 of 1

one random shock

Posted: Wed Jan 26, 2022 10:26 am
by Bena.m
Hi there!
I have a time series of 50 years, and I want to have just one random shock during the entirety of these 50 years, is there any particular function that serves this purpose?
Thanks

Re: one random shock

Posted: Wed Jan 26, 2022 5:18 pm
by Administrator
You could do a random uniform sample at time = initial time that is in the range 0-50. That would give you the year when to have the shock.

Re: one random shock

Posted: Wed Jan 26, 2022 7:59 pm
by tomfid
So something like:

shock time = INITIAL( RANDOM UNIFORM(0,50,0) )
output value = initial value + STEP( shock size, shock time )

If the shock is brief, you could use PULSE instead.

Re: one random shock

Posted: Thu Jan 27, 2022 2:20 pm
by Bena.m
Thank you so much for this suggestion!