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
Problem using NORMAL RANDOM
-
- Junior Member
- Posts: 2
- Joined: Thu Feb 15, 2018 2:02 am
- Vensim version: PLE
Re: Problem using NORMAL RANDOM
joined a model.
Use the synthesim and the sliders Under the constants to experiment how it works.
Regards.
JJ
Use the synthesim and the sliders Under the constants to experiment how it works.
Regards.
JJ
- Attachments
-
- truncation.mdl
- (2.7 KiB) Downloaded 209 times
Re: Problem using NORMAL RANDOM
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
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 193 times
-
- Junior Member
- Posts: 2
- Joined: Thu Feb 15, 2018 2:02 am
- Vensim version: PLE
Re: Problem using NORMAL RANDOM
thanks @LAUJJL for your answers & samples. I'll try them out. appreciate your prompt help.
Re: Problem using NORMAL RANDOM
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.
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.
/*
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: Problem using NORMAL RANDOM
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.
You can use the NORMAL CDF function if you need to determine the mean realized from a particular combination of parameters.
/*
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
*/