You are on page 1of 18

Chapter 5

Gamma Model

5.1 Problem

In the previous chapters, we introduced the multiple change-point problem


for both univariate and multivariate Gaussian models. Now, let us turn our
attention away from Gaussian models, and study another important model,
the gamma distribution.
Suppose that x1 , x2 , . . . , xn is a sequence of independent random variables
from gamma distributions with parameters (θ1 , ξ), (θ2 , ξ), . . . , and (θn , ξ),
respectively, where ξ is known, and the pdf of Xi s is

1
f (x, ξ, θi ) = xξ−1 e−(x/θi ) , ξ, θi > 0, x > 0, i = 1, . . . , n.
θiξ Γ (ξ)

We are interested in testing

H0 : θ1 = θ2 = · · · = θn = θ0 (5.1)

against the alternative:

H1 : θ1 = · · · = θk = θ0 = θk+1 = · · · = θn = θ0 + δ > 0, (5.2)

where k is the unknown position of a change point, θ0 unknown, and |δ| > 0.
The above formulation of the change point problem was posted by Kander
and Zacks (1966) when they studied the model from an exponential family.
Later, Hsu (1979) adopted their assumption and their general result, and
studied the change point problem under the same formulation for the gamma
model. In this chapter, we base our discussion on the above-mentioned
authors’ work, and present the following sections of interest.

J. Chen and A.K. Gupta, Parametric Statistical Change Point Analysis: With Applications 155
to Genetics, Medicine, and Finance, DOI 10.1007/978-0-8176-4801-5_5,
© Springer Science+Business Media, LLC 2012
156 5 Gamma Model

5.2 A Solution

Assume that the location of the change point k has an equal chance to fall
at any of the possible points j = 1, 2, . . . , n − 1. That is, a prior is put on the
location of the change point:
 1
n−1 , j = 1, 2, . . . , n − 1
πn (j) = (5.3)
0, otherwise

Under (5.2), the likelihood function is

L1 (θ0 , δ)
= f (x1 , . . . , xn ; θ0 , δ)

n−1
= πn (j)f (x1 , . . . , xn ; θ0 , δ|j)
j=1
 ! !
1 
n−1 j 1 n 1
= Π xξ−1 e−(xi /θi ) Π xξ−1 e−(xi /θi )
n − 1 j=1 i=1 θiξ Γ (ξ)
i i=j+1 θiξ Γ (ξ)
i

 !
1 
n−1 j 1
= Π xξ−1 e−(xi /θi )
n − 1 j=1 i=1 θiξ Γ (ξ)
i

 
n 1
· Π xξ−1 e−(xi /(θ0 +δ))
i=j+1 (θ0 + δ)ξ Γ (ξ) i
n  j  
Π xξ−1
1 i=1 i 
n−1  xi ξ
= exp − − ln θ0
n − 1 Γ n (ξ) j=1 i=1
θ0
⎡ ⎤
n  
x
· exp ⎣ − ln(θ0 + δ)ξ ⎦ .
i

i=j+1
θ 0 + δ

The Taylor expansion of −(xi /(θ0 + δ)) − ln(θ0 + δ)ξ for (δ/θ0 ) → 0 is
   
xi xi ξ xi ξ δ
− − ln(θ0 + δ) = − − ln θ0 + δ
ξ
− +o .
θ0 + δ θ0 θ02 θ0 θ0
5.2 A Solution 157

Then,
n   j  
Π xξ−1
1 i=1 i 
n−1  xi ξ
L1 (θ0 , δ) = exp − − ln θ0
n − 1 Γ (ξ) j=1
n
i=1
θ0
⎡ ⎤⎫
n   ⎬
xi xi δ ξδ
· exp ⎣ − − ln θ0ξ + 2 − + o(δ) ⎦
θ 0 θ0 θ0 ⎭
i=j+1

Under (5.1), the likelihood function is


n  n  
Π xξ−1
i  xi
i=1 ξ
L0 (θ0 ) = exp − − ln θ0
Γ n (ξ) i=1
θ0

Then, the ratio of L1 to L0 is


⎡ ⎤
L1 (θ0 , δ) 1 
n−1 n
δxi ξδ
Λ= = exp ⎣ 2 − θ + o(δ)

L0 (θ0 ) n−1 j=1 i=j+1
θ 0 0

⎧ ⎫

n−1 ⎨ n   ⎬
1 δxi ξδ
= 1+ − + (n − j)o(δ)
j=1
n−1⎩ i=j+1
θ02 θ0 ⎭
⎧ ⎫
 
 1 ⎨  ⎬
