Professional Documents
Culture Documents
Gamma Model
5.1 Problem
1
f (x, ξ, θi ) = xξ−1 e−(x/θi ) , ξ, θi > 0, x > 0, i = 1, . . . , n.
θiξ Γ (ξ)
H0 : θ1 = θ2 = · · · = θn = θ0 (5.1)
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
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
⎧ ⎫
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
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
n
z= xi .
i=1
x2 = zy2 ,
x3 = zy3 ,
..
.
xn = zyn .
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
Γ (nξ) Γ (ξ + r2 ) · · · Γ (ξ + rn )
E[y2r2 y3r3 , . . . , ynrn ] = · ,
Γ n−1 (ξ) Γ (nξ + r2 + · · · + rn )
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
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
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
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
3nξ(n − 1) + 2(2n − 1) 5
− + .
8(n − 1)(nξ + 1) 16
164 5 Gamma Model
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)
H0 : θ 1 = θ 2 = · · · = θ n = θ 0
H1 : θ1 = · · · = θk = θk+1 = · · · = θn ,
5.3 Informational Approach 165
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
n2 e2nξ ξ 2n (ξ)
+ log .
(nξ)2kξ [(n − k)ξ]2(n−k)ξ
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
H0 : k = n versus H1 : 1 ≤ k ≤ n − 1.
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
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
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
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
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 )
The examples analyzed by Hsu (1979) were also analyzed by Diaz (1982),
and their conclusions matched.
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.
H1 : λ1 = · · · = λk = λk+1 = · · · = λ161 .
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
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).
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)
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
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