此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Click for copyable input

Continuous Distributions

The functions described here are among the most commonly used continuous statistical distributions. You can compute their densities, means, variances, and other related properties. The distributions themselves are represented in the symbolic form name[param1, param2, ...]. Functions such as Mean, which give properties of statistical distributions, take the symbolic representation of the distribution as an argument. "Discrete Distributions" describes many discrete statistical distributions.
NormalDistribution[Mu,Sigma]normal (Gaussian) distribution with mean Mu and standard deviation Sigma
HalfNormalDistribution[Theta]half-normal distribution with scale inversely proportional to parameter Theta
LogNormalDistribution[Mu,Sigma]lognormal distribution based on a normal distribution with mean Mu and standard deviation Sigma
InverseGaussianDistribution[Mu,Lambda]inverse Gaussian distribution with mean Mu and scale Lambda

Distributions related to the normal distribution.

The lognormal distribution LogNormalDistribution[Mu, Sigma] is the distribution followed by the exponential of a normally distributed random variable. This distribution arises when many independent random variables are combined in a multiplicative fashion. The half-normal distribution HalfNormalDistribution[Theta] is proportional to the distribution NormalDistribution[0, 1/(Theta Sqrt[2/Pi])] limited to the domain [0, Infinity).
The inverse Gaussian distribution InverseGaussianDistribution[Mu, Lambda], sometimes called the Wald distribution, is the distribution of first passage times in Brownian motion with positive drift.
ChiSquareDistribution[Nu]Chi2 distribution with Nu degrees of freedom
InverseChiSquareDistribution[Nu]inverse Chi2 distribution with Nu degrees of freedom
FRatioDistribution[n,m]F-ratio distribution with n numerator and m denominator degrees of freedom
StudentTDistribution[Nu]Student t distribution with Nu degrees of freedom
NoncentralChiSquareDistribution[Nu,Lambda]noncentral Chi2 distribution with Nu degrees of freedom and noncentrality parameter Lambda
NoncentralStudentTDistribution[Nu,Delta]noncentral Student t distribution with Nu degrees of freedom and noncentrality parameter Delta
NoncentralFRatioDistribution[n,m,Lambda]noncentral F-ratio distribution with n numerator degrees of freedom and m denominator degrees of freedom and numerator noncentrality parameter Lambda

Distributions related to normally distributed samples.

If X1,..., XNu are independent normal random variables with unit variance and mean zero, then has a Chi2 distribution with Nu degrees of freedom. If a normal variable is standardized by subtracting its mean and dividing by its standard deviation, then the sum of squares of such quantities follows this distribution. The Chi2 distribution is most typically used when describing the variance of normal samples.
If Y follows a Chi2 distribution with Nu degrees of freedom, 1/Y follows the inverse Chi2 distribution InverseChiSquareDistribution[Nu]. A scaled inverse Chi2 distribution with Nu degrees of freedom and scale Xi can be given as InverseChiSquareDistribution[Nu, Xi]. Inverse Chi2 distributions are commonly used as prior distributions for the variance in Bayesian analysis of normally distributed samples.
A variable that has a Student t distribution can also be written as a function of normal random variables. Let X and Z be independent random variables, where X is a standard normal distribution and Z is a Chi2 variable with Nu degrees of freedom. In this case, has a t distribution with Nu degrees of freedom. The Student t distribution is symmetric about the vertical axis, and characterizes the ratio of a normal variable to its standard deviation. Location and scale parameters can be included as Mu and Sigma in StudentTDistribution[Mu, Sigma, Nu]. When Nu=1, the t distribution is the same as the Cauchy distribution.
The F-ratio distribution is the distribution of the ratio of two independent Chi2 variables divided by their respective degrees of freedom. It is commonly used when comparing the variances of two populations in hypothesis testing.
Distributions that are derived from normal distributions with nonzero means are called noncentral distributions.
The sum of the squares of Nu normally distributed random variables with variance Sigma2=1 and nonzero means follows a noncentral Chi2 distribution NoncentralChiSquareDistribution[Nu, Lambda]. The noncentrality parameter Lambda is the sum of the squares of the means of the random variables in the sum. Note that in various places in the literature, Lambda/2 or is used as the noncentrality parameter.
The noncentral Student t distribution NoncentralStudentTDistribution[Nu, Delta] describes the ratio where is a central Chi2 random variable with Nu degrees of freedom, and X is an independent normally distributed random variable with variance Sigma2=1 and mean Delta.
The noncentral F-ratio distribution NoncentralFRatioDistribution[n, m, Lambda] is the distribution of the ratio of to , where is a noncentral Chi2 random variable with noncentrality parameter Lambda and n1 degrees of freedom and is a central Chi2 random variable with m degrees of freedom.
TriangularDistribution[{a,b}]symmetric triangular distribution on the interval {a, b}
TriangularDistribution[{a,b},c]triangular distribution on the interval {a, b} with maximum at c
UniformDistribution[{min,max}]uniform distribution on the interval {min, max}

