structural break detection in time series modelsrdavis/lectures/ottawa_05.pdf · 2005. 7. 8. ·...

28
1 Ottawa 7/05 Structural Break Detection Structural Break Detection in Time Series Models in Time Series Models Richard A. Davis Thomas Lee Gabriel Rodriguez-Yam Colorado State University (http://www.stat.colostate.edu/~rdavis/lectures) This research supported in part by an IBM faculty award.

Upload: others

Post on 18-Nov-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

1Ottawa 7/05

Structural Break Detection Structural Break Detection in Time Series Modelsin Time Series Models

Richard A. Davis

Thomas Lee

Gabriel Rodriguez-Yam

Colorado State University(http://www.stat.colostate.edu/~rdavis/lectures)

This research supported in part by an IBM faculty award.

Page 2: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

2Ottawa 7/05

IntroductionSetupExamples

ARGARCHStochastic volatility State space model

Model Selection Using Minimum Description Length (MDL)General principlesApplication to AR models with breaks

Optimization using Genetic AlgorithmsBasicsImplementation for structural break estimation

Simulation results

Applications

Simulation results for GARCH and SSM

Page 3: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

3Ottawa 7/05

Introduction

The Premise (in a general framework):

Base model: Pθ family or probability models for a stationary time series.

Observations: y1, . . . , yn

Segmented model: there exist an integer m ≥ 0 and locations

τ0 = 1 < τ1 < . . . < τm-1 < τm = n + 1

such that

where {Xt,j} is a stationary time series with probability distrand θj≠ θj+1.Objective: estimate

m = number of segmentsτj = location of jth break point θj = parameter vector in jth epoch

, if , 1, jj-jtt tXY τ<≤τ=

jPθ

Page 4: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

4Ottawa 7/05

Examples

1. Piecewise AR model:

where τ0 = 1 < τ1 < . . . < τm-1 < τm = n + 1, and {εt} is IID(0,1).

Goal: Estimate

m = number of segmentsτj = location of jth break point γj = level in jth epochpj = order of AR process in jth epoch

= AR coefficients in jth epochσj = scale in jth epoch

, if , 111 jj-tjptjptjjt tYYYjj

τ<≤τεσ+φ++φ+γ= −− L

),,( 1 jjpj φφ K

Page 5: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

5Ottawa 7/05

Piecewise AR models (cont)

Structural breaks: Kitagawa and Akaike (1978)

• fitting locally stationary autoregressive models using AIC• computations facilitated by the use of the Householder transformation

Davis, Huang, and Yao (1995)

• likelihood ratio test for testing a change in the parameters and/or order of an AR process.

Kitagawa, Takanami, and Matsumoto (2001)

• signal extraction in seismology-estimate the arrival time of a seismic signal.

Ombao, Raz, von Sachs, and Malow (2001)

• orthogonal complex-valued transforms that are localized in time and frequency- smooth localized complex exponential (SLEX) transform.• applications to EEG time series and speech data.

Page 6: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

6Ottawa 7/05

Motivation for using piecewise AR models:

Piecewise AR is a special case of a piecewise stationary process (see Adak 1998),

where , j = 1, . . . , m is a sequence of stationary processes. It is

argued in Ombao et al. (2001), that if {Yt,n} is a locally stationary

process (in the sense of Dahlhaus), then there exists a piecewise

stationary process with

that approximates {Yt,n} (in average mean square).

Roughly speaking: {Yt,n} is a locally stationary process if it has a time-varying spectrum that is approximately |A(t/n,ω)|2 , where A(u,ω) is a continuous function in u.

,)/(~1

),[, 1∑=

ττ −=

m

j

jtnt ntIYY

jj

}{ jtY

, as ,0/ with ∞→→∞→ nnmm nn

}~{ ,ntY

Page 7: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

7Ottawa 7/05

Examples (cont)

2. Segmented GARCH model:

where τ0 = 1 < τ1 < . . . < τm-1 < τm = n + 1, and {εt} is IID(0,1).

3. Segmented stochastic volatility model:

4. Segmented state-space model (SVM a special case):

, if ,

,

122

1122

112

jj-qtjqtjptjptjjt

ttt

tYY

Y

jjjjτ<≤τσβ++σβ+α++α+ω=σ

εσ=

−−−− LL

. if ,loglog log

,

122

112

jj-tjptjptjjt

ttt

t

Y

jjτ<≤την+σφ++σφ+γ=σ

εσ=

−− L

. if , specified is )|(),...,,,...,|(

111

111

jj-tjptjptjjt

ttttt

typyyyp

jjτ<≤τησ+αφ++αφ+γ=α

α=αα

−−

L

Page 8: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

8Ottawa 7/05

Model Selection Using Minimum Description Length

Basics of MDL:Choose the model which maximizes the compression of the data or, equivalently, select the model that minimizes the code length of the data (i.e., amount of memory required to encode the data).

M = class of operating models for y = (y1, . . . , yn)

LF (y) = = code length of y relative to F ∈ MTypically, this term can be decomposed into two pieces (two-part code),

where

= code length of the fitted model for F

= code length of the residuals based on the fitted model

,ˆ|ˆ( ˆ()( )eL|y)LyL FFF +=

|y)L F(

)|eL Fˆ(

Page 9: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

9Ottawa 7/05

Model Selection Using Minimum Description Length (cont)

Applied to the segmented AR model:

First term : Let nj = τj – τj-1 and denote the length of the jth segment and the parameter vector of the jth AR process, respectively. Then

, if , 111 jj-tjptjptjjt tYYYjj

τ<≤τεσ+φ++φ+γ= −− L

|y)L F(

)|ˆ()|ˆ(),,(),,( )|ˆ()|ˆ(),,(),,(ˆ(

111

111

yLyLppLnnLL(m)yLyLppLLL(m)|y)L

mmm

mmm

ψ++ψ+++=ψ++ψ++ττ+=

LKK

LKKF

),,, , ( 1 jjpjjj jσφφγ=ψ K

Encoding:integer I : log2 I bits (if I unbounded)

log2 IU bits (if I bounded by IU)

MLE : ½ log2N bits (where N = number of observations used to compute ; Rissanen (1989))

θθ

Page 10: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

10Ottawa 7/05

Second term : Using Shannon’s classical results on information theory, Rissanen demonstrates that the code length of can be approximated by the negative of the log-likelihood of the fitted model, i.e., by

)eL F|ˆ(

So,∑∑

==

++++=

m

jj

jm

jj n

ppnmm|y)L

12

1222 log

22

logloglogˆ(F

e

)1)ˆ2((log2

ˆ|ˆ(1

22 +σπ≈ ∑

=

m

jj

jn)eL F

For fixed values of m, (τ1,p1),. . . , (τm,pm), we define the MDL as

2)ˆ2(log

2log

22

logloglog

)),(,),,(,(

1 1

222

1222

11

nnn

ppnmm

ppmMDLm

j

m

jj

jj

jm

jj

mm

∑ ∑∑= ==

+σπ++

+++=

ττ K

The strategy is to find the best segmentation that minimizes MDL(m,τ1,p1,…, τm,pm). To speed things up, we use Y-W estimates of AR parameters.

Page 11: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

11Ottawa 7/05

Optimization Using Genetic Algorithms

Basics of GA:Class of optimization algorithms that mimic natural evolution.

• Start with an initial set of chromosomes, or population, of possible solutions to the optimization problem.

• Parent chromosomes are randomly selected (proportional to the rank of their objective function values), and produce offspring using crossover or mutation operations.

• After a sufficient number of offspring are produced to form a second generation, the process then restarts to produce a thirdgeneration.

• Based on Darwin’s theory of natural selection, the process should produce future generations that give a smaller (or larger)objective function.

Page 12: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

12Ottawa 7/05

Map the break points with a chromosome c via

where

For example,

c = (2, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, -1, -1, -1, 3, -1, -1, -1, -1,-1)t: 1 6 11 15

would correspond to a process as follows:

AR(2), t=1:5; AR(0), t=6:10; AR(0), t=11:14; AR(3), t=15:20

Application to Structural Breaks—(cont)

Genetic Algorithm: Chromosome consists of n genes, each taking the value of −1 (no break) or p (order of AR process). Use natural selection to find a near optimal solution.

),,,( )),(,),(,( n111 δδ=⎯→←ττ KK cppm mm

⎩⎨⎧

τ=−

=δ− . isorder AR and at timepoint break if ,

,at point break no if ,1

1 jjjt ptp

t

),,,( )),(,),(,( n111 δδ=⎯→←ττ KK cppm mm

⎩⎨⎧

τ=−

=δ− . isorder AR and at timepoint break if ,

,at point break no if ,1

1 jjjt ptp

t

Page 13: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

15Ottawa 7/05

Simulation Examples-based on Ombao et al. (2001) test cases

1. Piecewise stationary with dyadic structure: Consider a time series following the model,

where {εt} ~ IID N(0,1).⎪⎩

⎪⎨

≤≤ε+−<≤ε+−

<≤ε+=

−−

−−

,1024769 if ,81.32.1 ,769513 if ,81.69.1

,5131 if ,9.

21

21

1

tYYtYY

tYY

ttt

ttt

tt

t

Time

1 200 400 600 800 1000

-10

-50

510

⎪⎩

⎪⎨

≤≤ε+−<≤ε+−

<≤ε+=

−−

−−

,1024769 if ,81.32.1 ,769513 if ,81.69.1

,5131 if ,9.

21

21

1

tYYtYY

tYY

ttt

ttt

tt

t

Page 14: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

16Ottawa 7/05

1. Piecewise stat (cont)

GA results: 3 pieces breaks at τ1=513; τ2=769. Total run time 16.31 secs

Time0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

Time0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

True Model Fitted Model

Fitted model: φ1 φ2 σ2

1- 512: .857 .9945513- 768: 1.68 -0.801 1.1134769-1024: 1.36 -0.801 1.1300

Page 15: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

17Ottawa 7/05 Time

1 200 400 600 800 1000

-6-4

-20

24

Simulation Examples (cont)

2. Slowly varying AR(2) model:

where and {εt} ~ IID N(0,1).

10241 if 81. 21 ≤≤ε+−= −− tYYaY ttttt

)],1024/cos(5.01[8. tat π−=

0 200 400 600 800 1000

time

0.4

0.6

0.8

1.0

1.2

a_t

10241 if 81. 21 ≤≤ε+−= −− tYYaY ttttt

)],1024/cos(5.01[8. tat π−=

Page 16: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

18Ottawa 7/05Time

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

2. Slowly varying AR(2) (cont)

GA results: 3 pieces, breaks at τ1=293, τ2=615. Total run time 27.45 secs

True Model Fitted Model

Fitted model: φ1 φ2 σ2

1- 292: .365 -0.753 1.149293- 614: .821 -0.790 1.176615-1024: 1.084 -0.760 0.960

Time0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

Page 17: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

22Ottawa 7/05

2. Slowly varying AR(2) (cont)

True Model Average Model

In the graph below right, we average the spectogram over the GA fitted models generated from each of the 200 simulated realizations.

Time0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

Time

Freq

uenc

y

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

Page 18: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

23Ottawa 7/05

Data: Yt = number of monthly deaths and serious injuries in UK, Jan `75 – Dec `84, (t = 1,…, 120)Remark: Seat belt legislation introduced in Feb `83 (t = 99).

Example: Monthly Deaths & Serious Injuries, UK

Year

Cou

nts

1976 1978 1980 1982 1984

1200

1400

1600

1800

2000

2200

Page 19: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

24Ottawa 7/05

Data: Yt = number of monthly deaths and serious injuries in UK, Jan `75 – Dec `84, (t = 1,…, 120)Remark: Seat belt legislation introduced in Feb `83 (t = 99).

Example: Monthly Deaths & Serious Injuries, UK

Year

Diff

eren

ced

Cou

nts

1976 1978 1980 1982 1984

-600

-400

-200

020

0

Piece 1: (t=1,…, 98) IID; Piece 2: (t=99,…108) IID; Piece 3: t=109,…,120 AR(1)Results from GA: 3 pieces; time = 4.4secs

Page 20: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

25Ottawa 7/05

Examples

Speech signal: GREASY

Time

1 1000 2000 3000 4000 5000

-150

0-5

000

500

1000

1500

G R EA S Y

Page 21: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

26Ottawa 7/05

Time

1 1000 2000 3000 4000 5000

-150

0-5

000

500

1000

1500

G R EA S Y

Time0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.1

0.2

0.3

0.4

0.5

Speech signal: GREASYn = 5762 observationsm = 15 break pointsRun time = 18.02 secs

Page 22: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

27Ottawa 7/05

Application to GARCH (cont)

Garch(1,1) model:

⎩⎨⎧

<≤σ++<≤σ++

=σ−−

−−

.1000501 if ,6.1.4. ,5011 if ,5.1.4.

21

21

21

212

tYtY

tt

ttt

. if ,

IID(0,1)~}{ ,

12

121

2jj-tjtjjt

tttt

tY

Y

τ<≤τσβ+α+ω=σ

εεσ=

−−

AG%

GA%

# of CPs

24.019.21

≥ 2

0

0.40.4

72.080.4

AG = Andreou and Ghysels (2002)

⎩⎨⎧

<≤σ++<≤σ++

=σ−−

−−

.1000501 if ,6.1.4. ,5011 if ,5.1.4.

21

21

21

212

tYtY

tt

ttt

Time1 200 400 600 800 1000

-4-2

02

CP estimate = 506

. if ,

IID(0,1)~}{ ,

12

121

2jj-tjtjjt

tttt

tY

Y

τ<≤τσβ+α+ω=σ

εεσ=

−−

Page 23: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

28Ottawa 7/05

time

y

1 100 200 300 400 500

05

1015

Count Data ExampleModel: Yt | αt ∼ Pois(exp{β + αt }), αt = φαt-1+ εt , {εt}~IID N(0, σ2)

Breaking PointM

DL

1 100 200 300 400 500

1002

1004

1006

1008

1010

1012

1014

True model:

Yt | αt ~ Pois(exp{.7 + αt }), αt = .5αt-1+ εt , {εt}~IID N(0, .3), t < 250

Yt | αt ~ Pois(exp{.7 + αt }), αt = -.5αt-1+ εt , {εt}~IID N(0, .3), t > 250.

GA estimate 251, time 267secs

Page 24: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

29Ottawa 7/05

time

y

1 500 1000 1500 2000 2500 3000

-2-1

01

23

Model: Yt | αt ∼ N(0,exp{αt}), αt = γ + φ αt-1+ εt , {εt}~IID N(0, σ2)

SV Process Example

True model:

Yt | αt ~ N(0, exp{αt}), αt = -.05 + .975αt-1+ εt , {εt}~IID N(0, .05), t ≤ 750

Yt | αt ~ N(0, exp{αt }), αt = -.25 +.900αt-1+ εt , {εt}~IID N(0, .25), t > 750.

GA estimate 754, time 1053 secs

Breaking Point

MD

L

1 500 1000 1500 2000 2500 3000

1295

1300

1305

1310

1315

Page 25: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

30Ottawa 7/05

time

y

1 100 200 300 400 500

-0.5

0.0

0.5

Model: Yt | αt ∼ N(0,exp{αt}), αt = γ + φ αt-1+ εt , {εt}~IID N(0, σ2)

SV Process Example

True model:

Yt | αt ~ N(0, exp{αt}), αt = -.175 + .977αt-1+ εt , {εt}~IID N(0, .1810), t ≤ 250

Yt | αt ~ N(0, exp{αt }), αt = -.010 +.996αt-1+ εt , {εt}~IID N(0, .0089), t > 250.

GA estimate 251, time 269s

Breaking PointM

DL

1 100 200 300 400 500

-530

-525

-520

-515

-510

-505

-500

Page 26: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

31Ottawa 7/05

SV Process Example-(cont)

time

y

1 100 200 300 400 500

-0.5

0.0

0.5

Fitted model based on no structural break:

Yt | αt ∼ N(0, exp{αt}), αt = -.0645 + .9889αt-1+ εt , {εt}~IID N(0, .0935)

True model:

Yt | αt ~ N(0, exp{at}), αt = -.175 + .977αt-1+ et , {εt}~IID N(0, .1810), t ≤ 250

Yt | αt ∼ N(0, exp{αt }), αt = -.010 +.996αt-1+ εt , {εt}~IID N(0, .0089), t > 250.

time

y

1 100 200 300 400 500

-0.5

0.0

0.5

1.0 simulated seriesoriginal series

Page 27: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

32Ottawa 7/05

SV Process Example-(cont)Fitted model based on no structural break:

Yt | αt ∼ N(0, exp{αt}), αt = -.0645 + .9889αt-1+ εt , {εt}~IID N(0, .0935)

time

y

1 100 200 300 400 500

-0.5

0.0

0.5

1.0 simulated series

Breaking Point

MD

L

1 100 200 300 400 500-4

78-4

76-4

74-4

72-4

70-4

68-4

66

Page 28: Structural Break Detection in Time Series Modelsrdavis/lectures/Ottawa_05.pdf · 2005. 7. 8. · Ottawa 7/05 3 Introduction The Premise (in a general framework): Base model: Pθ family

33Ottawa 7/05

Summary Remarks

1. MDL appears to be a good criterion for detecting structural breaks.

2. Optimization using a genetic algorithm is well suited to find a near optimal value of MDL.

3. This procedure extends easily to multivariate problems.

4. While estimating structural breaks for nonlinear time series models is more challenging, this paradigm of using MDL together GA holds promise for break detection in parameter-driven models and other nonlinear models.