Create a Custom Distribution - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Statistics

  

Distribution

  

create new distribution

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

Distribution(D)

Distribution(T1, T2, .., Tn)

Parameters

D

-

ProbabilityDistribution; built-in probability distribution

Ti

-

Equation; function or quantity of the new distribution, including PDF, CDF, mean, moment, variance, and others

Description

• 

The Distribution command creates a new distribution with the specified distribution, functions, or quantities.

• 

The first parameter can be one of the supported distributions or a distribution function or quantity.

• 

A distribution can be defined by the following functions and quantities. The other functions and quantities are calculated if possible.  If not specified otherwise, the default value for all of these functions and quantities is FAIL, indicating that this quantity needs to be computed from others.

– 

CDF - operator

  

Operator mapping a value  to the CDF of this distribution at .

– 

CDFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the CDF.

– 

CentralMoment - operator

  

Operator mapping a positive integer  to the th CentralMoment of this distribution.

– 

CFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the CharacteristicFunction.

– 

CGF - operator

  

Operator mapping a value  to the CGF of this distribution at .

– 

CGFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the CGF.

– 

CharacteristicFunction - operator

  

Operator mapping a value  to the CharacteristicFunction of this distribution at .

– 

Conditions - list(boolean)

  

List of conditions on parameters occurring in the other defining equations for this distribution. The conditions need to be satisfied for the distribution to be valid. If the conditions are at any point known not to be satisfied, an error is raised; otherwise, the conditions are implicitly assumed to be satisfied. For this quantity, the default value is the empty list, []; you cannot specify FAIL.

  

If infolevel for Statistics is set to at least , the implicit assumptions are printed when they are made.

– 

Cumulant - operator

  

Operator mapping a positive integer  to the th Cumulant of this distribution.

– 

DiscreteValueMap - operator

  

See the DiscreteValueMap help page.

– 

HazardRate - operator

  

Operator mapping a value  to the HazardRate of this distribution at .

– 

HodgesLehmann - algebraic

  

Expression giving the Hodges-Lehmann estimator of this distribution.

– 

InverseSurvivalFunction - operator

  

Operator mapping a value  to the InverseSurvivalFunction of this distribution at .

– 

ISFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the InverseSurvivalFunction.

– 

Kurtosis - algebraic

  

Expression giving the Kurtosis of this distribution.

– 

Mean - algebraic

  

Expression giving the Mean of this distribution.

– 

Median - algebraic

  

Expression giving the Median of this distribution.

– 

MGF - operator

  

Operator mapping a value  to the MGF of this distribution at .

– 

MGFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the MGF.

– 

MillsRatio - operator

  

Operator mapping a value  to the MillsRatio of this distribution at .

– 

Mode - algebraic

  

Expression giving the Mode of this distribution.

– 

Moment - operator

  

Operator mapping a positive integer  to the th Moment of this distribution.

– 

PDF - operator

  

Operator mapping a value  to the PDF of this distribution at .

– 

PDFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the PDF.

– 

PFNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the ProbabilityFunction.

– 

ProbabilityFunction - operator

  

Operator mapping a value  to the ProbabilityFunction of this distribution at .

– 

Quantile - operator

  

Operator mapping a value  between 0 and 1 to the th Quantile of this distribution.

– 

QuantileNumeric - appliable

  

Procedure for efficiently computing a floating-point approximation to the Quantile.

– 

RandomSample - appliable

  

Procedure for efficiently computing a random sample of this distribution. The procedure should accept all of the calling sequences that Sample accepts:

• 

When called with a non-negative integer argument , the procedure should return the sample as a Vector of length  having datatype = float.

• 

When called with an integer range or a list of integer ranges, the procedure should return the sample as an Array with those dimensions having datatype = float.

• 

When called with any rtable having datatype = float, the procedure should return the sample in that rtable.

– 

RousseeuwCrouxQn - algebraic

  

Expression giving Rousseeuw and Croux' Qn of this distribution.

– 

RousseeuwCrouxSn - algebraic

  

Expression giving Rousseeuw and Croux' Sn of this distribution.

– 

Skewness - algebraic

  

Expression giving the Skewness of this distribution.

– 

Specialize - appliable

  

Procedure returning the distribution that Specialize of this distribution will return. The procedure should take a list of equations as its single argument, and return a new distribution data structure; the most convenient way to produce one is to call Distribution itself.

