Endogenizing subscript values

Use this forum to post Vensim related questions.
Post Reply
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Endogenizing subscript values

Post by Louison »

Dear all,

I am using subscripts for a model and I would like to make the values of the subscript elements endogenous. However, when I replace the numbers with the expression of an equation, I get the message "expecting an operator" and I can't figure tout how to solve this problem. Would you have any suggestion ?

Please find enclosed a small model I made to learn how to use subscript in Vensim. Subscript values are defined in the "future consumption" variable. I'd like to replace them by expressions to make them endogenous.

Many thanks for your help.

Louison
Attachments
toy_model_subscript_June_7.mdl
(2.44 KiB) Downloaded 207 times
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Endogenizing subscript values

Post by Administrator »

If I understand you correctly, you want the values for "FUTURE CONSUMPTION" to be in an external file? If yes, there is a whole section in the documentation on data (time series)
http://www.vensim.com/documentation/ind ... f_data.htm

If you have constants, you can still use the data way to get values into your model, or use CIN files.
http://www.vensim.com/documentation/ind ... _files.htm
http://www.vensim.com/documentation/ind ... hanges.htm
http://www.vensim.com/documentation/ind ... ?23320.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
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Re: Endogenizing subscript values

Post by Louison »

Thank you very much for your reply, I will dig into the documentation you pointed out to.

To be more precise: I don't want the values to be in an external file, I want them to be determined by an equation relating to other variables in the model (hence making them endogenous). In other terms I want the values of the subscript elements to be determined by the model itself and not to be numbers fixed ex ante. Is there a way to do that ? Simply writing an equation instead of the numbers doesn't work (error message "expecting an operator").
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Endogenizing subscript values

Post by tomfid »

What does the subscript dimension represent? (If it's time, time is already implicit; you don't need a subscript.)
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Endogenizing subscript values

Post by Administrator »

Louison wrote: Mon Jun 11, 2018 1:02 pm Thank you very much for your reply, I will dig into the documentation you pointed out to.

To be more precise: I don't want the values to be in an external file, I want them to be determined by an equation relating to other variables in the model (hence making them endogenous). In other terms I want the values of the subscript elements to be determined by the model itself and not to be numbers fixed ex ante. Is there a way to do that ? Simply writing an equation instead of the numbers doesn't work (error message "expecting an operator").
Can you upload the model that has the "expecting an operator" error?
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
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Re: Endogenizing subscript values

Post by Louison »

Tom: it represents expected values of consumption at different point of time in the future. We need these expected values to change endogenously and then to feed in other variables and we are struggling finding a way to do it with Vensim. We thought subscripts could do.

Admin: it is the model I attached with my first post, with any expression instead of the numbers in the future consumption variable (I apologize I write from my personal computer and I do not have Vensim DSS on this one to replicate the error).
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Endogenizing subscript values

Post by Administrator »

Louison wrote: Mon Jun 11, 2018 1:29 pmAdmin: it is the model I attached with my first post, with any expression instead of the numbers in the future consumption variable (I apologize I write from my personal computer and I do not have Vensim DSS on this one to replicate the error).
It works fine for me, I really need to see what you are doing to help.
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: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Endogenizing subscript values

Post by tomfid »

I think you need VECTOR LOOKUP then.
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Re: Endogenizing subscript values

Post by Louison »

I apologize not to be able to upload an example that replicate the error at the moment, I won't be back on my office computer equipped with DSS for a week.

In the current example I uploaded in my first post, the values of the elements of the c_exp subscript are defined in the future consumption variable as numbers: 10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,50,50,50,50,50,50,50,50,50,48,46,44,42,40,39,36,34,32,30,28,26,24,22,20,18,16,14,12,10 (there are 50 elements for the subscript c_exp).

What we would like to do is to replace these numbers with expressions to make these values endogenous. So for instance instead of the numbers we would have, say, delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1),delay(consumption,1) or any other equation (of course in our full model the endogenous values for the subscript elements will differ).
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Re: Endogenizing subscript values

Post by Louison »

tomfid wrote: Mon Jun 11, 2018 2:55 pm I think you need VECTOR LOOKUP then.
ok thank you Tom, I will look into that when I can access DSS again.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Endogenizing subscript values

Post by Administrator »

You can only separate constants by a comma, not equations. But you can add equations (and have one for each subscript element if you really wish).

http://www.vensim.com/documentation/ind ... ?22065.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: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Endogenizing subscript values

Post by tomfid »

Is the mapping one to one, i.e. at each present point in time, is there one corresponding future expectation of consumption? In that case, you could use something much simpler, like

expected consumption = SMOOTH( consumption, horizon )
Louison
Junior Member
Posts: 6
Joined: Mon May 21, 2018 3:36 pm
Vensim version: DSS

Re: Endogenizing subscript values

Post by Louison »

Admin: I hadn't thought about multiple equations to do it but looking again at the user guide, it seems it could be indeed a way to go. So using multiple equation we could define each element of a same subscript by an equation ? That's how I understand the example in the user guide, am I correct ?

Tom: at each present point in time, we would need the whole set of expected consumptions to be computed.

Many thanks for your help and time, I will post here feedbacks as soon as we have tried your suggestions.
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Endogenizing subscript values

Post by tomfid »

I would hope that the expectations are all structurally the same, so that you could have one subscripted equation, and supply a vector of parameters. as in:
expected C[e] = SMOOTH( consumption, horizon[e] )
horizon [e] = 1,2,3,4,...
Post Reply