Inverse Gaussian distribution

From testwiki
Revision as of 03:31, 16 February 2025 by 70.231.16.221 (talk) (Single parameter form)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:For Template:Probability distribution

In probability theory, the inverse Gaussian distribution (also known as the Wald distribution) is a two-parameter family of continuous probability distributions with support on (0,∞).

Its probability density function is given by

f(x;μ,λ)=λ2πx3exp(λ(xμ)22μ2x)

for x > 0, where μ>0 is the mean and λ>0 is the shape parameter.Template:R

The inverse Gaussian distribution has several properties analogous to a Gaussian distribution. The name can be misleading: it is an "inverse" only in that, while the Gaussian describes a Brownian motion's level at a fixed time, the inverse Gaussian describes the distribution of the time a Brownian motion with positive drift takes to reach a fixed positive level.

Its cumulant generating function (logarithm of the characteristic function)Template:Contradictory inline is the inverse of the cumulant generating function of a Gaussian random variable.

To indicate that a random variable X is inverse Gaussian-distributed with mean μ and shape parameter λ we write XIG(μ,λ).

Properties

Single parameter form

The probability density function (pdf) of the inverse Gaussian distribution has a single parameter form given by

f(x;μ,μ2)=μ2πx3exp((xμ)22x).

In this form, the mean and variance of the distribution are equal, 𝔼[X]=Var(X).

Also, the cumulative distribution function (cdf) of the single parameter inverse Gaussian distribution is related to the standard normal distribution by

Pr(X<x)=Φ(z1)+e2μΦ(z2),

where z1=μx1/2x1/2, z2=μx1/2+x1/2, and the Φ is the cdf of standard normal distribution. The variables z1 and z2 are related to each other by the identity z22=z12+4μ.

In the single parameter form, the MGF simplifies to

M(t)=exp[μ(112t)].

An inverse Gaussian distribution in double parameter form f(x;μ,λ) can be transformed into a single parameter form f(y;μ0,μ02) by appropriate scaling y=μ2xλ, where μ0=μ3/λ.

The above paragraph can be re-written as: if Y=λX/μ2, then YIG(λ/μ,(λ/μ)2)Template:R. This approach is better in the sense that it clearly shows dimensionless nature of the single parameter form (note that dimλ=dimμ=dimx). This property follows from a more general fact: if a>0 and Y=aX, then YIG(aμ,aλ)Template:R.

The standard form of inverse Gaussian distribution is

f(x;1,1)=12πx3exp((x1)22x).

Summation

If Xi has an IG(μ0wi,λ0wi2) distribution for i = 1, 2, ..., n and all Xi are independent, then

S=i=1nXiIG(μ0wi,λ0(wi)2).

Note that

Var(Xi)E(Xi)=μ02wi2λ0wi2=μ02λ0

is constant for all i. This is a necessary condition for the summation. Otherwise S would not be Inverse Gaussian distributed.

Scaling

For any t > 0 it holds that

XIG(μ,λ)tXIG(tμ,tλ).

Exponential family

The inverse Gaussian distribution is a two-parameter exponential family with natural parametersλ/(2μ2) and −λ/2, and natural statistics X and 1/X.

For λ>0 fixed, it is also a single-parameter natural exponential family distributionTemplate:R where the base distribution has density

h(x)=λ2πx3exp(λ2x)𝟙[0,)(x).

Indeed, with θ0,

p(x;θ)=exp(θx)h(x)exp(θy)h(y)dy

is a density over the reals. Evaluating the integral, we get

p(x;θ)=λ2πx3exp(λ2x+θx2λθ)𝟙[0,)(x).

Substituting θ=λ/(2μ2) makes the above expression equal to f(x;μ,λ).

Relationship with Brownian motion

Example of stopped random walks with α=1,ν=0.1,σ=0.2. The upper figure shows the histogram of waiting times, along with the prediction according to inverse gaussian distribution. The lower figure shows the trajectories.

