Creating a Random Distribution on Every Run

Use this forum to post Vensim related questions.
Post Reply
johnjohnson4
Member
Posts: 47
Joined: Mon Mar 14, 2016 4:58 pm
Vensim version: PLE+

Creating a Random Distribution on Every Run

Post by johnjohnson4 »

Hello,
Is there a way to have a random distribution change on each simulation run?

I am doing a sensitivity analysis and would like to have the random distribution (preferably uniform or normal) change on each run. Can I make the seed random?

Thanks,
john
Attachments
RandomExample.mdl
(1.38 KiB) Downloaded 210 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Creating a Random Distribution on Every Run

Post by Administrator »

You can using GET TIME VALUE (and measure 10)
http://www.vensim.com/documentation/ind ... random.htm

Sensitivity simulations should automatically select from a distribution though. Or are you doing many sensitivity runs using different RN seeds?
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
johnjohnson4
Member
Posts: 47
Joined: Mon Mar 14, 2016 4:58 pm
Vensim version: PLE+

Re: Creating a Random Distribution on Every Run

Post by johnjohnson4 »

Correct. I am trying to do many sensitivity runs and would like to use a different seed each time. This will give me a broadly distributed residual error for my data points. Looks like GET TIME VALUE will get different seeds within the simulation run but each run will still be the same. Correct?

I need to be able to have a randomly selected seed on each simulation run.
johnjohnson4
Member
Posts: 47
Joined: Mon Mar 14, 2016 4:58 pm
Vensim version: PLE+

Re: Creating a Random Distribution on Every Run

Post by johnjohnson4 »

Tried GET TIME VALUE. Its not supported in PLE+

Any other options?
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Creating a Random Distribution on Every Run

Post by Administrator »

That's the only thing I can think of.
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
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Creating a Random Distribution on Every Run

Post by Administrator »

How many seeds do you need to run the sensitivity test with?
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
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Creating a Random Distribution on Every Run

Post by LAUJJL »

Hi

Use the model joined.

It is necessary to change the formulation of the seed variable to 0 for the first run, as the get vdf function does not return the atttime if the file is empty. All the successive runs will have the seed of the distribution automatically changed. The get vdf constants function should work with the ple plus, at least the documentation says so.

Regards.

JJ
Attachments
variable seed.mdl
(1.44 KiB) Downloaded 196 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Creating a Random Distribution on Every Run

Post by tomfid »

Very clever, JJ.

If there's demand, we could potentially introduce a new convention for randomizing the streams - perhaps a negative seed value?
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Creating a Random Distribution on Every Run

Post by LAUJJL »

Hi Tom

I do not see the utility of using negative values for seeds.

But it would be useful if the get vdf constants could produce the attime value as a result, if the file is empty or does not exist to avoid the necessity to run a first model to generate a file to start with.

Regards.

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

Re: Creating a Random Distribution on Every Run

Post by tomfid »

The purpose of the negative seed would be to serve as a flag indicating that results should be randomized (to the clock, or to system crypto sources) with every new run.

I'll take a look at the vdf code.
johnjohnson4
Member
Posts: 47
Joined: Mon Mar 14, 2016 4:58 pm
Vensim version: PLE+

Re: Creating a Random Distribution on Every Run

Post by johnjohnson4 »

JJ!

Thanks for the get vdf idea. I'll give that a try.

I actually figured out a solution as well. If you make the seed a variable and set it as a multivariate parameter in the sensitivity analysis, you will get a different seed on each simulation run.

I'll add your get vdf to my bag of tricks.

Thanks again,
john
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Creating a Random Distribution on Every Run

Post by tomfid »

You can also use stream 0 for all the function calls, then set the global NOISE SEED parameter with the sensitivity control file.
Post Reply