Page 1 of 2

Uploading Data onto Vensim PLE

Posted: Thu Jun 19, 2014 3:02 am
by lch93lily
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.

Re: Uploading Data onto Vensim PLE

Posted: Thu Jun 19, 2014 6:36 am
by Administrator
Can you upload what you have so we can take a look?

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 20, 2014 5:38 am
by lch93lily
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?

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 20, 2014 8:00 am
by Administrator
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

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 20, 2014 8:52 am
by lch93lily
Hi there!

Thank you so much for your prompt reply.

Attached is my model with the data input via a .dat file.

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 20, 2014 9:02 am
by lch93lily
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!

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 20, 2014 3:58 pm
by Administrator
I've made the changes to one of the lookups in the attached model.

Re: Uploading Data onto Vensim PLE

Posted: Mon Jun 23, 2014 8:58 am
by lch93lily
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!

Re: Uploading Data onto Vensim PLE

Posted: Mon Jun 23, 2014 10:34 am
by Administrator
You've got

Code: Select all

rate of flow = "l.lnavailstk Total"+"l.lnrgdp Total"
Is this correct?

Re: Uploading Data onto Vensim PLE

Posted: Mon Jun 23, 2014 3:33 pm
by tomfid
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.

Re: Uploading Data onto Vensim PLE

Posted: Tue Jun 24, 2014 1:45 am
by lch93lily
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? :)

Re: Uploading Data onto Vensim PLE

Posted: Tue Jun 24, 2014 4:53 pm
by tomfid
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 2754 times

Re: Uploading Data onto Vensim PLE

Posted: Wed Jun 25, 2014 2:53 am
by lch93lily
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?

Re: Uploading Data onto Vensim PLE

Posted: Wed Jun 25, 2014 5:51 pm
by tomfid
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.

Re: Uploading Data onto Vensim PLE

Posted: Thu Jun 26, 2014 6:08 am
by lch93lily
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!

Re: Uploading Data onto Vensim PLE

Posted: Thu Jun 26, 2014 2:49 pm
by tomfid
Yes.

Re: Uploading Data onto Vensim PLE

Posted: Thu Jun 26, 2014 3:25 pm
by tomfid
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

Re: Uploading Data onto Vensim PLE

Posted: Thu Jun 26, 2014 3:45 pm
by tomfid
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)

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 27, 2014 3:12 am
by lch93lily
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! :)

Re: Uploading Data onto Vensim PLE

Posted: Fri Jun 27, 2014 8:22 pm
by tomfid
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.

Re: Uploading Data onto Vensim PLE

Posted: Fri Sep 13, 2019 5:35 pm
by MaxiKing
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 2747 times

Re: Uploading Data onto Vensim PLE

Posted: Fri Sep 13, 2019 5:56 pm
by tomfid
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.

Re: Uploading Data onto Vensim PLE

Posted: Sat Sep 14, 2019 12:57 pm
by MaxiKing
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!

Re: Uploading Data onto Vensim PLE

Posted: Sun Sep 15, 2019 7:30 am
by Administrator
Have you looked at the help on lookups?
http://www.vensim.com/documentation/lookups.htm

Re: Uploading Data onto Vensim PLE

Posted: Sun Sep 15, 2019 5:12 pm
by tomfid
It would be exactly the same structure as you have for FIT Degression Rate.