Page 1 of 1

Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 12:16 pm
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

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 12:28 pm
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?

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 1:24 pm
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.

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 1:33 pm
by johnjohnson4
Tried GET TIME VALUE. Its not supported in PLE+

Any other options?

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 2:56 pm
by Administrator
That's the only thing I can think of.

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 2:58 pm
by Administrator
How many seeds do you need to run the sensitivity test with?

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 4:40 pm
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

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 5:12 pm
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?

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 6:40 pm
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

Re: Creating a Random Distribution on Every Run

Posted: Mon Jun 27, 2016 8:12 pm
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.

Re: Creating a Random Distribution on Every Run

Posted: Fri Jul 01, 2016 10:36 am
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

Re: Creating a Random Distribution on Every Run

Posted: Fri Jul 01, 2016 1:53 pm
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.