Creating a Random Distribution on Every Run
-
- Member
- Posts: 47
- Joined: Mon Mar 14, 2016 4:58 pm
- Vensim version: PLE+
Creating a Random Distribution on Every Run
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
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
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Creating a Random Distribution on Every Run
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?
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Member
- Posts: 47
- Joined: Mon Mar 14, 2016 4:58 pm
- Vensim version: PLE+
Re: Creating a Random Distribution on Every Run
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.
I need to be able to have a randomly selected seed on each simulation run.
-
- Member
- Posts: 47
- Joined: Mon Mar 14, 2016 4:58 pm
- Vensim version: PLE+
Re: Creating a Random Distribution on Every Run
Tried GET TIME VALUE. Its not supported in PLE+
Any other options?
Any other options?
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Creating a Random Distribution on Every Run
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Creating a Random Distribution on Every Run
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Creating a Random Distribution on Every Run
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
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
Re: Creating a Random Distribution on Every Run
Very clever, JJ.
If there's demand, we could potentially introduce a new convention for randomizing the streams - perhaps a negative seed value?
If there's demand, we could potentially introduce a new convention for randomizing the streams - perhaps a negative seed value?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Creating a Random Distribution on Every Run
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
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
Re: Creating a Random Distribution on Every Run
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.
I'll take a look at the vdf code.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 47
- Joined: Mon Mar 14, 2016 4:58 pm
- Vensim version: PLE+
Re: Creating a Random Distribution on Every Run
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
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
Re: Creating a Random Distribution on Every Run
You can also use stream 0 for all the function calls, then set the global NOISE SEED parameter with the sensitivity control file.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/