Random with Log Normal distribution

Use this forum to post Vensim related questions.
Post Reply
Nub_User
Member
Posts: 39
Joined: Mon Aug 16, 2021 11:55 pm
Vensim version: PLE+

Random with Log Normal distribution

Post by Nub_User »

Hi colleagues!
Can a variable with a random value following a log-normal distribution be implemented?
Thank you very much.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Random with Log Normal distribution

Post by tomfid »

Yes!

I usually do something like the following:

var = GeometricMean * EXP( GeometricSD*RANDOM NORMAL(-6,6,0,1,0) )

The GeometricMean has the same units as your target variable.

The GeometricSD is the standard deviation as a fraction of the mean, i.e. the standard deviation of LN(var/GeometricMean) and therefore dimensionless. I usually assign the unit "fraction" for clarity.

You could also write the inner part as RANDOM NORMAL(-6,6,0,GeometricSD,0), but then you might have to change the -6,6 bounds if the SD is significantly different from one. The way I've written it, the -6,6 bounds give you a six-sigma constraint, so you can draw a million values without hitting the bound. You can make these larger if desired, but the nice thing about keeping the GeometricSD outside the RANDOM NORMAL call is that it makes the bounds invariant.
Nub_User
Member
Posts: 39
Joined: Mon Aug 16, 2021 11:55 pm
Vensim version: PLE+

Re: Random with Log Normal distribution

Post by Nub_User »

Thank you very much Tom I will try it! :D :D :D :D
Post Reply