n−1 n
δxi ξδ
= 1+ − + o(δ)
j=1
n−1⎩ i=j+1
θ02 θ0 ⎭

 
1   δxi
n−1 n
ξδ
=1+ − + o(δ)
n − 1 j=1 i=j+1 θ02 θ0
⎡ ⎤
δ ⎣ 1  
n−1 n
nξ ⎦
=1+ xi − + o(δ).
θ0 (n − 1)θ0 j=1 i=j+1 2

 n
Clearly, Λ is a monotone function of (1/θ0 ) n−1j=1 i=j+1 xi . Then we can
choose the likelihood-ratio based test statistic as

1   1 
n−1 n n
λ= xi = (i − 1)xi
θ0 j=1 i=j+1 θ0 i=2
158 5 Gamma Model

1 
n−1
= ixi+1
θ0 i=1

1 
n
= (i − 1)xi .
θ0 i=1

When θ0 is unknown, it is estimated under (5.1) by its MLE



n
xi
x
θ0 = = i=1
.
ξ nξ
Then, the test statistic becomes

nξ 
n
λ= 
n (i − 1)xi .
xi i=1
i=1

For simplicity, let nξ = 1/(n − 1); hence the test statistic finally becomes:

n
(i − 1)xi
i=1
T = 
n .
(n − 1) xi
i=1

Next, we intend to derive the approximate null distribution of T. Under


H0 , the joint pdf of x1 , . . . , xn is
 ξ−1
1 n
f (x1 , . . . , xn ) = Π xi e−(Σxi /θ0 ) , xi > 0, ξ > 0, θ0 > 0.
θ0nξ Γ n (ξ) i=1

Let us carry out the following transformation,


x2
y2 = 
n ,
xi
i=1
x3
y3 = 
n ,
xi
i=1
..
.
xn
yn = 
n ,
xi
i=1
5.2 A Solution 159


n
z= xi .
i=1

Then the inverse transformation is


⎛ ⎞

n
x1 = z ⎝1− yj ⎠ ,
j=1

x2 = zy2 ,
x3 = zy3 ,
..
.
xn = zyn .

The Jacobian of this transformation is


 
 
n 
−z −z ... −z 1− yi 
 
 j=2 
z 0 ... 0 y2 
 
J =  = (−1)n−1 z n−1 .
0 z ... 0 y3 
 
. . . ... ... ... ... 
 
0 0 ... z yn 

So, the joint pdf of y2 , . . . , yn , z is

g(y2 , . . . , yn , z)
⎛ ⎛ ⎞ ⎞

n
= |J|f ⎝z ⎝1− yi ⎠ , zy2 , . . . , zyn ⎠
j=2
⎡ ⎛ ⎞ξ−1 ⎤
 ξ−1 
n
1 ⎢ nξ−1 n
⎝1− ⎥
= z n−1 ⎣z Π yj yi ⎠ ⎦ e−(z/θ0 )
θ0nξ Γ (ξ) j=2
j=2

⎛ ⎞ξ−1
 ξ−1 
n
1 n
⎝1−
= z nξ−1 Π yj yi ⎠ e−(z/θ0 ) .
θ0nξ Γ n (ξ) j=2
j=2

Then, the joint distribution of y2 , . . . , yn is


 ∞
g(y2 , . . . , yn ) = g(y2 , . . . , yn , z)dz
0
160 5 Gamma Model
!ξ−1
n 
n
Γ (nξ) Π yjξ−1 1− yi 
j=2 z
j=2 1
= z nξ−1 e−(x/θ0 ) · dz
Γ n (ξ) 0 θ0nξ Γ (nξ)
⎛ ⎞ξ−1
Γ (nξ) n ξ−1 ⎝ n
= n Π y 1− yi ⎠ .
Γ (ξ) j=2 j j=2

Obviously, the joint distribution of y2 , . . . , yn is Dirichlet D(ξ, . . . , ξ; ξ).


Therefore, under H0 , 
the test statistic T is a linear combination of Dirichlet
variates, in fact, T = ni=2 ((i − 1)/(n − 1))yi . From Johnson and Kotz (1972,
p. 233), the mixed moment of (y2 , . . . , yn ) is given by

Γ (nξ) Γ (ξ + r2 ) · · · Γ (ξ + rn )
E[y2r2 y3r3 , . . . , ynrn ] = · ,
Γ n−1 (ξ) Γ (nξ + r2 + · · · + rn )