– 

StandardDeviation - algebraic

  

Expression giving the StandardDeviation of this distribution.

– 

StandardizedMoment - operator

  

Operator mapping a positive integer  to the th StandardizedMoment of this distribution.

– 

SFNumeric - appliable

  

Procedure for efficiently computing the SurvivalFunction of this distribution.

– 

Support - algebraic .. algebraic

  

Range containing the Support of this distribution. If a DiscreteValueMap is specified, then this should be the support in the source domain. See the DiscreteValueMap help page for more details. If the Support is not given explicitly, an attempt is made to infer the Support from the PDF or the ProbabilityFunction, falling back to the default value of  if this attempt fails.

– 

SurvivalFunction - operator

  

Operator mapping a value  to the SurvivalFunction of this distribution at .

– 

Type - equal to either discrete or continuous

  

Indicates whether the distribution is discrete (meaning it can only assume finitely or countably many values, each with positive probability) or continuous (meaning the probability for it to assume any particular value is ). The default value for this property is continuous; it cannot be FAIL. For discrete distributions that can assume non-integer values, you will need to specify a DiscreteValueMap. See the DiscreteValueMap help page for more details.

– 

Variance - algebraic

  

Expression giving the Variance of this distribution.

Examples

Create a Gamma distribution.

(1)

(2)

(3)

Create a new distribution.

(4)

(5)

(6)

(7)

(8)

(9)

(10)

(11)

The following is effectively a reimplementation of the BetaDistribution with parameters  and . We reimplement the numeric CDF procedure, so that we can call trace in order to see when it is used.

(12)

myCDFNumeric := proc(t)
 return evalf(piecewise(t<0, 0, t<1, 3*t*hypergeom([-2, 1], [2], t), 1));
end proc;
trace(myCDFNumeric):

(13)

(14)

(15)

This does not call the numeric CDF procedure - only the regular one (which in this case integrates the PDF expression symbolically):

(16)

But these calling sequences do lead to a call to myCDFNumeric:

{--> enter q, args = .5
<-- exit q (now in GetValue) = .8749999998}

(17)

{--> enter q, args = 1/2
<-- exit q (now in GetValue) = .8750000000}

(18)

For Median, it also depends on the numeric option (coincidentally, this call runs via Quantile):

(19)

{--> enter q, args = 0.
<-- exit q (now in extproc) = 0.}
{--> enter q, args = .25
<-- exit q (now in extproc) = .578124999999975}
{--> enter q, args = .25
<-- exit q (now in extproc) = .578124999999975}
{--> enter q, args = 0.
<-- exit q (now in extproc) = 0.}
{--> enter q, args = .25
<-- exit q (now in extproc) = .578124999999975}
{--> enter q, args = .216216216216226
<-- exit q (now in extproc) = .518508281839222}
{--> enter q, args = .206102270110636
<-- exit q (now in extproc) = .499627215365731}
{--> enter q, args = .206301958179384
<-- exit q (now in extproc) = .500004694760124}
{--> enter q, args = .206299474633007
<-- exit q (now in extproc) = .50000000116623}
{--> enter q, args = .206299474015915
<-- exit q (now in extproc) = .500000000000049}
{--> enter q, args = .206299474015889
<-- exit q (now in extproc) = .499999999999986}

(20)

We create a parameterized distribution with PDF  at appropriate values . The parameter  must be a positive real number.

(21)

(22)

By setting infolevel, we can see when these assumptions are used.

(23)

Statistics:-PDF -- using the following implicit assumptions: {0 < a}

(24)

It turns out that the Kurtosis of this distribution is independent of .

Statistics:-Kurtosis -- using the following implicit assumptions: {0 < a}

(25)

(26)

The speed distribution for the molecules of an ideal gas.

(27)

(28)

(29)

Create random variable having this distribution.

(30)

Compute average molecular speed.

(31)

Compare with the Maxwell distribution.

(32)

Compute average kinetic energy.

(33)

Helium at 25C.

(34)

(35)

Most probable speed.

(36)

(37)

Use simulation to verify the results.

(38)

References

  

Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

• 

The Statistics[Distribution] command was updated in Maple 16.

See Also

Statistics

Statistics[Computation]

Statistics[Distributions]

Statistics[RandomVariable]

 


Download Help Document