How to input a time series function

Use this forum to post Vensim related questions.

How to input a time series function

Postby mehdi2 » Sun Apr 01, 2012 9:53 pm

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
mehdi2
Junior Member
 
Posts: 2
Joined: Sun Apr 01, 2012 9:49 pm

Re: How to input a time series function

Postby Mohammad Jalali » Sun Apr 01, 2012 11:51 pm

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.
Attachments
Example.mdl
(1.7 KiB) Downloaded 46 times
Mohammad Jalali
Junior Member
 
Posts: 19
Joined: Wed Mar 07, 2012 10:50 pm
Location: Washington, DC

Re: How to input a time series function

Postby mehdi2 » Mon Apr 02, 2012 1:22 pm

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
Attachments
sample model.mdl
(2.65 KiB) Downloaded 33 times
mehdi2
Junior Member
 
Posts: 2
Joined: Sun Apr 01, 2012 9:49 pm

Re: How to input a time series function

Postby Mohammad Jalali » Mon Apr 02, 2012 3:03 pm

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.
Mohammad Jalali
Junior Member
 
Posts: 19
Joined: Wed Mar 07, 2012 10:50 pm
Location: Washington, DC


Return to Vensim

Who is online

Users browsing this forum: No registered users and 2 guests

cron