where r2 , r3 , . . . , rn ≥ 0. We can therefore obtain the following moments of


T under H0 .
n
i−1
μ1 (T ) = E(T ) = E(yi )
i=2
n−1

n
i − 1 Γ (nξ) Γ n−2 (ξ)Γ (ξ + 1)
= ·
i=2
n − 1 Γ n−1 (ξ) Γ (nξ + 1)

n
i−1 1 1
= · = .
i=2
n − 1 n 2

μ2 (T ) = Var (T ) = E(T − ET )2
 n 2
 i−1 1
=E yi −
i=2
n−1 2
⎡ !2 ⎤
 n
i − 1 n
i−1 1⎦
=E ⎣ yi − yi +
i=2
n − 1 i=2
n −1 4
!2
n
i−1 1
=E yi −
i=2
n −1 4
n 
 2  (i − 1)(j − 1)
i−1 1
= Eyi2 + E(yi yj ) −
n−1 (n − 1)2 4
i=2 i=j
5.2 A Solution 161

n  2
i−1 Γ (nξ)Γ n−2 (ξ)Γ (ξ + 2)
= ·
i=2
n−1 Γ n−1 (ξ)Γ (nξ + 2)
 (i − 1)(j − 1) Γ (nξ)Γ n−2 (ξ)Γ (ξ + 1) 1
+ −
(n − 1)2 Γ n−1 (ξ)Γ (nξ + 2) 4
i=j
n 
 2  (i − 1)(j − 1)
i−1 ξ+1 ξ 1
= + + 2

n−1 n(nξ + 1) (n − 1) n(nξ + 1) 4
i=2 i=j
 n 
ξ  i − 1 2 1 n 
i−1
2
1
= + −
n(nξ + 1) i=2
n−1 n(nξ + 1) i=2 n − 1 4

nξ 2n − 1 1
= + −
4(nξ + 1) 6(n − 1)(nξ + 1) 4
(n + 1)
= .
12(n − 1)(nξ + 1)

Hence, we have

3nξ(n − 1) + 2(2n − 1)
E(T 2 ) = .
12(n − 1)(nξ + 1)
μ3 (T ) = E(T − ET )3
 3
1
=E T −
2
3 3 1
= E(T 3 ) − E(T 2 ) + E(T ) −
2 4 8
 n 3
 i−1 3 3nξ(n − 1) + 2(2n − 1) 1
=E yi − +
i=2
n−1 2 12(n − 1)(nξ + 1) 4
n 
 3  (i − 1)2 (k − 1)
i−1
= E(yi3 ) + 3 E(yi2 yk )
n−1 (n − 1)3
i=2 i=k

 (i − 1)(j − 1)(k − 1)
+ E(yi yj yk )
(n − 1)3
i=j=k

3nξ(n − 1) + 2(2n − 1) 1
− +
8(n − 1)(nξ + 1) 4
 i−1
n  3
Γ (nξ)Γ n−2 (ξ)Γ (ξ + 3)
=
i=2
n−1 Γ n−1 (ξ)Γ (nξ + 3)
162 5 Gamma Model

 (i − 1)2 (k − 1) Γ (nξ)Γ n−3 (ξ)Γ (ξ + 2)Γ (ξ + 1)


+3
(n − 1)2 Γ n−1 (ξ)Γ (nξ + 3)
i=k

 (i − 1)(j − 1)(k − 1) Γ (nξ)Γ n−4 (ξ)Γ 3 (ξ + 1)


+
(n − 1)3 Γ n−1 (ξ)Γ (nξ + 3)
i=j=k

3nξ(n − 1) + 2(2n − 1) 1
− +
8(n − 1)(nξ + 1) 4
 
 i − 1 3 (ξ + 1)(ξ + 2)
n
=
i=2
n−1 n(nξ + 1)(nξ + 2)
 (i − 1)2 (k − 1) ξ(ξ + 1)
+3
(n − 1)3 n(nξ + 1)(nξ + 2)
i=k

 (i − 1)(j − 1)(k − 1) ξ2
+
n(nξ + 1)(nξ + 2) n(nξ + 1)(nξ + 2)
i=j=k

3nξ(n − 1) + 2(2n − 1) 1
− + .
8(n − 1)(nξ + 1) 4

Continuing with more calculations, we have:


 n 3
ξ2  i−1
μ3 (T ) =
n(nξ + 1)(nξ + 2) i=2 n − 1
 n  n 
3ξ  (i − 1)2  k−1
+
n(nξ + 1)(nξ + 2) i=2 (n − 1)2 n−1
k=2

