Distribution (FPScript)

21.09.2021

Calculates various distribution or density functions.

Syntax

Distribution(X, Distribution, Parameter1 [ , Parameter2 ])

 

The syntax of the Distribution function consists of the following parts:

Part

Description

X

Contains the X values, i. e. the values of the random variable for which the distribution function or density function is to be calculated. When calculating a discrete distribution, the X values must be integral and positive.

Permitted data structures are scalar value, data series und data matrix. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Distribution

Specifies which distribution is to be calculated and whether the distribution function or density function is to be calculated.

The argument Distribution can have the following values:

Constant

Meaning

DISTRIBUTION_NORMAL

Distribution: normal distribution, Category: continuous, Parameter1: mean, Parameter2: variance

DISTRIBUTION_LOGNORMAL

Distribution: log normal distribution, Category: continuous, Parameter1: mean, Parameter2: variance

DISTRIBUTION_EXPONENTIAL

Distribution: exponential distribution, Category: continuous, Parameter1: lambda

DISTRIBUTION_WEIBULL

Distribution: Weibull distribution, Category: continuous, Parameter1: alpha, Parameter2: beta

DISTRIBUTION_CHISQUARE

Distribution: chi-square distribution, Category: test, Parameter1: n

DISTRIBUTION_T

Distribution: student's t distribution, Category: test, Parameter1: n

DISTRIBUTION_F

Distribution: F-distribution, Category: test, Parameter1: m, Parameter2: n

DISTRIBUTION_BINOMIAL

Distribution: binomial distribution, Category: discrete, Parameter1: n, Parameter2: p

DISTRIBUTION_POISSON

Distribution: Poisson distribution, Category: discrete, Parameter1: Lambda

+ DISTRIBUTION_DENSITY

If the density function is to be calculated, then the value DISTRIBUTION_DENSITY must be added. Otherwise, the distribution function is calculated. Only the density functions can be calculated for the test distributions.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Parameter1

Specifies the first parameter for the distribution to be calculated.

Permitted data structures are scalar value. All numeric data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Parameter2

If necessary, specifies the second parameter of the distribution to be calculated.

Permitted data structures are scalar value. All numeric data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The result always has the data type 64-bit floating point.

The distributions are calculated based on various approximation formulas. Before you use the distributions calculated with this function for statistical purposes, you should check whether the accuracy is sufficient for your task.

Available in

Option Enhanced Statistics

Examples

Dim x = (100, -5, 0.101010101010101)
Signal(Distribution(x, DISTRIBUTION_NORMAL + DISTRIBUTION_DENSITY, 0, 1), x)
 

Calculates the density function of the standard normal distribution (mean 0, variance 1) in interval [-5, 5].

See Also

Distribution Analysis Object

Statistics Option

References

[1] "Hartung, Joachim": "Statistik (Statistics), 9th Edition". "Oldenbourg Verlag GmbH, Munich",1993.ISBN 3-486-22055-1.

Share article or send as email:

You might be interested in these articles