Uploading Data onto Vensim PLE

Use this forum to post Vensim related questions.
lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Uploading Data onto Vensim PLE

Post by lch93lily » Thu Jun 19, 2014 3:02 am

Hi there! I am having some trouble uploading data onto Vensim PLE.

My variables are in the type "data" because I am trying to run a time-series excel sheet.

I have tried to convert the xlsx (excel) file to a .txt file, and then saving it as a .dat file.

The first row is the Time variable, with the subsequent rows being data of other variables.

Yet when I upload the .dat file, I receive the notification that there is no values to run in my file.

Could you kindly advise?

Thank you.

Administrator
Super Administrator
Posts: 3422
Joined: Wed Mar 05, 2003 3:10 am

Re: Uploading Data onto Vensim PLE

Post by Administrator » Thu Jun 19, 2014 6:36 am

Can you upload what you have so we can take a look?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Fri Jun 20, 2014 5:38 am

HI!

Thank you for the response. I actually managed to figure that out earlier and am able to upload the data now into Vensim PLE.

However, I realized that when I simulate the program, I received the two error messages;
ERROR: The variable- dlnrgdp -and perhaps others require a data file be specified.
ERROR: Unable to correctly load in exogenous values - aborting.

I read previous posts and understand that I should use the "Lookup" as the Type, rather than "Auxillary" or "Level".

But when I do that, the simulation has an error: -variable- is a special type and cannot be used as a normal variable.

Could you kindly advise?

Administrator
Super Administrator
Posts: 3422
Joined: Wed Mar 05, 2003 3:10 am

Re: Uploading Data onto Vensim PLE

Post by Administrator » Fri Jun 20, 2014 8:00 am

If you can upload the model so we can see it, that would really help.

Otherwise, I'd advise a review of the help system on lookups, there is even a video to help you.
http://www.vensim.com/documentation/ind ... ?usr08.htm
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Fri Jun 20, 2014 8:52 am

Hi there!

Thank you so much for your prompt reply.

Attached is my model with the data input via a .dat file.
Attachments
Rental Prices Sent.mdl
(3.82 KiB) Downloaded 121 times

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Fri Jun 20, 2014 9:02 am

Hi there!

This is another file, but with data uploaded via LOOKUP method.

Basically, I am trying to simulate the regression with 4 variables, whereby "fraction" represents the coefficients of variables, and the variables are all lagged in nature, hence the "DELAY FIXED" command.

Thank you so much once again!
Attachments
Rental Prices SentLOOKUPsent.mdl
(4.12 KiB) Downloaded 116 times

Administrator
Super Administrator
Posts: 3422
Joined: Wed Mar 05, 2003 3:10 am

Re: Uploading Data onto Vensim PLE

Post by Administrator » Fri Jun 20, 2014 3:58 pm

I've made the changes to one of the lookups in the attached model.
Attachments
Rental Prices SentLOOKUPsent.mdl
(4.4 KiB) Downloaded 147 times
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Mon Jun 23, 2014 8:58 am

Hi there! Thank you so so much for all the help! The program now runs with the lookup command!!

I have encountered another issue - which is to simulate an endogenous variable into the model.

Here, the "rate of flow' variable IS the "lnrgdp" variable because it is an endogenous variable. Yet I received the error message that the variable is not a lookup, therefore cannot be simulated.

Could you kindly advise how I can deal with this?

Thank you so much! You have been a great source of help!
Attachments
Rental Prices SentLOOKUPsent_sent.mdl
(3.15 KiB) Downloaded 82 times

Administrator
Super Administrator
Posts: 3422
Joined: Wed Mar 05, 2003 3:10 am

Re: Uploading Data onto Vensim PLE

Post by Administrator » Mon Jun 23, 2014 10:34 am

You've got

Code: Select all

rate of flow = "l.lnavailstk Total"+"l.lnrgdp Total"
Is this correct?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Mon Jun 23, 2014 3:33 pm

The basic problem here is exactly what the error message suggests - that lnrgdp f is used as a lookup, but its equation suggests that it is an auxiliary depending on rate of flow.

I think this model is going to have problems, even if it runs.

There are two integrations between availStk and GDP -> prices. It's not clear what the physical basis for them is. If the "total" variables are positive, prices will increase without bounds.

I think this needs a rethink. Assigning and balancing units would be a good start. Variables should have clear real-world interpretations, and the pricing process should probably use some kind of anchoring and adjustment, rather than an integration that floats without bounds.

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Tue Jun 24, 2014 1:45 am

To the administrator:
That is right! lnavailstk is an endogenous variable (therefore the loop from "rate of flow"), and lnrgdp is an exogenous variable.
"Rate of flow" here refers to the available stock that is carried into the next period.
Therefore, the regression equation that we are trying to simulate is
Period 1: lnavailstk_1 + lnrgdp_1 = rate of flow_1
Period 2: Rate of flow_1 + lnrgdp_2 = rate of flow_2
Period 3: Rate of flow_2 + lnrgdp_3 = rate of flow_3....

I realized that I made a mistake in my model for its arrows; here's the edited copy. Thank you! :)

To tomfid:
Thank you for the advice! :) I am not sure what "physical basis" refer to. But essentially I am trying to simulate the effects that the quantity of available stock of rental land (lnavailstk) and the current GDP (lnrgdp) of a country have on the "change in the quantity of rental land" (rate of flow). And then from there, how the (rate of flow) affects rental prices. My end goal is to find out the rental prices using the simulation. Is the explanation clearer? :)
Attachments
Rental Prices SentLOOKUPsent_sent.mdl
(3.23 KiB) Downloaded 71 times

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Tue Jun 24, 2014 4:53 pm

To model a lag, you can use DELAY FIXED in advanced version. If you're using Euler or Diff integration with a time step of 1, you can also use

lagged x = INTEG( (current x - lagged x)/TIME STEP, ... )

or

lagged x = SMOOTH( current x, TIME STEP)

To be blunt, the typical notation for vector autoregressive models in economics is a barrier to understanding. The SD approach to this problem would look more like the following.
Rental Prices 2.mdl
(5.8 KiB) Downloaded 108 times

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Wed Jun 25, 2014 2:53 am

Thank you for the model, Tom. The only issue I have is the data inputs are not as readily available.

This is my whole model, and you will see what I mean. I wanted to understand if I simulated the endogenous variables correctly.

Could you kindly advise?
Attachments
Rental Prices Take 7A.mdl
(8.58 KiB) Downloaded 100 times

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Wed Jun 25, 2014 5:51 pm

This looks much better. To follow SD conventions, I'd use something other than a box to identify the 4 "total" variables, since they are (correctly) no longer stocks (INTEG). I obviously can't speak to the numerical details, but this seems like a reasonable structure.

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Thu Jun 26, 2014 6:08 am

Sounds great! Thank you for the advice Tom!

Do you know if Vensim allow momentum (ie lagged variables that are endogenous in nature) in system dynamics (SD)?

Thank you once again!

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Thu Jun 26, 2014 2:49 pm

Yes.

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Thu Jun 26, 2014 3:25 pm

If you want to use econometric notation directly, you're probably better off to use R. But you can implement lags directly in Vensim. Generically, if you have something like