2 
n
(i − 1)3
+
n(nξ + 1)(nξ + 2) i=2
(n − 1)3

3nξ(n − 1) + 2(2n − 1) 1
− +
8(n − 1)(nξ + 1) 4
ξ 2  
n 3 3ξ
= +
n(nξ + 1)(nξ + 2) 2 n(nξ + 1)(nξ + 2)
1 1 n(n − 1)
· · (n − 1)n(2n − 1) ·
(n − 1)3 6 2
 2
2 1 1
+ · (n − 1)n
n(nξ + 1)(nξ + 2) (n − 1)3 2
3nξ(n − 1) + 2(2n − 1) 1
− +
8(n − 1)(nξ + 1) 4
=0
5.2 A Solution 163

Then, the skewness γ1 (T ) = (μ3 (T ))/( μ2 (T )) = 0.
 4
1
μ4 (T ) = E(T − ET )4 = E T −
2
 3
1 3 3
= E(T 4 ) − 2E T − − E(T 2 ) + E(T ) −
2 2 16
 n 4
 i−1 3nξ(n − 1) + 2(2n − 1) 5
=E yi − +
i=2
n−1 8(n − 1)(nξ + 1) 16
n 
 4  (i − 1)2 (j − 1)2
i−1
= E(yi4 ) + 3 E(yi2 yi2 )
n−1 (n − 1)4
i=2 i=j

 (i − 1)2 (j − 1)
+4 E(yi3 yi )
(n − 1)4
i=j

 (i − 1)2 (j − 1)(k − 1)
+6 E(yi2 yj yk )
(n − 1)4
i=j=k

 (i − 1)(j − 1)(k − 1)(l − 1)


+ E(yi yj yk yl )
(n − 1)4
i=j=k=l

3nξ(n − 1) + 2(2n − 1) 5
− +
8(n − 1)(nξ + 1) 16
n  4
i−1 Γ (nξ)Γ n−2 (ξ)Γ (ξ + 4)
=
i=2
n−1 Γ n−1 (ξ)Γ (nξ + 4)
 (i − 1)3 (j − 1) Γ (nξ)Γ n−3 (ξ)Γ (ξ + 3)Γ (ξ + 1)
+4
(n − 1)4 Γ n−1 (ξ)Γ (nξ + 4)
i=j

 (i − 1)2 (j − 1)2 Γ (nξ)Γ n−3 (ξ)Γ 2 (ξ + 2)


+3
(n − 1)4 Γ n−1 (ξ)Γ (nξ + 4)
i=j

 (i − 1)2 (j − 1)(k − 1) Γ (nξ)Γ n−4 (ξ)Γ (ξ + 2)Γ 2 (ξ + 1)


+6
(n − 1)4 Γ n−1 (ξ)Γ (nξ + 4)
i=j=k

 (i − 1)(j − 1)(k − 1)(l − 1) Γ (nξ)Γ n−5 (ξ)Γ 4 (ξ + 1)


+
(n − 1)4 Γ n−1 (ξ)Γ (nξ + 4)
i=j=k=l

3nξ(n − 1) + 2(2n − 1) 5
− + .
8(n − 1)(nξ + 1) 16
164 5 Gamma Model

More simplification leads to



1 n
μ4 (T ) = (ξ+1)(ξ+2)(ξ+3) (i − 1)4
n(n − 1)4 (nξ + 1)(nξ + 2)(nξ + 3) i=2
 
+ 4ξ(ξ+1)(ξ + 2) (i − 1)3 (j − 1) + 3ξ(ξ + 1)2 (i − 1)2 (i − 1)2
i=j i=j

× 6ξ 2 (ξ + 1) (i − 1)2 (j − 1)(k − 1)
i=j=k


+ξ 3 (i − 1)(j − 1)(k − 1)(l − 1)⎦
i=j=k=l

3nξ(n − 1) + 2(2n − 1) 5
− +
8(n − 1)(nξ + 1) 16
3(n + 1)[5ξ(n − 1)n(n + 1) + 6(3n2 − 4)]
= .
720(n − 1)3 (nξ + 1)(nξ + 2)(nξ + 3)

Hence, the kurtosis

μ4 (T ) 3(nξ + 1)[5ξ(n − 1)n(n + 1) + 6(3n2 − 4)]


γ2 (T ) = 2
−3= − 3.
[μ2 (T )] 5(n − 1)(n + 1)(nξ + 2)(nξ + 3)

