Vous êtes sur la page 1sur 15

Inverse Gaussian Distribution

Paul E. Johnson <pauljohn@ku.edu>


June 10, 2013
The Inverse Gaussian distribution is an exponential distribution. It is one of the distri-
butions implemented in Rs Generalized Linear Model routines. To my surprise, there are
whole books dedicated to this distribution (V. Seshadri, The Inverse Gaussian Distribution:
A Case Study in Exponential Families, Oxford University Press, 1994; R. S. Chhikara and J.
L. Folks, The Inverse Gaussian Distribution: Theory, Methodology, and Applications, New
York: Dekker, 1989).
Articles on insurance problems and the stock market often claim that observations follow
an Inverse Gaussian distribution. It has one mode in the interior of the range of possible
values and it is skewed to the right, sometimes with an extremely long tail. The fact that ex-
tremely large outcomes can occur even when almost all outcomes are small is a distinguishing
characteristic.
1 Mathematical Description
There are Inverse Gaussian distributions in several R packages. Run
he l p. s e ar c h ( " i nve r s e gaus s i an " )
to see for yourself.
In VGAM, the documentation for inv.gaussian matches the information in in the pack-
age statmods documentation on dinvgauss. So lets follow that approach. The distribution
of x
i
is described by two characteristics, a mean > 0 and precision > 0 . The probability
density function is
p(x; , ) =


2x
3
e
(x)
2
2
2
x
, 0 < x <
If you would like to take out of the square root, you can put this down as
p(x; , ) =

2

2x
3
e
(

(x))
2
2
2
x
, 0 < x <
1
The expected value is and the variance of this version of the inverse Gaussian distribution
is
V ar(x) =

3

The skewness and kurtosis are, respectively,


3

and
15

