Problem using NORMAL RANDOM

Use this forum to post Vensim related questions.
Post Reply
param_iyer
Junior Member
Posts: 2
Joined: Thu Feb 15, 2018 2:02 am
Vensim version: PLE

Problem using NORMAL RANDOM

Post by param_iyer »

Hi,
When I use NORMAL RANDOM function for demand, I get weird results when mean is 0 & min is also 0 at the same time. It seems to be using the logic applicable for https://en.wikipedia.org/wiki/Truncated ... stribution - as the final output has mean > 0 instead. Can someone confirm the logic used?
How can we model a true normal distribution (without min/max) & then apply the truncation separately using min/max functions? Any inputs are welcome.
Regards, Param
LAUJJL
Senior Member
Posts: 1421
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Problem using NORMAL RANDOM

Post by LAUJJL »

joined a model.
Use the synthesim and the sliders Under the constants to experiment how it works.

Regards.

JJ
Attachments
truncation.mdl
(2.7 KiB) Downloaded 206 times
LAUJJL
Senior Member
Posts: 1421
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Problem using NORMAL RANDOM

Post by LAUJJL »

In fact, the random normal function does not work, if both the minimum and the maximum are equal to the mean.
a second solution to this limitation, is if this happens, to force the minimum and maximum to extreme indetermined values and the standard deviation to 0, to make the function work.
See the second model that works that way.

Regards.

JJ
Attachments
truncation2.mdl
(3.78 KiB) Downloaded 190 times
param_iyer
Junior Member
Posts: 2
Joined: Thu Feb 15, 2018 2:02 am
Vensim version: PLE

Re: Problem using NORMAL RANDOM

Post by param_iyer »

thanks @LAUJJL for your answers & samples. I'll try them out. appreciate your prompt help.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Problem using NORMAL RANDOM

Post by tomfid »

Taking

x = MIN(1,MAX(0,RANDOM NORMAL(-1000,1000,0,1,0)))

gives different results from

y = RANDOM NORMAL(0,1,0,1,0)

When you wrap the normal in MIN MAX, an out-of-range value gets truncated to the MIN or MAX endpoint. This causes a peak in the histogram at the ends. When the RANDOM NORMAL function exceeds the MIN MAX parameters, it resamples from the interval, yeilding a new random value that is within the range. This gives the usual truncated Normal distribution.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Problem using NORMAL RANDOM

Post by tomfid »

Correct - the logic matches the wiki page, which is the standard way of describing a truncated Normal in areas I'm familiar with.

You can use the NORMAL CDF function if you need to determine the mean realized from a particular combination of parameters.
Post Reply