Probability Distributions

All of the following functions take one or two arguments, and return a column vector or a matrix of random numbers. For example, normal(5) returns a column of five random numbers, while normal(3,6) returns a matrix of random numbers of random numbers of normal distribution.

Each distribution may have a few public parameters, which can be modified. For example, the normal function has two public parameters mu and sigma with default values mu = 0 and sigma = 1.

To change the values of the public parameters, the global keyword must be used. E.g., global.normal.sigma = 0.5 will change the sigma parameter of the system's normal function to 0.5. Alternatively, you can create your own copy of the normal distribution with your chosen values of the parameters. For example,

rv = normal[3, 2];
or
rv = normal;
rv.mu = 3;
rv.sigma = 2;
will generate a normal distribution with mu = 3 and sigma = 2.

The private parameters mean, stddev, and variance are attributes (mean, standard deviation, and variance) of the distribution. For example, rv.stddev returns the standard deviation of the random variable rv. The private parameters pdf, prob, and quantile are attribute functions.

List of probability distributions:

rand: uniform distribution.
Public parameter: range

randz: random integer.
Public parameter: range

normal: normal distribution.
public parameter: mu and sigma
private parameter: mean, stddev, variance, pdf, prob, quantile

gauss: Normal distribution with and .
gammarv: Gamma distribution.
public parameter: location, scale, and shape.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
betarv: Beta distribution.
public parameter: a, b.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
binomial: Binomial distribution.
public parameter: n, p.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
poisson: Poisson distribution.
public parameter: mu.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
chi: Chi-square distribution.
public parameter: df.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
frv: F distribution.
public parameter: dfn, dfd.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
exprv: Exponential distribution.
public parameter: mu.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
student: Student t-distribution.
public parameter: df.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
hypergom: Hypergeometric distribution.
public parameter: N, D, n.
private parameter: mean, stddev, variance, pdf, cdf, prob, quantile
multinomial: Multinomial distribution.
public parameter: n, p

oz 2009-12-22