Normal distribution

This forum contains all archives from the SD Mailing list (go to http://www.systemdynamics.org/forum/ for more information). This is here as a read-only resource, please post any SD related questions to the SD Discussion forum.
Locked
David W Peterson
Junior Member
Posts: 4
Joined: Fri Mar 29, 2002 3:39 am

Normal Distribution

Post by David W Peterson »

There are several ways to interpret your question, but I believe what you
may want is a deterministic "delay" system with an impulse response that
happens to have the (deterministic) shape of the normal distribution with
mean 20 and variance 1. The classic SD attitude would be to think of a
continuous system (ordinary differential equation), and to set up a
cascade of N first-order delays, each with time constant of 20/N. Your
"level" is the sum of the N first-order-delay levels, and your "flow" is
the flow out of the last delay in the cascade. The test impulse would be
represented by your initial condition of 100, all concentrated in the
first level of the cascade.

For any N >= 1, your requirement that the mean time of the flow be 20 is
satisfied, and for any N >= 3 the shape of the flow starts to look vaguely
normal (bell-shaped, but asymmetrical). As N increases, the mean stays at
20 and the shape becomes more and more normal, and the variance becomes
less. The problem is with the variance: to achieve a variance of 1, you
need 400 levels in the cascade!

The 400-level system, if properly simulated, gives a very close
approximation to what you asked for, but it may be needlessly wasteful in
its computational requirements.

The computational load could be lessened by thinking instead of difference
equations and a "tapped delay line" with time step S. Then you would need
perhaps 23/S levels to get both 3-sigma tails of the normal shape. For
time step S=1, the system would be fairly simple, and the mean and
variance could be made about right, but your "normal" distribution would
be approximated by a rather lumpy histogram.

How badly do you need a variance of 1? How normal must the response be?
The classic SD attitude would be stick with the continuous-system
paradigm, but to see if N=3 or maybe N=6 is good enough. The variance is
much wider than you specified, but classic experiments published by
Forrester suggest that if your delay is imbedded in a typical feedback
system, the variance may have little effect on the shape of the system
behavior. See Jay W. Forrester, _Industrial Dynamics_ (1961, now
available from Productivity Press), Appendix H, pp. 418-410.

David W. Peterson
Ventana Systems, Inc.
dwp@world.std.com
"Mick Carrick"
Junior Member
Posts: 3
Joined: Fri Mar 29, 2002 3:39 am

Normal distribution

Post by "Mick Carrick" »

Tom Fiddaman wrote:

>This
> doesnt make sense to me for cows, as it implies that cows in general have
> random gestation periods, but that any two cows that happen to get pregnant
> in the same time step will have identical gestation periods.

Tom is right. Although in the model I referred to, cows get pregnant
discretely, the time interval required to reduce the probability of
cows sharing a time slot is smaller than first throught.

It is a variant of the "Birthday" problem in which the probability of
two people sharing a birthday turns out to be counterintuitively
high. For example, the probability of at least two people sharing a
birthday is over 0.5 for 23 people in the room or more. With 50
people in the room the probability rises to 0.97. Good for pub bets.

Thus, the unfortunate consequence of Toms point is that for the
method to be practically useful, a smaller than expected time
interval must be simulated. The probability of no cows sharing a time
slot = ( N*(N-1)* . . . (N-r+1)) / N ^ r
where there are N time slots and r cows available.

The number of time intervals must be substantially greater than the
number of cows available to reduce this probability to a reasonable
level. In Stella/iThink this may well make the model very slow
indeed. The original question therefore remains interesting.

mick
-------------------------------------------------
Dr Mick Carrick
Genetics
Victorian Institute of Animal Science
475 Mickleham Rd, Attwood, VIC, 3049, AUSTRALIA
Phone: 61 3 9217 4227
Fax: 61 3 9217 4359
Email:
carrickm@woody.agvic.gov.au
--------------------------------------------------
Tom Fiddaman
Senior Member
Posts: 55
Joined: Fri Mar 29, 2002 3:39 am

Normal distribution

Post by Tom Fiddaman »

David Petersons comments are right on. Here are a few supplemental thoughts:

One of Forresters experiments with delay order is in Appendix H of
Industrial Dynamics (available from Productivity Press, and a must-read).
It compares the effect of 1st-, 3rd-, and infinite-order (pipeline) delays
in the full ID model. Appendix E (Smoothing of Information) and Appendix F
(Noise) are also somewhat relevant to the question.

I find myself wanting to ask, "why normal?" The distribution cant be truly
normal, because that would imply some of the material would have a negative
arrival time, since the normal distribution is unbounded. Thus the left
tail of the arrival distribution must be truncated. Perhaps the data
actually fit an exponential or other distribution equally well anyway.

It might help to explore more deeply why the process behaves as it does.
For example, the observed behavior might be the result of two sequential
steps in a process, one of long duration and zero variance, and one of
short duration that adds all the variance.
Then you could justify tacking a short-duration Nth order delay onto the
end of a long-duration pipeline delay.

Another possibility that comes to mind - the opposite extreme of using a
3rd order delay as an approximation - is to use an infinite order delay
(pipeline, conveyor in ithink, DELAY_FIXED or DELAY MATERIAL in Vensim,
etc.). Since the variance is so narrow, this might be good enough.

There are also several tricky ways to proceed. If your time step is really
1, you could model the flow by separating it into several discrete
components with different (infinite-order) time constants, i.e.:

Outflow(t) = a*Inflow(t-tau-3)+b*Inflow(t-tau-2)
+c*Inflow(t-tau-1)+d*Inflow(t-tau)
+ ...

a, b, c, d, etc. are weights describing the shape of your distribution. You
could approximate the normal distribution with relatively few equations
this way, but it wont work if you change your time step to be smaller than
1, because the outflow given a pulse inflow will then look like a series of
spikes rather than a smooth curve. There are further tricks to avoid this
problem, but they get complicated.

One point about using pipeline delays is that while they make the equations
look simple, they are still computationally complex. A pipeline delay is
really a string of first order delays of duration equal to the simulation
time step. Thus if you have a delay of length 20 and a time step of .25,
you actually are using 80 internal levels.

The most general approach would be to write an external function that
behaves exactly as desired. This is fairly easy, but again hides some
computational complexity that might not be needed anyway.

Regards,

Tom

****************************************************
Thomas Fiddaman, Ph.D.
Ventana Systems http://www.vensim.com
34025 Mann Road Tel (360) 793-0903
Sultan, WA 98294 Fax (360) 793-2911
Tom@Vensim.com http://home.earthlink.net/~tomfid/
****************************************************
bonnell@Kodak.COM
Junior Member
Posts: 5
Joined: Fri Mar 29, 2002 3:39 am

Normal distribution

Post by bonnell@Kodak.COM »

From: William S. Bonnell

Subject: QUERY Normal distribution (SD1760)

>Hallo,
>is it possible in SD to let the value of one level flow into another in a
>normal time distribution?

Perhaps you could use a table function or a graphical function in Ithink
to get the distribution you desire for the outflow rate.

The X input to the table would be a random number (0-1)
The table function would be the CDF (cum density function) of the
distribution
you want to generate.

W. Bonnell
Eastman Kodak Co.
Rochester, NY
bonnell@kodak.com
Tom Fiddaman
Senior Member
Posts: 55
Joined: Fri Mar 29, 2002 3:39 am

Normal distribution

Post by Tom Fiddaman »

>of variable delays can be easily simulated in Stella/iThink by using
>conveyers as the delay element and using some function of
>NORMAL(mean,sd) to vary transit time (or any other distribution for
>that matter).

Im not sure a conveyor with a fixed transit time quite captures the spirit
of David Petersons remarks. If you use a conveyor with a variable transit
time, any material that enters at time t emerges at exactly time t+z, where
z might be random. This means that if the inflow is a pulse, the outflow
will be a pulse at an uncertain time. If you average many simulations, the
distribution of the output looks smooth, but in any individual simulation
it is not. This might be OK for some applications.

Theres also a practical problem with the use of conveyors (and probably
other implementations of pipeline delays), which is that all material
entering in a given time step will share the same arrival time. This
doesnt make sense to me for cows, as it implies that cows in general have
random gestation periods, but that any two cows that happen to get pregnant
in the same time step will have identical gestation periods. Its possible
to work around this problem by ensuring that cows get pregnant discretely
rather than continuously and that the time step is short enough that the
probability of two cows getting pregnant simultaneously is nil.

The conveyor with a random transit time is different from the case in which
the inflow is a pulse, and the outflow is deterministic but smeared or
diffuse, with a normal or bell shape. I think this is what David was
addressing. Im not sure which case is more relevant to the original query.

Regards,

Tom


****************************************************
Thomas Fiddaman, Ph.D.
Ventana Systems http://www.vensim.com
34025 Mann Road Tel (360) 793-0903
Sultan, WA 98294 Fax (360) 793-2911
Tom@Vensim.com http://home.earthlink.net/~tomfid/
****************************************************
Locked