Page 1 of 1

How to input a time series function

Posted: Sun Apr 01, 2012 9:53 pm
by mehdi2
Hello everyone,

I am new to Vensim, and apologize if this is and easy question or has been answered previously. I searched the forum, and could not find my answer.
Please Suppose that we have a time series defined as:

P_t=a+b*P_t-1 (AR1)
Can any one please sketch, or let me know how to input this into vensim?

Thanks
Mehdi

Re: How to input a time series function

Posted: Sun Apr 01, 2012 11:51 pm
by Mohammad Jalali
Hi Mehdi,

Please check the attached file. It calculates P(t)=a+b*P(t-1), where t is Time. Is that what you were looking for?
Please feel free to ask me if you need some explanation.

Best,
M.J.

Re: How to input a time series function

Posted: Mon Apr 02, 2012 1:22 pm
by mehdi2
Hello Mohammad,

Thanks for the response. The equation is what I want, and p in your model has the required property. However, I actually need to define it in terms of an autoregressive or AR(1) process. Meaning P(t)=a(t) + b*P(t-1). Where a(t) is sequence of random numbers. I have attached my understanding to this. However, my model does not run. The food price is the required time series, and you can see that the equation is a bit more complicated than the one we are discussing here. Thank for your response.

Mehdi

Re: How to input a time series function

Posted: Mon Apr 02, 2012 3:03 pm
by Mohammad Jalali
If you go to Model > Check Model, you can see what the problem is that your model cannot be run. The "Food price equal" is used as, but not defined as, a lookup. It is defined as an Auxiliary.
And in autoregressive or AR(1), a(t) is random with zero mean and variance of sigma squared, so you can simply generate a random Normal number in Vensim with the respective mean and variance.

The function to generate a random Normal number is: RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ) but if you don't know min and max values, you may use the form of six sigma range that is ({mean} + {stdev} * RANDOM NORMAL(-6,6,0,1,{seed})).

M.J.