deltaC(t) = C(t)-C(t-1) = .5*Y(t) - .2*(C(t-1)-.9*Y(t-1)) + expsilon
(the ECM at http://en.wikipedia.org/wiki/Error_correction_model)

This can be rearranged to:
C(t) = C(t-1) + .5*Y(t) - .2*(C(t-1)-.9*Y(t-1)) + epsilon

which is implemented in Vensim something like:
C = Lagged C + .5*Y - .2*(Lagged C - .9*Lagged Y) + epsilon
Lagged C = DELAY FIXED(C,one year)
Lagged Y = DELAY FIXED(Y,one year)
TIME STEP = 1~~year
one year == 1~~year
epsilon = RANDOM ...

If you want a comprehensible, robust, continuous time notation model, it's better to switch to standard SD stock and flow notation. Hidden problems lurk in many dynamic economic models. For a classic example of the hidden problems in the multiplier-accelerator, similar to the above, see
http://www.systemdynamics.org/conferenc ... low337.pdf

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Thu Jun 26, 2014 3:45 pm

Where the lag is one period (i.e. one TIME STEP) and you're using Euler or Diff integration, you can also write:
Lagged C = SMOOTH(C,one year)
or
Lagged C = INTEG((C-Lagged C)/one year,one year)

lch93lily
Junior Member
Posts: 11
Joined: Thu Jun 19, 2014 2:57 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by lch93lily » Fri Jun 27, 2014 3:12 am

Thank you for the advice Tom.

I have done the following and have a few follow up questions.

1) Static vs Dynamic models
Because the Vensim PLE does not have a calibration feature, I used a statistical software to churn out the coefficients to input into Vensim. The problem is the statistical software like STATA is static in nature, which means I input the actual data into the regression to churn out the results for the dependent variable. For Vensim on the other hand, I input the data for the exogenous independent variables, and let the data for the endogenous variable (which is a lagged form of the dependent variable) be input by the looping arrows from the dependent variable. Will Vensim and STATA then give me different dependent variable values?

2) If they do NOT give me different outputs, then here's another question. When dealing with a variable with 2 time periods lag, STATA drops the variable in period t-2 and t-1, and only includes it from period t onwards. Vensim on the other hand does not seem to do that, therefore I was wondering whether I am able to MANUALLY key in the data for the first 2 period t-2 and t-1, before running the program.

Thank you for your advice! :)

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Fri Jun 27, 2014 8:22 pm

You should get the same answer either way. The values in the first two time steps won't be established by the data, but as long as you initialize the lag states to a reasonable value, they should be fine. Or you could just start the model at time 2.

MaxiKing
Junior Member
Posts: 6
Joined: Thu Mar 22, 2018 7:50 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by MaxiKing » Fri Sep 13, 2019 5:35 pm

Hi,

I am having the same issue as Ich93lily.

Vensim keeps telling me the following error:
ERROR: The variable- FIT DATA -and perhaps others require a data file be specified.
ERROR: Unable to correctly load in exogenous values - aborting.

I compared my model to the revised model the administrator sent back to Ich93lily. However, I cannot find the error or how to correct it.

May you advise what's wrong with my lookup and how to correct the error? I would like to have the lookup "DATA" separate from the variable "FIT degression rate" to make it clearer that one variable returns the value of the lookup.

Thank you in advance! I attached the model.
Question_Lookup.mdl
(2.99 KiB) Downloaded 14 times

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Fri Sep 13, 2019 5:56 pm

Normally you would specify the data file in the Data Sources... field, on the Advanced tab of the simulation control dialog (Model>Simulate menu).

However, PLE doesn't do data variables, so you'd have to use another lookup.

MaxiKing
Junior Member
Posts: 6
Joined: Thu Mar 22, 2018 7:50 am
Vensim version: PLE

Re: Uploading Data onto Vensim PLE

Post by MaxiKing » Sat Sep 14, 2019 12:57 pm

Hi Tomfid,

Thanks for your quick reply.

Would you mind explaining how to solve this issue with another lookup in Vensim PLE? What kind of lookup?

Thank you!

Administrator
Super Administrator
Posts: 3422
Joined: Wed Mar 05, 2003 3:10 am

Re: Uploading Data onto Vensim PLE

Post by Administrator » Sun Sep 15, 2019 7:30 am

Have you looked at the help on lookups?
http://www.vensim.com/documentation/lookups.htm
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

tomfid
Administrator
Posts: 2808
Joined: Wed May 24, 2006 4:54 am

Re: Uploading Data onto Vensim PLE

Post by tomfid » Sun Sep 15, 2019 5:12 pm

It would be exactly the same structure as you have for FIT Degression Rate.

Post Reply