Difference between revisions of "Advanced probability functions"

Line 5: Line 5:
 
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.
 
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):''' The beta function, defined as:
  
 
<center><math>
 
<center><math>
Line 11: Line 11:
 
</math></center>
 
</math></center>
  
'''[[BetaI]](x, a, b):''' The incomplete beta function, defined as:
+
See more at [[BetaFn]]().
 +
 
 +
'''BetaI(x, a, b):''' The incomplete beta function, defined as:
  
 
<center><math>
 
<center><math>
Line 17: Line 19:
 
</math></center>
 
</math></center>
  
The incomplete beta function is equal to the cumulative probability of the beta distribution at '''x'''. It is useful in a number of mathematical and statistical applications.
+
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:
 
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:
Line 25: Line 27:
 
</math></center>
 
</math></center>
  
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:
+
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:
  
 
<center><math>
 
<center><math>
Line 37: Line 39:
 
</math></center>
 
</math></center>
  
'''[[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'''.
+
'''BetaIaInv(p, x, b):''' The inverse of the incomplete beta function with respect to the second parameter, «a». Returns the value a such that <code>BetaI(x, a, b) = p</code>.
 +
 
 +
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 <code>BetaI(x, a, b) = p</code>.
  
'''[[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(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) &rarr; 6
+
:<code>Combinations(2, 4) &rarr; 6</code>
  
 
They are: {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}
 
They are: {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}
  
'''[[Permutations]](k, n):''' The number of possible permutations of '''k''' items taken from a bucket of '''n''' items.
+
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) &rarr; 12
+
:<code>Permutations(2, 4) &rarr; 12</code>
  
: 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}
+
: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}
  
'''[[CumNormal]](x, ''mean, stddev''):''' Returns the cumulative probability:
+
See more at [[Permutations]]().
 +
 
 +
'''CumNormal(x, ''mean, stddev''):''' Returns the cumulative probability:
  
 
<center><math>
 
<center><math>
Line 59: Line 69:
 
</math></center>
 
</math></center>
  
for a normal distribution with a given mean and standard deviation. '''mean''' and '''stddev''' are optional and default to '''mean = 0, stddev = 1'''.
+
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) &rarr; .683
+
:code>CumNormal(1) - CumNormal(-1) &rarr; .683</code>
  
 
That is, 68.3% of the area under a normal distribution is contained within one standard deviation
 
That is, 68.3% of the area under a normal distribution is contained within one standard deviation
 
of the mean.
 
of the mean.
  