Piecewise linear distributions.

The triangular distribution TriangularDistribution[{a, b}, c] is a triangular distribution for a<X<b with maximum probability at c and a<c<b. If c is , TriangularDistribution[{a, b}, c] is the symmetric triangular distribution TriangularDistribution[{a, b}].
The uniform distribution UniformDistribution[{min, max}], commonly referred to as the rectangular distribution, characterizes a random variable whose value is everywhere equally likely. An example of a uniformly distributed random variable is the location of a point chosen randomly on a line from min to max.
BetaDistribution[Alpha,Beta]continuous beta distribution with shape parameters Alpha and Beta
CauchyDistribution[a,b]Cauchy distribution with location parameter a and scale parameter b
ChiDistribution[Nu]Chi distribution with Nu degrees of freedom
ExponentialDistribution[Lambda]exponential distribution with scale inversely proportional to parameter Lambda
ExtremeValueDistribution[Alpha,Beta]extreme maximum value (Fisher-Tippett) distribution with location parameter Alpha and scale parameter Beta
GammaDistribution[Alpha,Beta]gamma distribution with shape parameter Alpha and scale parameter Beta
GumbelDistribution[Alpha,Beta]Gumbel minimum extreme value distribution with location parameter Alpha and scale parameter Beta
InverseGammaDistribution[Alpha,Beta]inverse gamma distribution with shape parameter Alpha and scale parameter Beta
LaplaceDistribution[Mu,Beta]Laplace (double exponential) distribution with mean Mu and scale parameter Beta
LevyDistribution[Mu,Sigma]Lévy distribution with location parameter Mu and dispersion parameter Sigma
LogisticDistribution[Mu,Beta]logistic distribution with mean Mu and scale parameter Beta
MaxwellDistribution[Sigma]Maxwell (Maxwell-Boltzmann) distribution with scale parameter Sigma
ParetoDistribution[k,Alpha]Pareto distribution with minimum value parameter k and shape parameter Alpha
RayleighDistribution[Sigma]Rayleigh distribution with scale parameter Sigma
WeibullDistribution[Alpha,Beta]Weibull distribution with shape parameter Alpha and scale parameter Beta

Other continuous statistical distributions.

If X is uniformly distributed on[-Pi, Pi], then the random variable tan (X) follows a Cauchy distribution CauchyDistribution[a, b], with a=0 and b=1.
When Alpha=n/2 and Lambda=2, the gamma distribution GammaDistribution[Alpha, Lambda] describes the distribution of a sum of squares of n-unit normal random variables. This form of the gamma distribution is called a Chi2 distribution with Nu degrees of freedom. When Alpha=1, the gamma distribution takes on the form of the exponential distribution ExponentialDistribution[Lambda], often used in describing the waiting time between events.
If a random variable X follows the gamma distribution GammaDistribution[Alpha, Beta], 1/X follows the inverse gamma distribution InverseGammaDistribution[Alpha, 1/Beta]. If a random variable X follows InverseGammaDistribution[1/2, Sigma/2], X+Mu follows a Lévy distribution LevyDistribution[Mu, Sigma].
When X1 and X2 have independent gamma distributions with equal scale parameters, the random variable follows the beta distribution BetaDistribution[Alpha, Beta], where Alpha and Beta are the shape parameters of the gamma variables.
The Chi distribution ChiDistribution[Nu] is followed by the square root of a Chi2 random variable. For n=1, the Chi distribution is identical to HalfNormalDistribution[Theta] with . For n=2, the Chi distribution is identical to the Rayleigh distribution RayleighDistribution[Sigma] with Sigma=1. For n=3, the Chi distribution is identical to the Maxwell-Boltzmann distribution MaxwellDistribution[Sigma] with Sigma=1.
The Laplace distribution LaplaceDistribution[Mu, Beta] is the distribution of the difference of two independent random variables with identical exponential distributions. The logistic distribution LogisticDistribution[Mu, Beta] is frequently used in place of the normal distribution when a distribution with longer tails is desired.
The Pareto distribution ParetoDistribution[k, Alpha] may be used to describe income, with k representing the minimum income possible.
The Weibull distribution WeibullDistribution[Alpha, Beta] is commonly used in engineering to describe the lifetime of an object. The extreme value distribution ExtremeValueDistribution[Alpha, Beta] is the limiting distribution for the largest values in large samples drawn from a variety of distributions, including the normal distribution. The limiting distribution for the smallest values in such samples is the Gumbel distribution, GumbelDistribution[Alpha, Beta]. The names "extreme value" and "Gumbel distribution" are sometimes used interchangeably because the distributions of the largest and smallest extreme values are related by a linear change of variable. The extreme value distribution is also sometimes referred to as the log-Weibull distribution because of logarithmic relationships between an extreme value-distributed random variable and a properly shifted and scaled Weibull-distributed random variable.
PDF[dist,x]probability density function at x
CDF[dist,x]cumulative distribution function at x
InverseCDF[dist,q]the value of x such that CDF[dist, x] equals q
Quantile[dist,q]qth quantile
Mean[dist]mean
Variance[dist]variance
StandardDeviation[dist]standard deviation
Skewness[dist]coefficient of skewness
Kurtosis[dist]coefficient of kurtosis
CharacteristicFunction[dist,t]characteristic function Phi (t)
ExpectedValue[f,dist]expected value of the pure function f in dist
ExpectedValue[f[x],dist,x]expected value of f[x] for x in dist
Median[dist]median
Quartiles[dist]list of the th, th, th quantiles for dist
InterquartileRange[dist]difference between the first and third quartiles
QuartileDeviation[dist]half the interquartile range
QuartileSkewness[dist]quartile-based skewness measure
RandomReal[dist]pseudorandom number with specified distribution
RandomReal[dist,dims]pseudorandom array with dimensionality dims, and elements from the specified distribution

