Statistics[Distributions] - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Distributions : Statistics/Distributions/EmpiricalDistribution

Statistics[Distributions]

 EmpiricalDistribution
 Empirical distribution

 Calling Sequence EmpiricalDistribution(sample, opts)

Parameters

 sample - a list or rtable of samples opts - (optional) an equation of the form probabilities = plist

Description

 • The empirical distribution is a discrete probability distribution with probability function generated from the given sample.
 • If opts is not given, then Maple assigns a probability to each variate present within the sample equal to the fraction of occurrences of that value within the entire sample. If opts is specified, then plist should be a list or rtable of probabilities (nonnegative real numbers adding up to 1), having equally many entries as sample; the ith entry of plist specifies the probability for the ith entry of sample.
 • If all the values in sample are positive integers, you can use the ProbabilityTable distribution instead.
 • Note that the EmpiricalDistribution command is inert and should be used in combination with the RandomVariable command.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $P≔\mathrm{Array}\left(\left[1,1,1,2,4,4,5.5\right]\right):$
 > $X≔\mathrm{RandomVariable}\left(\mathrm{EmpiricalDistribution}\left(P\right)\right):$
 > $\mathrm{ProbabilityFunction}\left(X,1\right)$
 $\frac{{3}}{{7}}$ (1)
 > $\mathrm{ProbabilityFunction}\left(X,5\right)$
 ${0}$ (2)
 > $\mathrm{ProbabilityFunction}\left(X,5.5\right)$
 $\frac{{1}}{{7}}$ (3)
 > $\mathrm{CDF}\left(X,4\right)$
 $\frac{{6}}{{7}}$ (4)
 > $\mathrm{Mean}\left(X\right)$
 ${2.64285714285714}$ (5)
 > $\mathrm{Variance}\left(X\right)$
 ${2.908163265}$ (6)
 > $Y≔\mathrm{RandomVariable}\left(\mathrm{EmpiricalDistribution}\left(⟨1,2.5,4,5⟩,'\mathrm{probabilities}'=\left[\frac{1}{3},\frac{1}{4},\frac{13}{60},\frac{1}{5}\right]\right)\right)$
 ${Y}{≔}{\mathrm{_R0}}$ (7)
 > $\mathrm{ProbabilityFunction}\left(Y,\frac{5}{2}\right)$
 $\frac{{1}}{{4}}$ (8)
 > $\mathrm{CDF}\left(Y,4.5\right)$
 ${0.8000000000}$ (9)
 > $\mathrm{Median}\left(Y\right)$
 $\frac{{5}}{{2}}$ (10)
 > $\mathrm{Tally}\left(\mathrm{Sample}\left(Y,{10}^{6}\right)\right)$
 $\left[{5.}{=}{199920}{,}{4.}{=}{216982}{,}{1.}{=}{332622}{,}{2.50000000000000}{=}{250476}\right]$ (11)

References

 Evans, Merran; Hastings, Nicholas; and Peacock, Brian. Statistical Distributions. 3rd ed. Hoboken: Wiley, 2000.
 Johnson, Norman, L.; Kotz, Samuel; and Balakrishnan, N. Continuous Univariate Distributions. 2nd ed. 2 vols. Hoboken: Wiley, 1995.
 Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

 • The probabilities option was introduced in Maple 16.