Page 1 of 1

different distribution for each subscript

Posted: Fri Sep 09, 2016 12:36 pm
by samira15928
Hi

My question is, can I have different distribution for each of my subscript in vensim? the problem is I have three subscript and I want to define the price for each of them as random normal with different mean and std; however it causes an error. could you please guide me?

Cheers
Samira

Re: different distribution for each subscript

Posted: Fri Sep 09, 2016 1:00 pm
by Administrator
It's very easy to implement. Just subscript the mean and SD as well.

What error are you getting?

And can you post the model so I can take a look?

Re: different distribution for each subscript

Posted: Fri Sep 09, 2016 2:20 pm
by samira15928
thanks for your reply, you are right.
Then I have to define 5 new constants to the model and subscript them while I was thinking that maybe I can define it for example like this:
for three subscript:
RANDOM NORMAL(80,90,100,10,1),RANDOM NORMAL(82,95,100,10,1),RANDOM NORMAL(70,95,100,15,1)

Re: different distribution for each subscript

Posted: Fri Sep 09, 2016 3:04 pm
by Administrator
for three subscript:
RANDOM NORMAL(80,90,100,10,1),RANDOM NORMAL(82,95,100,10,1),RANDOM NORMAL(70,95,100,15,1)
No, you cannot do that.

It's good practice to put any constants into a parameter of their own. For example (using your numbers),
define the following subscripted constants

Code: Select all

m[sub] = 80,82,70
x[sub] = 90,95,95
h[sub] = 100
r[sub] = 10,10,15
s[sub] = 1
Then you call

Code: Select all

RANDOM NORMAL(m[sub],x[sub],h[sub],r[sub],s[sub])

Re: different distribution for each subscript

Posted: Sat Sep 10, 2016 2:10 pm
by samira15928
Thanks for your reply.
It means if I have 10 variables like this ( with different distributions for each subscript) I need to define about 50 extra variables in the model, right?

Re: different distribution for each subscript

Posted: Sat Sep 10, 2016 3:27 pm
by Administrator
You could. But you could also just use the one noise seed for all distributions.

This would be much easier if you uploaded your model so we could take a look.