Normal distribution

Revision as of 20:55, 7 July 2011 by Lchrisman (talk | contribs) (Parameter estimation)


Normal distribution function.

Normal(mean,stddev,over)

Creates a normal or Gaussian probability distribution with mean and standard deviation stddev. The standard deviation must be 0 or greater. The range [mean-stddev, mean+stddev] encloses about 68% of the probability.

As with all distribution functions in Analytica, Normal allows you to specify an optional parameter «over». Without this parameter, with scalar «mean» and «stddev» parameters, a single random normal variate is generated. If you want the random variate to vary independently across one or more indexes, then those indexes can be specified in «over». If the «mean» or «stddev» parameters are array-valued, then Normal returns an array of random values that are statistically independent across the indexes of the parameters.

When to use

Use a normal distribution if the uncertain quantity is unimodal and symmetric and the upper and lower bounds are unknown, possibly very large or very small (unbounded). This distribution is particularly appropriate if you believe that the uncertain quantity is the sum or average of a large number of independent, random quantities.

Library

Distributions

Parameter Estimation

Suppose you want to fit a Normal distribution to historical data. Assume your data is in an array, X indexed by I. The parameters of the Normal distribution as obtained using:

«mean» := Mean(X,I)
«stddev» := SDeviation(X,I)

Examples

Normal(30,5) → Normal.png

Brownian Motion

A discrete-time Brownian process in time can be encoded as:

Dynamic( 0, Self[Time-1] + Normal(0,1) )

or as

Cumulate( Normal(0,1,over:Time), Time )

Please take note of several subtleties with these examples. First, these two are not quite equivalent -- they treat the @Time=1 case differently. Either can be adjusted to treat the first time point as fixed or random - this is left as an exercise for the reader (solution is in the discussion tab). Second, notice that the «over» parameter was necessary in the Cumulate example. Without it, the expression:

Cumulate( Normal(0,1), Time )

would select a single delta value that would apply to all time periods, resulting in a straight line with a random slope, rather than a random walk. The «over» parameter is not required in the Dynamic example since the recurrence expression is re-evaluated at each time step, causing the random variates to be independent automatically.

See Also

Comments


You are not allowed to post comments.