'''[[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 <code>X</code> where:
+
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 <code>X</code> where:
  
 
<center><math>
 
<center><math>
Line 72: Line 84:
 
</math></center>
 
</math></center>
  
'''mean''' and '''stddev''' are optional and default to '''mean''' = 0, '''stddev''' = 1.
+
«mean» and «stddev» are optional and default to «mean» = 0, «stddev» = 1.
 +
 
 +
See more at [[CumNormalInv]]().
  
'''[[Erf]](x):''' The error function, defined as:
+
'''Erf(x):''' The error function, defined as:
  
 
<center><math>
 
<center><math>
Line 80: Line 94:
 
</math></center>
 
</math></center>
  
'''[[ErfInv]](y):''' The inverse error function. Returns the value '''X''' such that '''Erf(X)=y'''.
+
See more at [[Erf]]().
 +
 
 +
'''ErfInv(y):''' The inverse error function. Returns the value '''X''' such that <code>Erf(X) = y</code>.
 +
 
 +
:<code>ErfInv(Erf(2)) &rarr; 2</code>
  
ErfInv(Erf(2)) &rarr; 2
+
See more at [[ErfInv]]().
  
'''[[GammaFn]](x):''' Returns the gamma function of '''x''', defined as:
+
'''GammaFn(x):''' Returns the gamma function of «x», defined as:
  
 
<center><math>
 
<center><math>
Line 90: Line 108:
 
</math></center>
 
</math></center>
  
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.
+
The gamma function grows very quickly. For example, when ''n'' is an integer, <code>GammaFn(n+1) = n!</code>. 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:
+
'''GammaI(x, a, ''b''):''' Returns the incomplete gamma function, defined as:
  
 
<center><math>
 
<center><math>
Gamma I (x, a, b) = \frac{1}{\Gamma(a)}\int\limits_0^{x/b}e^{-t}t^{b-1}dt
+
Gamma I (x, a, ''b'') = \frac{1}{\Gamma(a)}\int\limits_0^{x/b}e^{-t}t^{b-1}dt
 
</math></center>
 
</math></center>
  
'''a''' is the shape parameter, b is an optional scale factor (default '''b'''=1). Some textbooks use &lambda; = 1/a as the scale factor. The incomplete gamma function is defined for x &ge; 0  .
+
«a» is the shape parameter, «b» is an optional scale factor (default «b»=1). Some textbooks use &lambda; = 1/«a» as the scale factor. The incomplete gamma function is defined for «x» &ge; 0  .
  
The incomplete gamma function returns the cumulative area from zero to '''x''' under the gamma distribution.
+
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 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).
+
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).
  
 
<center><math>
 
<center><math>
Line 110: Line 130:
 
</math></center>
 
</math></center>
  
'''[[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 [[GammaI]]().
 +
 
 +
'''GammaIInv(y, a, ''b''):''' The inverse of the incomplete gamma function. Returns the value '''x''' such that <code>GammaI(x, a, b) = y</code>. «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):''' The ''logit'' function, or ''log-odds function'', is defined for 0 < «p» < 1 as
  
 
<center><math>
 
<center><math>
Line 118: Line 142:
 
</math></center>
 
</math></center>
  
The inverse of the '''Logit''' function is the '''Sigmoid''' function.
+
The inverse of the [[Logit]] function is the [[Sigmoid]] function.
  
'''[[Sigmoid]](x):''' The sigmoid function approaches 0 as x approaches <math>-\infty</math>  and approaches 1 as x approaches <math>\infty</math>, 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):''' The sigmoid function approaches 0 as «x» approaches <math>-\infty</math>  and approaches 1 as «x» approaches <math>\infty</math>, crossing 0.5 at «x»=0. It is also sometimes called the ''expit function'' or the ''inverse logit function''. It is defined as
  
 
<center><math>
 
<center><math>
Line 126: Line 150:
 
</math></center>
 
</math></center>
  
The inverse of the '''Sigmoid''' function is the '''Logit''' function.
+
The inverse of the [[Sigmoid]]''' function is the [[Logit]] function.
  
 
==See Also==
 
==See Also==

Revision as of 02:19, 30 December 2015


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:

[math]\displaystyle{ BetaFn(a, b) = \int\limits_{0}^{1}x^{a -1}(1-x)^{b-1}dx }[/math]

See more at BetaFn().

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

[math]\displaystyle{ BetaI(x, a, b) = \frac{1}{Beta(a,b)}\int\limits_{0}^{X}x^{a -1}(1-x)^{b-1}dx }[/math]

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:

[math]\displaystyle{ Pr = BetaI(p, k, n - k + 1) }[/math]

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:

[math]\displaystyle{ Student(x|n) = 1 - BetaI(n/(n + x^2), n/2, 1/2) }[/math]

The F-distribution, used to test whether two observed samples with n<sub1>and n2degrees of freedom have the same variance, is readily obtained from BetaI as:

[math]\displaystyle{ F(x, n_1, n_2) = BetaI(_2 / (n_{1}x + n_2)) }[/math]

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().

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

[math]\displaystyle{ p = Pr[x ≤ X] }[/math]

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

code>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:

[math]\displaystyle{ p = Pr[x ≤ X] }[/math]

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

See more at CumNormalInv().

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

[math]\displaystyle{ Erf(x) = \frac{2}{\sqrt{\pi}}\int\limits_0^{\infty}e^{-t^2}dt }[/math]

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().

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

[math]\displaystyle{ \Gamma(x) = \int\limits_0^{\infty}t^{x - 1}e^{-t}dt }[/math]

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:

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

«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).

[math]\displaystyle{ P(x \lt k) = GammaI(k, a) }[/math]

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

[math]\displaystyle{ Logit(p) = \ln(\frac{p}{1 - p}) }[/math]

The inverse of the Logit function is the Sigmoid function.

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

[math]\displaystyle{ Sigmoid(x) = \frac{1}{1 + exp(-x)} }[/math]

The inverse of the Sigmoid function is the Logit function.

See Also

Comments


You are not allowed to post comments.