In all honesty, I have no intuition whatsoever about what the appearance of this prob-
ability model might be. It does not have a kernel smaller than the density itself, so we
cant just throw away part on the grounds that it is a normalizing constant or a factor of
proportionality.
And to make matters worse, the variance depends on the mean.
Tidbit: If = 1 this is called the Wald distribution.
2 Illustrations
The probability density function of a Inverse Gaussian distribution with = 1 and = 2 is
shown in Figure 1. The R code which produces that gure is:
library(statmod)
mu <- 1
lambda <- 2
xrange <- seq(from=0.0,to=2*mu+5/lambda ,by=0.02)
mainlabel <- expression(paste("IG(",mu,",",lambda ,")",
sep=""))
xprob <- dinvgauss(xrange , mu = mu , lambda = lambda)
plot(xrange , xprob , type = "l", main = mainlabel , xlab
= "possible values of x", ylab = "probability of x
")
How would one describe Figure 1?
1. Single-peaked
2. Not symmetric tail to the right
How does this distribution change in appearance if and are changed?
Lets do some experimentation. The following R code creates an array of gures with 4
rows and 3 columns with various values of and that is displayed in Figure 2.
par ( mfrow=c ( 4 , 3) )
f o r ( i i n 1: 4) {
f o r ( j i n 1: 3) {
mu < 3 i
lambda < 20 j
2
Figure 1: Inverse Gaussian Distribution
0 1 2 3 4
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
IG(,)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
3
xrange < seq ( from = 0 . 0 , to = 3mu, by = 0 . 02 )
mai nl abel< pas t e ( " IG( " ,mu, " , " , lambda , " ) " , sep = " " )
xprob < di nvgauss ( xrange , mu = mu, lambda = lambda )
pl ot ( xrange , xprob , type = " l " , main = mai nl abel , xl ab =
" po s s i bl e val ues of x" , yl ab = " pr obabi l i t y of x" )
}
}
I had a very hard time believing that these calculations were correct. The graph shows
almost no impact of changing parameters.
The mistake I had made was assuming that the Inverse Gammas tail will be cut o in
a way that makes a nice picture. It turns out that, when the is small, then there can
be extremely huge values observed. I found that by plotting histograms of random samples
from various parameter settings.
For example, if we draw 1000 observations from Inverse Gamma with = 12 and = 2,
look what happens in Figure 3:
Can you describe this variety in a nutshell?
Sometimes the IG has a very long tail, stretching far to the right, and it makes the
expected value a very poor description of the modal observation.
Probably the best illustration I have found for this model is presented in Figure 5.
In the Webpages for the old classic program Dataplot (http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/igpdf.htm)
I found this interesting comment. That page uses the parameter gamma in place of lambda,
otherwise the formula is the same. It says, The inverse Gaussian distribution is symmetric
and moderate tailed for small gamma. It is highly skewed and long tailed for large gamma.
It approaches normality as gamma approaches zero. I cant nd any evidence in favor of this
characterization in Figure 6. The opposite is more likely true, making me suspect that in the
Dataplot authors mind, the parameter gamma () might have at one time been 1/. This
leads me to caution studentst that if you want to be condent about one of these results, it
is not sucient to just take the word of a randomly chosen Web site.
To see the eect of tuning up and down, consider gure 6. This shows pretty clearly that
if you think of as a precision parameter and you have high precision, then the observations
are likely to be tightly clustered and symmetric about the mean. When you lose precision,
as gets smaller, then the strong long tail to the right emerges.
3 Why do people want to use this distribution?
We want a distribution that can reach up high and admit some extreme values.
It is pretty easy to estimate and by maximum likelihood.
An alternative distribution with this general shape is the three parameter Weibull dis-
tribution, which is more dicult to estimate (W.E. Bardsley, Note on the Use of the In-
verse Gaussian Distribution for Wind Energy Applications, Journal of Applied Meteorology,
19(9): 1126-1130).
4
Figure 2: Variety of Inverse Gaussian
0 2 4 6 8
0
.
0
0
.
1
0
.
2
0
.
3
0
.
4
IG(3,20)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 2 4 6 8
0
.
0
0
.
2
0
.
4
IG(3,40)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 2 4 6 8
0
.
0
0
.
2
0
.
4
0
.
6
IG(3,60)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15
0
.
0
0
0
.
0
5
0
.
1
0
0
.
1
5
IG(6,20)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15
0
.
0
0
0
.
1
0
0
.
2
0
IG(6,40)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15
0
.
0
0
0
.
1
0
0
.
2
0
IG(6,60)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15 20 25
0
.
0
0
0
.
0
4
0
.
0
8
IG(9,20)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15 20 25
0
.
0
0
0
.
0
4
0
.
0
8
0
.
1
2
IG(9,40)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 15 20 25
0
.
0
0
0
.
0
4
0
.
0
8
0
.
1
2
IG(9,60)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 20 30
0
.
0
0
0
.
0
4
0
.
0
8
IG(12,20)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 20 30
0
.
0
0
0
.
0
4
0
.
0
8
IG(12,40)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0 5 10 20 30
0
.
0
0
0
.
0
4
0
.
0
8
IG(12,60)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
5
Figure 3: Sample from Inverse Gaussian with = 12 and = 2
0 50 100 150 200 250 300 350
0
.
0
0
0
.
0
5
0
.
1
0
0
.
1
5
Density plot, N=1000,mu= 12 lambda=2
N = 1000 Bandwidth = 1.15
D
e
n
s
i
t
y
maximum observed x = 340.29
6
Figure 4: Random Sample From Various Inverse Gaussians
mu= 12 lambda=2
xlo
F
r
e
q
u
e
n
c
y
0 50 100 150 200 250 300 350
0
1
0
0
2
0
0
3
0
0
4
0
0
5
0
0
6
0
0
mu= 12 lambda=5
xmed
F
r
e
q
u
e
n
c
y
0 50 100 150 200 250 300 350
0
5
0
1
0
0
1
5
0
2
0
0
mu= 12 lambda=20
xhi
F
r
e
q
u
e
n
c
y
0 50 100 150 200 250 300 350
0
2
0
4
0
6
0
7
Figure 5: More Inverse Gaussian Distributions
0 1 2 3 4
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
IG(2, various lambda)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
lambda= 1
lambda= 10
lambda= 50
lambda= 100
0 5 10 15 20
0
.
0
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
IG(10, various lambda)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
lambda= 1
lambda= 10
lambda= 50
lambda= 100
8
Figure 6: Shrinking lambda
0.0 0.5 1.0 1.5 2.0
0
.
0
1
.
0
2
.
0
IG(1,50)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0.0 0.5 1.0 1.5 2.0
0
.
0
0
.
6
1
.
2
IG(1,10)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0.0 0.5 1.0 1.5 2.0
0
.
0
0
.
4
0
.
8
IG(1,5)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0.0 0.5 1.0 1.5 2.0
0
.
0
0
.
4
0
.
8
IG(1,1)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0.0 0.2 0.4 0.6 0.8 1.0
0
.
0
0
.
5
1
.
0
1
.
5
IG(1,0.5)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
0.0 0.2 0.4 0.6 0.8 1.0
0
1
2
3
4
IG(1,0.001)
possible values of x
p
r
o
b
a
b
i
l
i
t
y

o
f

x
9
4 Would you rather have Gamma or Inverse-Gaussian?
The Gamma and the Inverse-Gaussian share the property that they are possibly skewed
to the right. If you choose the correct parameter values, you can make them practically
indistinguisable.
However, there is a VERY WEIRD scaling property here. In order for the Inverse Gaus-
sian to produce some extreme large values, it must have higher probability for large values.
How can you make sense out of this strange result in Figure
10
Figure 7: Gamma or Inverse Gaussian?
xval s < seq ( 0 , 20 , l e ngt h. out =200)
gam < dgamma( xval s , shape =2, s c a l e =1)
i gaus < di nvgauss ( xval s , mu=2, lambda=5)
pl ot ( xval s , gam, type=" l " , l t y =1, main=" " )
l i n e s ( xval s , i gaus , l t y =2)
l egend ( 6 , . 2 , c ( "gamma( sh=2, s c =1) " , " i nv gauss (mu=2, lambda=5) " ) , l t y
=1: 2 , )
0 5 10 15 20
0
.
0
0
.
1
0
.
2
0
.
3
xvals
g
a
m
gamma(sh=2,sc=1)
inv gauss(mu=2,lambda=5)
11
Figure 8: Compare Gamma and Inverse Gaussian
par ( mf col=c ( 3 , 1) )
f o r ( i i n 1: 3) {
minx < 20 + 50 ( i1 )
xval s < seq ( minx , 300 , l e ngt h. out =1000)
gam < dgamma( xval s , shape = 2 , s c a l e = 1)
i gaus < di nvgauss ( xval s , mu = 2 , lambda = 5)
pl ot ( xval s , gam, type=" l " , l t y = 1 , main=" " )
l i n e s ( xval s , i gaus , l t y = 2)
l egend ( 150 , 0 . 7 max(gam) , c ( "gamma( sh=2, s c =1) " , " i nv gauss (
mu=2, lambda=5) " ) , l t y = 1: 2 , )
}
50 100 150 200 250 300
0
e
+
0
0
3
e

0
8
xvals
g
a
m
gamma(sh=2,sc=1)
inv gauss(mu=2,lambda=5)
100 150 200 250 300
0
.
0
e
+
0
0
2
.
0
e

2
9
xvals
g
a
m
gamma(sh=2,sc=1)
inv gauss(mu=2,lambda=5)
150 200 250 300
0
e
+
0
0
6
e

5
1
xvals
g
a
m
gamma(sh=2,sc=1)
inv gauss(mu=2,lambda=5)
12
Figure 9: Compare Samples: Gamma and Inverse Gaussian
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
0 . 0502 0 . 9770 1 . 7240 2 . 0160 2 . 7520 11 . 5400
[ 1 ] 2 . 067561
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
0 . 2959 1 . 1160 1 . 7240 2 . 0410 2 . 5270 10 . 5000
[ 1 ] 1 . 831236
Gamma,sh=2,sc=1
gam
F
r
e
q
u
e
n
c
y
0 2 4 6 8 10 12
0
5
0
1
5
0
Inv Gaus, mu=2,lambda=4
igaus
F
r
e
q
u
e
n
c
y
0 2 4 6 8 10
0
5
0
1
5
0
13
Figure 10: Compare Samples: Gamma and Inverse Gaussian
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
0 . 1192 1 . 9150 3 . 3560 4 . 0570 5 . 3900 22 . 7900
[ 1 ] 8 . 55414
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
0 . 648 2 . 062 3 . 125 3 . 825 4 . 802 18 . 150
[ 1 ] 6 . 715464
Gamma, sh=2, sc=2
gam
F
r
e
q
u
e
n
c
y
0 5 10 15 20
0
1
0
0
2
5
0
Inv Gauss, mu=4, lambda=8
igaus
F
r
e
q
u
e
n
c
y
0 5 10 15 20
0
2
0
0
4
0
0
14
Figure 11: Compare Samples: Gamma and Inverse Gaussian
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
0 . 709 6 . 868 10 . 600 11 . 860 15 . 730 42 . 260
[ 1 ] 43 . 43887
Min. 1 s t Qu. Median Mean 3rd Qu. Max.
2 . 472 7 . 040 10 . 130 12 . 220 15 . 140 62 . 900
[ 1 ] 60 . 23548
Gamma, sh=3,sc=4
gam
F
r
e
q
u
e
n
c
y
0 10 20 30 40
0
1
0
3
0
Inv Gauss, mu=12,lambda=34
igaus
F
r
e
q
u
e
n
c
y
0 10 20 30 40 50 60
0
2
0
4
0
15

Vous aimerez peut-être aussi