Note that the skewness of the distribution of T, γ1 (T ) = 0, and kurtosis


γ2 (T ) −→ 0, as n −→ ∞.Then, under H0 , for sufficiently large n, the
distribution of (T − (1/2))/ Var(T ) can be approximated by the standard
normal distribution.
The test is based on the likelihood ratio, therefore the inherent properties
of the test are still valid. For example, it is locally the most powerful test at
level α. A practical example of change point analysis for the gamma model
is given in Hsu (1979).

5.3 Informational Approach

For the gamma model, we are interested in testing

H0 : θ 1 = θ 2 = · · · = θ n = θ 0

against the alternative:

H1 : θ1 = · · · = θk = θk+1 = · · · = θn ,
5.3 Informational Approach 165

where k is the unknown position of a change point; θ0 , θ1 , and θn are


unknown. For testing H0 against H1 , it is equivalent to selecting the best
model among n proposed models, as H0 corresponds to a model of no change
point and H1 corresponds to n – 1 models each revealing a change point at
the location k, for k = 1, . . . , n − 1.
We derive the informational approach-SIC as follows.
Under H0 , the likelihood function L0 (θ0 ) is

8
n
1
L0 (θ0 ) = ξ
xξ−1
i e−(xi /θ0 )
i=1 θ0 Γ (ξ)
9n  n  
ξ−1 
i=1 xi xi ξ
= exp − − ln θ0 ,
Γ n (ξ) i=1
θ0

and the MLE of θ0 is n


xi
θ0 = i=1
.

Therefore, denoting the SIC under H0 by SIC(n), we have

SIC(n) = −2 log L0 (θ0 ) + log n



n
ne2nξ ξ 2n (ξ)
= 2nξ log Σxi − 2(ξ − 1) log xi − log .
i=1
(nξ)2nξ

Under H1 the MLEs of θ1 and θn are obtained as


k n
x xi
θ1 = θn = i=k+1 .
i=1 i
,
kξ (n − k)ξ

Therefore, letting SIC under H1 be denoted by SIC(k), for 1 ≤ k ≤ n − 1, we


obtain:

SIC(k) = −2 log L1 (θ1 , θn ) + 2 log n



k 
n 
n
= 2kξ log xi + 2(n − k)ξ log xi − 2(ξ − 1) log xi
i=1 i=k+1 i=1

n2 e2nξ ξ 2n (ξ)
+ log .
(nξ)2kξ [(n − k)ξ]2(n−k)ξ

According to the minimum information criterion principle, H0 is not


rejected if SIC(n) ≤ min1≤k≤n−1 SIC(k), and hence it is concluded that
there is no change in the scale parameter of the gamma model. H0 is rejected
if SIC(n) > min1≤k≤n−1 SIC(k), and therefore it is concluded that there is a
166 5 Gamma Model

change in the scale parameter of the gamma model. The location of the
change point is estimated at 
k, where 
k is such that

SIC(
k) = min SIC(k).
1≤k≤n−1

5.4 Bayesian Approach

A similar change point problem with regard to the gamma distribution


defined in Section 5.1 was later studied by Diaz (1982). The approach is
completely Bayesian, which gives us an alternate way of finding the change
point in this situation. The work of Diaz (1982) is presented in detail as
follows.
Let x1 , . . . , xn be a sequence of independent random variables from gamma
distributions. Specifically, let Xi have the pdf f (x; θ2 ) for j = k + 1, . . . , n,
where
xξ−1 e−(x/θ)
f (x; θ) = , ξ > 0, θ > 0, x > 0.
θξ Γ (ξ)
ξ is known, θ unknown, and k is the unknown position of the change point.
Our interest here is to test the following hypotheses,

H0 : k = n versus H1 : 1 ≤ k ≤ n − 1.

The following prior distributions are assumed for k, θ1 , and θ2 .


Let k have prior pdf g0 (k) given by

p if k = n
g0 (k) = 1−p ,
n−1 if k = n

where p is known such that 0 ≤ p ≤ 1. When k = n, θ1 = θ2 , and the prior


density of θ1 is
e1/θ1 α1
g1 (θ1 ) = r1 , θ1 > 0
α1 Γ (r1 )θ1r1 +1
and if k = n, θ1 and θ2 are assumed independent, the prior density of θ2 is
given by
e1/θ2 α2
g2 (θ2 ) = r2 , θ2 > 0,
α2 Γ (r2 )θ2r2 +1
and the prior density of θ1 is the same as in the case of k = n. The parameters
α1 , r1 , α2 , and r2 are positive and known. The reason for choosing such g1 (·)
and g2 (·) is that they are conjugate priors. Then, the joint prior density of
x1 , . . . , xn given k, θ1 , and θ2 is
5.4 Bayesian Approach 167