Let the stochastic process Xt be given by

X0=0
Xt=νt+σWt

where Wt is a standard Brownian motion. That is, Xt is a Brownian motion with drift ν>0.

Then the first passage time for a fixed level α>0 by Xt is distributed according to an inverse-Gaussian:

Tα=inf{t>0Xt=α}IG(αν,(ασ)2)=ασ2πx3exp((ανx)22σ2x)

i.e

P(Tα(T,T+dT))=ασ2πT3exp((ανT)22σ2T)dT

(cf. SchrödingerTemplate:R equation 19, SmoluchowskiTemplate:R, equation 8, and FolksTemplate:R, equation 1).

Template:Collapse top Suppose that we have a Brownian motion Xt with drift ν defined by:

Xt=νt+σWt,X(0)=x0

And suppose that we wish to find the probability density function for the time when the process first hits some barrier α>x0 - known as the first passage time. The Fokker-Planck equation describing the evolution of the probability distribution p(t,x) is:

pt+νpx=12σ22px2,{p(0,x)=δ(xx0)p(t,α)=0

where δ() is the Dirac delta function. This is a boundary value problem (BVP) with a single absorbing boundary condition p(t,α)=0, which may be solved using the method of images. Based on the initial condition, the fundamental solution to the Fokker-Planck equation, denoted by φ(t,x), is:

φ(t,x)=12πσ2texp[(xx0νt)22σ2t]

Define a point m, such that m>α. This will allow the original and mirror solutions to cancel out exactly at the barrier at each instant in time. This implies that the initial condition should be augmented to become:

p(0,x)=δ(xx0)Aδ(xm)

where A is a constant. Due to the linearity of the BVP, the solution to the Fokker-Planck equation with this initial condition is:

p(t,x)=12πσ2t{exp[(xx0νt)22σ2t]Aexp[(xmνt)22σ2t]}

Now we must determine the value of A. The fully absorbing boundary condition implies that:

(αx0νt)2=2σ2tlogA+(αmνt)2

At p(0,α), we have that (αx0)2=(αm)2m=2αx0. Substituting this back into the above equation, we find that:

A=e2ν(αx0)/σ2

Therefore, the full solution to the BVP is:

p(t,x)=12πσ2t{exp[(xx0νt)22σ2t]e2ν(αx0)/σ2exp[(x+x02ανt)22σ2t]}

Now that we have the full probability density function, we are ready to find the first passage time distribution f(t). The simplest route is to first compute the survival function S(t), which is defined as:

S(t)=αp(t,x)dx=Φ(αx0νtσt)e2ν(αx0)/σ2Φ(α+x0νtσt)

where Φ() is the cumulative distribution function of the standard normal distribution. The survival function gives us the probability that the Brownian motion process has not crossed the barrier α at some time t. Finally, the first passage time distribution f(t) is obtained from the identity:

f(t)=dSdt=(αx0)2πσ2t3e(αx0νt)2/2σ2t

Assuming that x0=0, the first passage time follows an inverse Gaussian distribution:

f(t)=α2πσ2t3e(ανt)2/2σ2tIG[αν,(ασ)2]

Template:Collapse bottom

When drift is zero

A common special case of the above arises when the Brownian motion has no drift. In that case, parameter μ tends to infinity, and the first passage time for fixed level α has probability density function

f(x;0,(ασ)2)=ασ2πx3exp(α22σ2x)

(see also BachelierTemplate:RTemplate:R). This is a Lévy distribution with parameters c=(ασ)2 and μ=0.

Maximum likelihood

The model where

XiIG(μ,λwi),i=1,2,,n

with all wi known, (μλ) unknown and all Xi independent has the following likelihood function

L(μ,λ)=(λ2π)n2(i=1nwiXi3)12exp(λμi=1nwiλ2μ2i=1nwiXiλ2i=1nwi1Xi).

Solving the likelihood equation yields the following maximum likelihood estimates

μ^=i=1nwiXii=1nwi,1λ^=1ni=1nwi(1Xi1μ^).

μ^ and λ^ are independent and

μ^IG(μ,λi=1nwi),nλ^1λχn12.

Sampling from an inverse-Gaussian distribution

The following algorithm may be used.Template:R

Generate a random variate from a normal distribution with mean 0 and standard deviation equal 1

νN(0,1).

Square the value

y=ν2

and use the relation

x=μ+μ2y2λμ2λ4μλy+μ2y2.

Generate another random variate, this time sampled from a uniform distribution between 0 and 1

zU(0,1).

If zμμ+x then return x else return μ2x.

Sample code in Java:

public double inverseGaussian(double mu, double lambda) {
    Random rand = new Random();
    double v = rand.nextGaussian();  // Sample from a normal distribution with a mean of 0 and 1 standard deviation
    double y = v * v;
    double x = mu + (mu * mu * y) / (2 * lambda) - (mu / (2 * lambda)) * Math.sqrt(4 * mu * lambda * y + mu * mu * y * y);
    double test = rand.nextDouble();  // Sample from a uniform distribution between 0 and 1
    if (test <= (mu) / (mu + x))
        return x;
    else
        return (mu * mu) / x;
}
Wald distribution using Python with aid of matplotlib and NumPy

And to plot Wald distribution in Python using matplotlib and NumPy:

import matplotlib.pyplot as plt
import numpy as np

h = plt.hist(np.random.wald(3, 2, 100000), bins=200, density=True)

plt.show()
  • If XIG(μ,λ), then kXIG(kμ,kλ) for any number k>0.Template:R
  • If XiIG(μ,λ) then i=1nXiIG(nμ,n2λ)
  • If XiIG(μ,λ) for i=1,,n then X¯IG(μ,nλ)
  • If XiIG(μi,2μi2) then i=1nXiIG(i=1nμi,2(i=1nμi)2)
  • If XIG(μ,λ), then λ(Xμ)2/μ2Xχ2(1).[1]

The convolution of an inverse Gaussian distribution (a Wald distribution) and an exponential (an ex-Wald distribution) is used as a model for response times in psychology,Template:R with visual search as one example.[2]

History

This distribution appears to have been first derived in 1900 by Louis BachelierTemplate:R as the time a stock reaches a certain price for the first time. In 1915 it was used independently by Erwin SchrödingerTemplate:R and Marian v. SmoluchowskiTemplate:R as the time to first passage of a Brownian motion. In the field of reproduction modeling it is known as the Hadwiger function, after Hugo Hadwiger who described it in 1940.[3] Abraham Wald re-derived this distribution in 1944Template:R as the limiting form of a sample in a sequential probability ratio test. The name inverse Gaussian was proposed by Maurice Tweedie in 1945.[4] Tweedie investigated this distribution in 1956[5] and 1957[6][7] and established some of its statistical properties. The distribution was extensively reviewed by Folks and Chhikara in 1978.Template:R

Rated Inverse Gaussian Distribution

Assuming that the time intervals between occurrences of a random phenomenon follow an inverse Gaussian distribution, the probability distribution for the number of occurrences of this event within a specified time window is referred to as rated inverse Gaussian.[8] While, first and second moment of this distribution are calculated, the derivation of the moment generating function remains an open problem.

Numeric computation and software

Despite the simple formula for the probability density function, numerical probability calculations for the inverse Gaussian distribution nevertheless require special care to achieve full machine accuracy in floating point arithmetic for all parameter values.[9] Functions for the inverse Gaussian distribution are provided for the R programming language by several packages including rmutil,[10][11] SuppDists,[12] STAR,[13] invGauss,[14] LaplacesDemon,[15] and statmod.[16]

See also

References

Template:Reflist

Further reading

Template:ProbDistributions Template:Authority control