Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

52.2.1 Normal Random Variable

Normal random variables (also called Gaussian) is denoted by \({\it Normal}(m, s)\) where \(m\) is the mean and \(s > 0\) is the standard deviation.

Function: pdf_normal (x,m,s)

Returns the value at x of the density function of a \({\it Normal}(m, s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The pdf is

\[f(x; m, s) = {1\over s\sqrt{2\pi}} e^{\displaystyle -{(x-m)^2\over 2s^2}} \]

Categories: Package distrib ·
Function: cdf_normal (x,m,s)

Returns the value at x of the distribution function of a \({\it Normal}(m, s)\) random variable, with \(s>0\). This function is defined in terms of Maxima’s built-in error function erf.

The cdf can be written analytically:

\[F(x; m, s) = {1\over 2} + {1\over 2} {\rm erf}\left(x-m\over s\sqrt{2}\right) \]

(%i1) load ("distrib")$
(%i2) cdf_normal(x,m,s);
                             x - m
                       erf(---------)
                           sqrt(2) s    1
(%o2)                  -------------- + -
                             2          2

See also erf.

Categories: Package distrib ·
Function: quantile_normal (q,m,s)

Returns the q-quantile of a \({\it Normal}(m, s)\) random variable, with \(s>0\); in other words, this is the inverse of cdf_normal. Argument q must be an element of \([0,1]\). To make use of this function, write first load("distrib").

(%i1) load ("distrib")$
(%i2) quantile_normal(95/100,0,1);
                                         9
(%o2)                sqrt(2) inverse_erf(--)
                                         10
(%i3) float(%);
(%o3)                   1.644853626951472
Categories: Package distrib ·
Function: mean_normal (m,s)

Returns the mean of a \({\it Normal}(m, s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The mean is

\[E[X] = m \]

Categories: Package distrib ·
Function: var_normal (m,s)

Returns the variance of a \({\it Normal}(m, s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The variance is

\[V[X] = s^2 \]

Categories: Package distrib ·
Function: std_normal (m,s)

Returns the standard deviation of a \({\it Normal}(m, s)\) random variable, with \(s>0\), namely s. To make use of this function, write first load("distrib").

The standard deviation is

\[D[X] = s \]

Categories: Package distrib ·
Function: skewness_normal (m,s)

Returns the skewness coefficient of a \({\it Normal}(m, s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The skewness coefficient is

\[SK[X] = 0 \]

Categories: Package distrib ·
Function: kurtosis_normal (m,s)

Returns the kurtosis coefficient of a \({\it Normal}(m, s)\) random variable, with \(s>0\), which is always equal to 0. To make use of this function, write first load("distrib").

The kurtosis coefficient is

\[KU[X] = 0 \]

Categories: Package distrib ·
Function: random_normal (m,s)
    random_normal (m,s,n)

Returns a \({\it Normal}(m, s)\) random variate, with \(s>0\). Calling random_normal with a third argument n, a random sample of size n will be simulated.

This is an implementation of the Box-Mueller algorithm, as described in Knuth, D.E. (1981) Seminumerical Algorithms. The Art of Computer Programming. Addison-Wesley.

To make use of this function, write first load("distrib").

Categories: Package distrib · Random numbers ·

Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

JavaScript license information