f (x1 , . . . , xn |k, θ1 , θ2 )
⎧ 9
⎨θ1−nξ Γ −n (ξ)( n xi )ξ−1 e−(1/θ1 )Σ1n xi if k = n
1
= .
⎩θ−kξ θ−(n−k)ξ Γ −n (ξ)(9n x )ξ−1 e−(1/θ1 )Σ1k xi−(1/θ2 )Σkn+1 xi if 1 ≤ k ≤ n−1
1 2 1 i

Therefore, the joint prior density of λ, θ1 , and θ2 is given by

f (x , . . . , xn |k, θ1 , θ2 )g(k, θ1 , θ2 )
h0 (k, θ1 , θ2 |x1 , . . . , xn ) = n 77 1
k=1 f (x1 , . . . , xn |k, θ1 , θ2 )g(k, θ1 , θ2 )dθ1 dθ2

h1 , k = n
= ,
h2 , 1 ≤ k ≤ n − 1

where
1
h1 = 7 ∞ −(nξ+r1 +1) −(1/θ1 )Σ n xi −1/(θ1 α1 )
0 α−r
1 Γ
1 −1 (r )
1 · θ1 e 1 dθ1
−(1/θ1 )Σ1n xi
· pθ1−nξ e · α−r
1 Γ
1 −1
(r1 )θ1−r1 −1 e−1/(θ1 α1 ) ,

and
1
h2 =  7∞7∞ k −(1/θ2 )Σ n x −1/(θ2 α2 )
n−1 1−p e−(1/θ1 )Σ1 xi −1/(θ1 α1 ) k+1 i
k=1 n−1 0 0 r kξ̄+r1 +1 · e
r (n−k)ξ̄+r2 +1 dθ1 dθ2
α11 Γ (r1 )θ1 α22 Γ (r2 )θ2
k n
1 − p e−(1/θ1 )Σ1 xi −(1/θ2 )Σk+1 xi e−1/(θ1 α1 ) e−1/(θ2 α2 )
· ·
n−1 (n−λ)ξ
θ1λξ θ2 αr11 Γ (r1 )θ1r1 +1 αr22 Γ (r2 )θ2r2 +1
 ∞ k
1 e−(1/θ1 )Σ1 xi −1/(θ1 α1 )
+p · dθ1 .
0 αr11 ξ(r1 ) θ1kξ+r1 +1

After some calculation, h0 (k, θ1 , θ2 |x1 , . . . , xn ) simplifies to

h0 (k, θ1 , θ2 |x1 , . . . , xn )
⎧ −(nξ+r1 +1) −(1/θ1 )Σ n xi −1/(θ1 α1 )

⎪ p · const · θ1 e 1 , k=n

1−p −(kξ+r1 +1) −(1/θ1 )Σ1k xi −1/(θ1 α1 )
= n−1 · const · θ1 e .

⎪ 1 ≤ k ≤ n−1
⎩ −[(n−λ)ξ+r2 +1] −r2 −1 n
·θ2 α2 Γ (r2 )e−(1/θ2 )Σk+1 xi −1/(θ2 α2 ) ,
168 5 Gamma Model

Therefore, the posterior density of the change point k is given by:


 ∞ ∞
h(k|x) = h0 (k, θ1 , θ2 |x1 , . . . , xn )dθ1 dθ2
0 0

h3 , k=n
= ,
h4 1≤k ≤n−1

where
 ∞
−(nξ+r1 +1) −(1/θ1 )(Σ1n xi +1/α1 )
h3 = p · const · θ1 e dθ1
0

Γ (nξ + r1 )
= p · const · , n -nξ+r1
1 xi + 1/α1
 ∞ , n -nξ+r1  nξ+r1 −1  
1 xi + 1/α1 1 n 1
· e−(1/θ1 )(Σ1 xi +1/α1 ) d
0 Γ (nξ + r1 ) θ 1 θ 1
!−(nξ+r )

n 1

= p · const · Γ (nξ + r1 ) xi + 1/α1 ,


1

and
 ∞
1−p −(kξ+r1 +1) −(1/θ1 )(Σ1k xi +1/α1 )
h4 = · const · θ1 e dθ1
n−1 0
 ∞
