Hi colleagues!
Can a variable with a random value following a log-normal distribution be implemented?
Thank you very much.
Random with Log Normal distribution
Re: Random with Log Normal distribution
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.
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.
/*
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: Random with Log Normal distribution
Thank you very much Tom I will try it!




