The Statistics package contains 37 probability distributions as well as providing functionality for creating new distributions and manipulating random variables.
1 Continuous Probability Distributions
The Statistics package includes 28 continuous probability distributions along with commands for manipulating and creating continuous random variables. Continuous probability distributions are defined by a continuous probability density function along a section of the real line.
Consider a chi square random variable. The chi square random variable takes a single parameter which represents the number of degrees of freedom. When the random variable is created using the RandomVariable constructor, it generates a new name for the random variable data structure and returns it.
The probability density function, as well as all other distribution commands, accepts either a random variable or probability distribution as its first parameter. The 'mainbranch' option can be used to return only the main branch of the distribution.
Combinations of probability distributions can be generated by performing operations on a set of random variables. For example, consider the product of a uniform random variable and a normal (gaussian) random variable.
2 Discrete Probability Distributions
The Statistics package includes 9 discrete probability distributions and commands for manipulating and creating discrete random variables.
Consider a binomial random variable. Unlike continuous random variables, discrete random variables are defined by their probability function rather than their probability density function.
The Statistics package also allows for both numeric and symbolic manipulation of random variables and distributions. Consider the negative binomial distribution with symbolic parameters.
CDFT,x assuming x ∷ posint
Further, the Statistics package supports the probability table. This distribution is used to associate probabilities with the integers 1..n, for any n. Consider a case of n = 5.
The Statistics package also supports the empirical distribution, which is effectively a probability distribution built around a data sample. The probability of each element is equal to its frequency in the data sample.
3 Random Sample Generation
All probability distributions provide optimized hardware-level random number generators capable of generating very large pseudo-random samples quickly.
Generate a sample from a Binomial distribution.
Generate a sample from a probability table distribution.
Sample a non-central chi square distribution and plot the histogram of the output against the probability density function.
4 Custom Random Variables
The Statistics package includes the Distribution constructor, which can be used to create custom random variables.
A distribution that is occasionally used in statistics is the half-normal distribution, named so because it is a normal distribution that has been cropped at all negative values.
Create a distribution module using the half normal PDF.
Compute the characteristics of this distribution.
Return to Index for Example Worksheets
Download Help Document