−[(n−k)ξ̄+r2 +1] −r2 −1 n
· θ2 α2 Γ (r2 )e−(1/θ2 )(Σk+1 xi +1/α2 ) dθ2
0
!−(kξ+r1 )
1−p 
k
= · const · Γ (kξ + r1 ) xi + 1/α1
n−1 1
 ∞
, k -(kξ+r1 )  kξ+r1 −1  
xi + 1/α1
1 1 −(1/θ1 )(Σ1k xi +1/α1 ) 1
· e d
0 Γ (kξ + r1 ) θ 1 θ 1
! −[(n−k)ξ+r ]
 n 2
1
· Γ ((n − k)ξ + r2 ) xi + 1/α2 · r2
α2 Γ (r2 )
k+1

 ∞
, n -(n−λ)ξ+r2  (n−λ)ξ+r2 −1
xi + 1/α2 1
· k+1
0 Γ ((n − k)ξ + r2 ) θ2
 
n 1
× e−(1/θ2 )(Σk+1 xi +1/α2 ) d
θ2
5.5 Application to Stock Market and Air Traffic Data 169

1−p Γ (kξ + r1 )
= · const · ,  -(kξ+r1 )
n−1 k
1 xi + 1/α1

Γ ((n − k)ξ + r2 ) 1
· , -(n−λ)ξ+r2 · αr2 Γ (r ) .
n 2
2
k+1 xi + 1/α2

That is,
⎧ , n -−(nξ+r1 )

⎪ p · Γ (nξ + r1 ) 1 xi + 1/α1 , k=n






,(1−p)Γ (kξ+r1-)
h(k |x) ∝ (n−1) k1 xi +1/α1 (kξ+r1 )
·



⎪ 1 ≤ k ≤ n − 1.


⎩,  Γ ((n−k)ξ+r2 )
n
k+1
-(n−λ)ξ+r2 · r2 1
xi +1/α2
,
α2 Γ (r2 )

It is worth noting that, in many practical situations, one may take an


improper (noninformative) prior g(θi ) ∝ (1/θi )(i = 1, 2) for θ1 and θ2 , and
assume the independence of θ1 and θ2 . In this case, the posterior density of
the change point k is given by
⎧ , n -−nξ

⎨pΓ (nξ) 1 xi , k=n
h(λ|x) ∝ .


(1−p)Γ (kξ)
,
(n−1) k
 1 xi

-kξ , Γ ((n−k)ξ)
-(n−k)ξ ,
n
k+1 xi
1≤k ≤n−1

The examples analyzed by Hsu (1979) were also analyzed by Diaz (1982),
and their conclusions matched.

5.5 Application to Stock Market and Air Traffic Data

Hsu (1979) analyzed stock market data and air traffic flow data to illustrate
the method given in Section 5.1. Diaz (1982) reanalyzed those two datasets for
change point by using the Bayesian approach, and both authors’ conclusions
matched. Here, those two datasets are analyzed again to illustrate how to
implement the SIC procedure to detect and locate the change point.

Example 5.1 The first dataset to be analyzed is given in Appendix A of


Hsu (1979). This dataset contains Friday closing values of the Dow-Jones
Industrial Average (DJIA) from July 1, 1971 through August 2, 1974.
Let Pt be the Friday closing value of DJIA during that period (total
162 values), then according to Hsu (1979), the return series {Rt }, where
Rt = (Pt+1 − Pt )/Pt , t = 1, . . . , 161, is a sequence of independent normal
random variables with mean 0 and unknown variance σ 2 . Simple derivation
shows that Rt2 is a gamma random variable with shape parameter γ = 12 ,
and scale parameter λ = (2σ 2 )−1 . Then one can find out if there is a
170 5 Gamma Model

change in the scale parameters of the gamma random sequence {Rt2 } by


testing:
H0 : λ1 = λ2 = · · · = λ161 = λ0
against the alternative:

H1 : λ1 = · · · = λk = λk+1 = · · · = λ161 .

The values of SIC(n), n = 161, and SIC(k), k = 1, . . . , 160, are computed. It is


found that SIC(161) = −2245.2 > min1≤k≤160 SIC(k) = SIC(89) = −2267.1.
Therefore, there is a change in the scale parameter and the location of the
change point in {Rt2 } is 
k = 89, which corresponds to the week when the
Watergate event took place. This conclusion matches those of Hsu (1979)
and Diaz (1982).

Example 5.2 The second dataset to be analyzed is given in Appendix B


