Inverse Gaussian distribution

From testwiki
Jump to navigation Jump to search

Template:Short description Template:For Template:Infobox 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 Template:Tmath.

Its probability density function is given by

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

for Template:Tmath, where μ>0 is the mean and λ>0 is a shape parameter.Template:R Either Template:Tmath or Template:Tmath (or more generally any combination of the form μpλ1−p for any real Template:Tmath) can serve as a scale parameter, so a proper (i.e., unscaled) shape parameter would be any non-zero power of Template:Tmath: Tweedie proposed to use the Template:Tmath and Template:Tmath parametrizations in addition to the standard Template:Tmath parametrization (“Each of these forms is convenient or suggestive for some purpose.”Template:R), and later on uses exclusively the Template:Tmath parametrization.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. The relationship between the Gaussian and inverse Gaussian distributions is thus the same as the relationship between the binomial (number of successes for a fixed number of Bernoulli trials) and negative binomial (number of Bernoulli trials for a fixed number of successes) distributions.Template:R

The y-axis reflections of the cumulant generating functions of the Gaussian and inverse Gaussian distributions are inverse of each other (i.e., the graphs of the two cumulant generating functions are reflections of each other across the line Template:Tmath), a property that is also shared between the binomial and negative binomial distributions (after dividing their cumulant generating functions by their respective fixed parameter).Template:R

To indicate that a random variable Template:Tmath is inverse Gaussian-distributed with mean Template:Tmath and shape parameter Template:Tmath we write Template:Tmath.

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, Template:Tmath.

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 Template:Tmath, Template:Tmath, and the Φ is the cdf of standard normal distribution. The variables z1 and z2 are related to each other by the identity Template:Tmath.

In the single parameter form, the MGF simplifies to

M(t)=exp⁡[μ(1−1−2t)].

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 Template:Tmath, where Template:Tmath.

The above paragraph can be re-written as: if Template:Tmath, then Template:TmathTemplate:R. This approach is better in the sense that it clearly shows dimensionless nature of the single parameter form (note that Template:Tmath). This property follows from a more general fact: if a>0 and Template:Tmath, then Template:TmathTemplate:R.

The standard form of inverse Gaussian distribution is

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

Summation

If Template:Tmath has an IG⁡(μ0wi,λ0wi2) distribution for Template:Tmath and all Template:Tmath are independent, then

S=∑i=1nXi∼IG⁡(μ0∑wi,λ0(∑wi)2).

The special case wi=1/n shows that the inverse Gaussian distribution is infinitely divisible.

Note that

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

is constant for all Template:Tmath. This is a necessary condition for the summation. Otherwise Template:Tmath would not be Inverse Gaussian distributed.

Scaling

For any Template:Tmath it holds that

X∼IG⁡(μ,λ)⇒tX∼IG⁡(tμ,tλ).

Exponential family

The inverse Gaussian distribution is a two-parameter exponential family with natural parameters Template:Tmath and Template:Tmath, and natural statistics Template:Tmath and Template:Tmath.

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 Template:Tmath,

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+θx−−2λθ)𝟙[0,∞)(x).

Substituting θ=−λ/(2μ2) makes the above expression equal to Template:Tmath.

Relationship with Brownian motion

Example of stopped random walks with Template:Tmath. 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 Template:Tmath be given by

X0=0
Xt=νt+σWt

where Template:Tmath is a standard Brownian motion. That is, Template:Tmath is a Brownian motion with drift Template:Tmath.

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

Tα=inf⁡{t>0∣Xt=α}∼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:

∂p∂t+ν∂p∂x=12σ2∂2p∂x2,{p(0,x)=δ(x−x0)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⁡[−(x−x0−νt)22σ2t]

Define a point Template:Tmath, such that Template:Tmath. 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)=δ(x−x0)−Aδ(x−m)

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⁡[−(x−x0−νt)22σ2t]−Aexp⁡[−(x−m−νt)22σ2t]}

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

(α−x0−νt)2=−2σ2tlog⁡A+(α−m−νt)2

At Template:Tmath, we have that Template:Tmath. 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⁡[−(x−x0−νt)22σ2t]−e2ν(α−x0)/σ2exp⁡[−(x+x0−2α−νt)22σ2t]}

Now that we have the full probability density function, we are ready to find the first passage time distribution Template:Tmath. The simplest route is to first compute the survival function Template:Tmath, 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 Template:Tmath. 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σ2t∼IG[αν,(ασ)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 Template:Tmath tends to infinity, and the first passage time for fixed level Template:Tmath 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 Template:Tmath.

Maximum likelihood

The model where

Xi∼IG⁡(μ,λwi),i=1,2,…,n

with all Template:Tmath known, Template:Tmath unknown and all Template:Tmath independent has the following likelihood function:

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

Solving the likelihood equation yields the following maximum likelihood estimates

μ^=∑i=1nwiXi∑i=1nwi,1λ^=1n∑i=1nwi(1Xi−1μ^).

μ^ and λ^ are independent and

μ^∼IG⁡(μ,λ∑i=1nwi),nλ^∼1λχn−12.

Sampling from an inverse-Gaussian distribution

The following algorithm may be used.Template:R

Generate a random variate from a normal distribution with mean Template:Tmath and standard deviation equal Template:Tmath

ν∼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 Template:Tmath and Template:Tmath

z∼U(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()

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:Probability distributions Template:Authority control