Truncated lognormal

Use this forum to post Vensim related questions.
Post Reply
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Truncated lognormal

Post by lorenzo.cioni »

Hi everybody
is there any way to use, in a Vensim model, a variable that simulates a truncated lognormal? I know how I can simulate a "full" lognormal through a normal distribution but what about the insertion of a maximum positive value? How can I rescale so that the area under the truncated disribution is still equal to 1?
All the best, thanks in advance for any suggestion. 8)
Lorenzo
tomfid
Administrator
Posts: 3070
Joined: Wed May 24, 2006 4:54 am

Re: Truncated lognormal

Post by tomfid »

The RANDOM NORMAL function generates a truncated Normal distribution, so if you transform that you'll get a truncated Lognormal. You could do something like:

randx = EXP( RANDOM NORMAL(-something large, LN(max val), LN(geometric mean), geometric SD, stream ID) )
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Truncated lognormal

Post by lorenzo.cioni »

tomfid wrote: Sat Oct 17, 2020 2:03 pm The RANDOM NORMAL function generates a truncated Normal distribution, so if you transform that you'll get a truncated Lognormal. You could do something like:

randx = EXP( RANDOM NORMAL(-something large, LN(max val), LN(geometric mean), geometric SD, stream ID) )
Hi tomfid
thank you a lot... fast and precise as usual :D :D
All the best.
Lorenzo 8)
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Truncated lognormal

Post by lorenzo.cioni »

Hi tomfid
is it the same if I use this form?
randx = EXP( normal_mean+normal_std_dev*RANDOM NORMAL(-100, LN(max val),0, 1, 0 )
Lorenzo
tomfid
Administrator
Posts: 3070
Joined: Wed May 24, 2006 4:54 am

Re: Truncated lognormal

Post by tomfid »

Yes, as long as LN(max val) represents the maximum departure in terms of number of geometric std dev above the mean.
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Truncated lognormal

Post by lorenzo.cioni »

Hi tomfid
could you be more clear about this: "the maximum departure in terms of number of geometric std dev above the mean"?
Indeed I have to generate a lognormal whose normal parameters are μ = −13.3 and σ = 3.49 truncated on the interval [0, 2.35 × 10−3]).
Lorenzo
tomfid
Administrator
Posts: 3070
Joined: Wed May 24, 2006 4:54 am

Re: Truncated lognormal

Post by tomfid »

That would be:
EXP( RANDOM NORMAL(-100,-6.05,-13.3,3.49,stream) )
where -6.05 = ln(2.35e-3)

The -100 is just a big number (30 standard deviations roughly) - the truncation at 0 isn't really needed since the lognormal is always >0.
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Truncated lognormal

Post by lorenzo.cioni »

tomfid wrote: Sat Oct 17, 2020 3:18 pm That would be:
EXP( RANDOM NORMAL(-100,-6.05,-13.3,3.49,stream) )
where -6.05 = ln(2.35e-3)

The -100 is just a big number (30 standard deviations roughly) - the truncation at 0 isn't really needed since the lognormal is always >0.
Hi tomfid
thank you a lot. :D :D
All the best.
Lorenzo 8)
Post Reply