of Hsu (1979). This dataset contains 213 airplane arrival times collected
from a low-altitude transitional control sector (near Newark airport) for the
period from noon to 8:00 PM on April 30, 1969. Hsu has examined the data
and concluded that the interarrival times are independently exponentially
distributed. That is, if Ti denotes the arrival time, then xi = Ti+1 − Ti , i =
1, . . . , 212, is a gamma random variable with shape parameter γ = 1 and
scale parameter λ. To see if the air traffic densities are constant over time,
one can test:
H0 : λ1 = λ2 = · · · = λ212 = λ0
against the alternative:

H1 : λ1 = · · · = λk = λk+1 = · · · = λ212

for the sequence {xi }. The values of SIC(n), for n = 212, and SIC(k), for
k = 1, . . . , 211, are computed. It is found that

SIC(212) = 2504.1 < min SIC(k) = 2505.1.


1≤k≤211

Therefore, there is no change in the scale parameters; that is, the air traffic
densities are constant over time. This conclusion again matches those of Hsu
(1979) and Diaz (1982).

5.6 Another Type of Change

So far our discussion about the change points has been limited to the sudden
changes in a sequence of random variables from different models. Here,
we would like to pinpoint briefly a different type of change point problem
under the assumption of gamma distribution, and hope this reveals the rich
5.6 Another Type of Change 171

resources of change point problems, and gives the readers a peek at one of
the other considerations that may be encountered in some situations.
Let x1 , . . . , xn be a sequence of independent random variables from the
gamma distributions with parameters (θ1 , ξ), (θ1 , ξ), . . . , and (θn , ξ),
respectively. As before, ξ is assumed to be known, and the pdf of
Xi s is
1
f (x, ξ, θi ) = ξ xξ−1 e−(x/θi ) , ξ, θi > 0, x > 0,
θi Γ (ξ)
for i = 1, . . . , n.
We now intend to test H0 given in (5.1) versus the alternative:

H2 : θi = θ0 e{β(i−1)} , β = 0, i = 1, 2, . . . , n, (5.4)

with β > 0 meaning a continuous exponential increase in the parameter θ,


and β < 0 meaning a continuous exponential decrease in the parameter θ.
The likelihood function under (5.4) is
!ξ−1
1 8
n 
n
L2 (θ0 , β) = xi e−(1/θ0 ) xi /(eβ(i−1) );
θ0nξ e(n(n−1)/2)ξβ Γ n (ξ) i=1 i=1

that is,

n(n − 1)
log L2 (θ0 , β) = −nξ log θ0 − ξβ − n log Γ (ξ)
2
n
1  xi
n
+ (ξ − 1) log xi − ,
i=1
θ0 i=1 eβ(i−1)

and

1  (i − 1)xi
n
∂ log L2 (θ0 , β) n(n − 1)
=− ξ+
∂β 2 θ0 i=1 eβ(i−1)

1  xi
n
∂ log L2 (θ0 , β) nξ
=− + 2 ,
∂θ0 θ0 θ0 i=1 eβ(i−1)

which gives
1  xi
n
θ0 = .
nξ i=1 eβ(i−1)
Note that

∂ 2 log L2 (θ0 , β)  2  xi
n

 = −
∂θ02 θ 0 =θ 0 θ02 θ03 i=1 eβ(i−1)
172 5 Gamma Model

n3 ξ 3 2n3 ξ 3
= , n
xi
-2 − , n xi
-2
i=1 eβ(i−1) i=1 eβ(i−1)

n3 ξ 3
= − , n -2 < 0,
xi
i=1 eβ(i−1)

n
hence θ0 = (1/nξ) i=1 (xi /(eβ(i−1) )) is the MLE of θ0 under (5.4). Now
 n
∂ log L2 (θ0 , β)  n(n − 1) (i − 1)xi
 =− n
ξ + nξ i=1
∂β θ0 =θ0 ,β=0 2 i=1 xi

n(n − 1)ξ
=− + nξ · (n − 1)T
2
 
1
= n(n − 1)ξ T − ,
2

where n
− 1)xi
i=1 (i
T = n
(n − 1) i=1 xi
as defined in Section 5.2.
According to Cox and Hinkley (1974),

∂ log L2 (θ0 , β) 
 ,
∂β θ0 =θ0 ,β=0

the likelihood-derivative test (LDT), is asymptotically equivalent to the


likelihood-ratio test (LRT). Hence, we can make use of the asymptotic
distribution of T obtained in Section 5.2 to obtain an asymptotic test for
H0 given by (5.1) versus H2 given by (5.4).

You might also like