Advanced probability functions


The following functions are not actual probability distributions, but they are useful for various probabilistic analyses, including building other probability distributions. You can find them in the Advanced math library from the Definition menu.

BetaFn(a, b): The beta function, defined as:

$ BetaFn(a, b) = \int\limits_{0}^{1}x^{a -1}(1-x)^{b-1}dx $

See more at BetaFn().

BetaI(x, a, b): The incomplete beta function, defined as:

$ BetaI(x, a, b) = \frac{1}{Beta(a,b)}\int\limits_{0}^{X}x^{a -1}(1-x)^{b-1}dx $

The incomplete beta function BetaI() is equal to the cumulative probability of the beta distribution at «x». It is useful in a number of mathematical and statistical applications.

The cumulative binomial distribution, defined as the probability that an event with probability «p» occurs «k» or more times in «n» trials, is given by:

$ Pr = BetaI(p, k, n - k + 1) $

The student’s distribution with n degrees of freedom, used to test whether two observed distributions have the same mean, is readily available from the beta distribution as:

$ Student(x|n) = 1 - BetaI(n/(n + x^2), n/2, 1/2) $

The F-distribution, used to test whether two observed samples with «n1»and «n2»degrees of freedom have the same variance, is readily obtained from BetaI as:

$ F(x, n_1, n_2) = BetaI(_2 / (n_{1}x + n_2)) $

BetaIaInv(p, x, b): The inverse of the incomplete beta function with respect to the second parameter, «a». Returns the value a such that BetaI(x, a, b) = p.

See more at BetaIaInv().

BetaIInv(p, a, b): The inverse of the incomplete beta function with respect to the first parameter, «x». Returns the value «x» such that BetaI(x, a, b) = p.

See more at BetaIInv().

Combinations(k, n): «n» choose «k». The number of unique ways that «k» items can be chosen from a set of «n» elements (without replacement and ignoring the order).

Combinations(2, 4) → 6

They are: {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}

See more at Combinations().

Permutations(k, n): The number of possible permutations of «k» items taken from a bucket of «n» items.

Permutations(2, 4) → 12
They are: {1,2}, {1,3}, {1,4}, {2,1}, {2,3}, {2,4}, {3,1}, {3,2}, {3,4}, {4,1}, {4,2}, {4,3}

See more at Permutations().

Partitions(k, n): The number of ways to form «k» non-empty groups from a bucket of «n» items.

Partitions(2, 4) → 7
They are (with bar '|' separating groups): {1|2,3,4}, {2|1,3,4}, {3|1,2,4}, {4|1,2,3}, {1,2|3,4}, {1,3|2,4}, {1,4|2,3}

See more at Partitions().


CumNormal(x, mean, stddev): Returns the cumulative probability:

$ p = Pr[x ≤ X] $

for a normal distribution with a given mean and standard deviation. «mean» and «stddev» are optional and default to «mean» = 0, «stddev» = 1.

CumNormal(1) - CumNormal(-1) → .683

That is, 68.3% of the area under a normal distribution is contained within one standard deviation of the mean.

See more at CumNormal().

CumNormalInv(p, m, s): The inverse cumulative probability function for a normal distribution with mean «m» and standard deviation «s». This is also called the Probit function. Returns the value «X» where:

$ p = Pr[x ≤ X] $

«mean» and «stddev» are optional and default to «mean» = 0, «stddev» = 1.

See more at CumNormalInv().

Dawson(x): The Dawson function, or Dawson integral, defined as:

$ Dawson(x) = e^{-x^2} \int_0^x e^{t^2} dt $


See more at Dawson().

Erf(x): The error function, defined as:

$ Erf(x) = \frac{2}{\sqrt{\pi}}\int\limits_0^{\infty}e^{-t^2}dt $

See more at Erf().

ErfInv(y): The inverse error function. Returns the value «X» such that Erf(X) = y.

ErfInv(Erf(2)) → 2

See more at ErfInv().

Faddeeva(x): The Faddeeva function, also known as the Kramp function, defined for complex numbers as:

$ w(z) = e^{-z^2} \left( 1 - { 2 \over\sqrt{-\pi}} \int_0^z e^{t^2} dt \right) $

See more at Faddeeva(x).

GammaFn(x): Returns the gamma function of «x», defined as:

$ \Gamma(x) = \int\limits_0^{\infty}t^{x - 1}e^{-t}dt $

The gamma function grows very quickly. For example, when n is an integer, GammaFn(n + 1) = n!. For this reason, it is often preferable to use the LGamma() function.

See more at GammaFn().

GammaI(x, a, b): Returns the incomplete gamma function, defined as:

$ Gamma I (x, a, ''b'') = \frac{1}{\Gamma(a)}\int\limits_0^{x/b}e^{-t}t^{b-1}dt $

«a» is the shape parameter, «b» is an optional scale factor (default «b»=1). Some textbooks use λ = 1/«a» as the scale factor. The incomplete gamma function is defined for «x» ≥ 0 .

The incomplete gamma function returns the cumulative area from zero to «x» under the gamma distribution.

The incomplete gamma function is useful in a number of mathematical and statistical contexts.

The cumulative Poisson distribution function, which encodes the probability that the number of Poisson random events («x») occurring will be less than k (where k is an integer) where the expected mean number is a, is given by (recall that parameter «b» is optional).

$ P(x < k) = GammaI(k, a) $

See more at GammaI().

GammaIInv(y, a, b): The inverse of the incomplete gamma function. Returns the value «x» such that GammaI(x, a, b) = y. «b» is optional and defaults to 1.

See more at GammaIInv().

Logit(p): The logit function, or log-odds function, is defined for 0 < «p» < 1 as

$ Logit(p) = \ln(\frac{p}{1 - p}) $

The inverse of the Logit function is the Sigmoid function.

Sigmoid(x): The sigmoid function approaches 0 as «x» approaches $ -\infty $ and approaches 1 as «x» approaches $ \infty $, crossing 0.5 at «x»=0. It is also sometimes called the expit function or the inverse logit function. It is defined as

$ Sigmoid(x) = \frac{1}{1 + exp(-x)} $

The inverse of the Sigmoid function is the Logit function.

See Also


Comments


You are not allowed to post comments.