Functions of statistical distributions.

The cumulative distribution function (cdf) at x is given by the integral of the probability density function (pdf) up to x. The pdf can therefore be obtained by differentiating the cdf (perhaps in a generalized sense). In this package the distributions are represented in symbolic form. PDF[dist, x] evaluates the density at x if x is a numerical value, and otherwise leaves the function in symbolic form. Similarly, CDF[dist, x] gives the cumulative distribution.
The inverse cdf InverseCDF[dist, q] gives the value of x at which CDF[dist, x] reaches q. The median is given by InverseCDF[dist, 1/2]. Quartiles, deciles and percentiles are particular values of the inverse cdf. Quartile skewness is equivalent to (q1-2q2+q3)/ (q3-q1), where q1, q2 and q3 are the first, second and third quartiles respectively. Inverse cdfs are used in constructing confidence intervals for statistical parameters. InverseCDF[dist, q] and Quantile[dist, q] are equivalent for continuous distributions.
The mean Mean[dist] is the expectation of the random variable distributed according to dist and is usually denoted by Mu. The mean is given by yIntegralx f (x)DifferentialDx, where f (x) is the pdf of the distribution. The variance Variance[dist] is given by Integral (x-Mu)2f (x)DifferentialDx. The square root of the variance is called the standard deviation, and is usually denoted by Sigma.
The Skewness[dist] and Kurtosis[dist] functions give shape statistics summarizing the asymmetry and the peakedness of a distribution, respectively. Skewness is given by and kurtosis is given by .
The characteristic function CharacteristicFunction[dist, t] is given by Phi (t)=Integralf (x)exp (itx)DifferentialDx. In the discrete case, Phi (t)=Sumf (x)exp (itx). Each distribution has a unique characteristic function, which is sometimes used instead of the pdf to define a distribution.
The expected value ExpectedValue[g, dist] of a function g is given by Integralf (x)g (x)DifferentialDx. In the discrete case, the expected value of g is given by Sumf (x)g (x). ExpectedValue[g[x], dist, x] is equivalent to ExpectedValue[g, dist].
RandomReal[dist] gives pseudorandom numbers from the specified distribution.
This gives a symbolic representation of the gamma distribution with Alpha=3 and Beta=1.
In[1]:=
Click for copyable input
Out[1]=
Here is the cumulative distribution function evaluated at 10.
In[2]:=
Click for copyable input
Out[2]=
This is the cumulative distribution function. It is given in terms of the built-in function GammaRegularized.
In[3]:=
Click for copyable input
Out[3]=
Here is a plot of the cumulative distribution function.
In[4]:=
Click for copyable input
Out[4]=
This is a pseudorandom array with elements distributed according to the gamma distribution.
In[5]:=
Click for copyable input
Out[5]=