details of discrete distributions - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics : Statistics Package : Quantities : Statistics/DiscreteValueMap

Statistics[DiscreteValueMap] - details of discrete distributions

Calling Sequence

DiscreteValueMap(X, n)

Parameters

X

-

algebraic; random variable or distribution

n

-

algebraic; point

Description

• 

The DiscreteValueMap command returns technical details about the Maple implementation of discrete probability distributions.

• 

Maple can deal with two types of probability distributions: continuous ones, which can assume a continuum of values (each individual value having probability 0), and discrete ones, which can assume a finite or countable set of values (each having positive probability). (It is possible to conceive of mixed distributions, which assume some values with positive probability and can also assume a continuum of values, but they do not occur too frequently in practice and Maple has no support for them.)

• 

By default, discrete probability distributions assume only integer values, but some distributions can also assume non-integer values. One way to achieve this is to use the EmpiricalDistribution - currently the only pre-defined distribution that can be made to have non-integer values.

• 

The other way to use discrete distributions that assume non-integer values is define them using the Distribution command with the option Type = discrete and specify a value for Support and DiscreteValueMap. This will be the subject of the remainder of this help page.

• 

For this approach, Maple needs a way to generate the values that the distribution can assume. This is provided by the Support and DiscreteValueMap arguments. In particular, Support specifies a range of integers, and DiscreteValueMap specifies a mapping, so that applying DiscreteValueMap to this range of integers yields all possible values of the distribution.

• 

For example, consider the distribution that assumes value 13 with probability 12, value 19 with probability 14, and generally value 3n with probability 2n for positive integers n. (These probabilities sum to 1, which is necessary for it to be a valid distribution.) We could specify these values as Support=1.., DiscreteValueMap=n3n.

• 

For technical reasons, correct results for Maple's calculations can only be guaranteed if DiscreteValueMap is either strictly ascending or strictly descending. (As a consequence, it is impossible to, for example, specify a set of values that are dense in an open interval.)

• 

When used as a separate command, using the calling sequences shown above, DiscreteValueMap evaluates the discrete value map of the given random variable at the parameter n. If the DiscreteValueMap is not defined for this random variable, DiscreteValueMap returns FAIL.

• 

Apart from specifying these values, we will still need to specify the probabilities. These are typically given by specifying the ProbabilityFunction.

• 

The ProbabilityFunction can have nonzero values at values outside the Support generated values; these nonzero values are ignored. This is also true for distributions assuming only integer values; for example, the GeometricDistribution has a ProbabilityFunction equal to expr. This is nonzero for, for example, n=32, but this value is ignored. Similarly, when a DiscreteValueMap is given, then the ProbabilityFunction can be nonzero outside images of the DiscreteValueMap - that is, at values the distribution cannot actually assume. The reasons will be illustrated by the continued example from above.

• 

In the previous example, we would specify ProbabilityFunction=tpiecewiset0,0,t13,2log3t,0. It would be cumbersome to specify a probability function that is nonzero only at negative powers of 3; but we don't need to, since only the values at images of the DiscreteValueMap are relevant.

Examples

The example described in the text above looks like this:

withStatistics:

pf:=t&rarr;piecewiset0&comma;0&comma;t<1&comma;2log3t&comma;0

pf:=t&rarr;piecewiset0&comma;0&comma;t<1&comma;2log3t&comma;0

(1)

dist:=Distribution&apos;ProbabilityFunction&apos;&equals;pf&comma;&apos;Support&apos;&equals;1..&infin;&comma;&apos;DiscreteValueMap&apos;&equals;n&rarr;3n&comma;&apos;Type&equals;discrete&apos;

dist:=moduleoptionDistribution&comma;Discrete&semi;exportDiscreteValueMap&comma;ProbabilityFunction&comma;Support&comma;Conditions&semi;end module

(2)

Meandist

15

(3)

sortTallySampledist&comma;1000

0.0000169350878084303&equals;1&comma;0.0000508052634252909&equals;1&comma;0.000152415790275873&equals;2&comma;0.000457247370827618&equals;6&comma;0.00137174211248285&equals;13&comma;0.00411522633744856&equals;31&comma;0.0123456790123457&equals;72&comma;0.0370370370370370&equals;123&comma;0.111111111111111&equals;255&comma;0.333333333333333&equals;496

(4)

DiscreteValueMapdist&comma;n

3n

(5)

The normal distribution is continuous; it doesn't have a DiscreteValueMap. The geometric distribution is discrete, but it necessarily assumes integer values, so it also doesn't have a DiscreteValueMap.

DiscreteValueMapNormal0&comma;1&comma;n

FAIL

(6)

DiscreteValueMapRandomVariableGeometric13&comma;n

FAIL

(7)

The EmpiricalDistribution does have a DiscreteValueMap. It enumerates the values in sorted order.

X:=RandomVariableEmpiricalDistribution1&comma;&pi;&comma;2&comma;2&comma;5

X:=_R4

(8)

DiscreteValueMapX&comma;n

5&comma;1&comma;2&comma;2&comma;&pi;n

(9)

DiscreteValueMapX&comma;3

2

(10)

See Also

Statistics, Statistics[Computation], Statistics[Distributions], Statistics[RandomVariable]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam