Some methods for functional econometric time series

43
Some methods for functional econometric time series Piotr Kokoszka Department of Statistics, Colorado State University Collaborators: Patrick Bardsley University of Texas Lajos Horv´ ath University of Utah Gregory Rice University of Waterloo Gabriel Young Columbia University Han Lin Shang Australian National University Piotr Kokoszka Functional time series

Transcript of Some methods for functional econometric time series

Page 1: Some methods for functional econometric time series

Some methods for functional econometric timeseries

Piotr KokoszkaDepartment of Statistics, Colorado State University

Collaborators:

Patrick Bardsley University of Texas

Lajos Horvath University of Utah

Gregory Rice University of Waterloo

Gabriel Young Columbia University

Han Lin Shang Australian National University

Piotr Kokoszka Functional time series

Page 2: Some methods for functional econometric time series

Outline

1 Fundamental concepts and stationarity tests

2 Autocorrelation under heteroskedasticity

3 Change point inference under heteroskedasticity

Piotr Kokoszka Functional time series

Page 3: Some methods for functional econometric time series

Examples of functional time series

Five consecutive yield curves:

Multivariate data, but curves have specific shapesPiotr Kokoszka Functional time series

Page 4: Some methods for functional econometric time series

100 consecutive yield curves around the crisis of 2008:

Piotr Kokoszka Functional time series

Page 5: Some methods for functional econometric time series

Pollution curves

One–day–ahead prediction highlighted with black dots.

0 10 20 30 40

5.5

6.0

6.5

7.0

7.5

Hour

Squ

are

root

of p

m10

Piotr Kokoszka Functional time series

Page 6: Some methods for functional econometric time series

Predicted US male log mortality rate curves

Years close to 2011 are in red, those close to 2040 in violet.

0 20 40 60 80 100

−10

−8

−6

−4

−2

USA: male death rates (2011−2040)

Age

Log

deat

h ra

te

Piotr Kokoszka Functional time series

Page 7: Some methods for functional econometric time series

Stationarity of functional time series

Definition

A functional time series model {Xn, n ∈ Z} is stationary if

µ(t) = EXn(t) and γh(t, s) = Cov(Xn(t),Xn+h(s)), h ∈ Z,

do not depend on n.

Definition

The long–run covariance function (LRCF) of a stationaryfunctional sequence is defined by

σ(t, s) =

∞∑

h=−∞

γh(t, s) = γ0(t, s) +

∞∑

h=1

(γh(t, s) + γh(s, t)) .

Piotr Kokoszka Functional time series

Page 8: Some methods for functional econometric time series

CLT

Under stationarity and assumptions on the dependence structure,the LRCF is the asymptotic covariance function of the samplemean:

NCov(XN(t), XN(s)) =

N−1∑

h=−N+1

(1− |h|

N

)γh(t, s) →

∞∑

h=−∞

γh(t, s)

and √N(XN − µ)

d→ Z ,

where Z is a Gaussian random function with EZ (t) = 0 andCov(Z (t),Z (s)) = σ(t, s).

All functions are assumed to be (random) elements of the Hilbertspace L2.

Piotr Kokoszka Functional time series

Page 9: Some methods for functional econometric time series

Estimation

σ(t, s) =

N−1∑

h=−N+1

K

(h

q

)γh(t, s),

where

γh(t, s) =1

N

N−h∑

j=1

(Xj(t)− XN(t)

) (Xj+h(s)− XN(s)

).

Under suitable assumptions on the dependence structure of theFTS {Xn},

∫∫{σ(t, s)− σ(t, s)}2 dtds P→ 0, as N → ∞.

Piotr Kokoszka Functional time series

Page 10: Some methods for functional econometric time series

Dependence assumption

ηj - observations or some “deviations”, depending on context.

Bernoulli shifts:ηj = g(ǫj , ǫj−1, ...)

Approximability:

∞∑

ℓ=1

(E‖ηn − ηn,ℓ‖2+δ)1/κ < ∞,

where ηn,ℓ is defined by

ηn,ℓ = g(ǫn, ǫn−1, ..., ǫn−ℓ+1, ǫ∗n−ℓ, ǫ

∗n−ℓ−1, . . .).

The ǫ∗k are independent copies of ǫ0, independent of{ǫi ,−∞ < i < ∞}.

Piotr Kokoszka Functional time series

Page 11: Some methods for functional econometric time series

One possible stationarity test

H0 : Xi(t) = µ(t) + ηi(t),

Examples of alternatives:Change point:

HA,1 : Xi(t) = µ(t) + δ(t)I {i > k∗}+ ηi (t).

Random walk (unit root):

HA,2 : Xi(t) = µ(t) +

i∑

ℓ=1

uℓ(t).

Piotr Kokoszka Functional time series

Page 12: Some methods for functional econometric time series

Top:IBM

pricecurves

onfive

consecu

tivetrad

ingdays.

Bottom

:Cumulative

intrad

ayretu

rnson

these

prices.

0.00.4

0.8

115 116 117 118 119

Day 1

0.00.4

0.8

115 116 117 118 119

Day 2

0.00.4

0.8

115 116 117 118 119

Day 3

0.00.4

0.8

115 116 117 118 119

Day 4

0.00.4

0.8

115 116 117 118 119

Day 5

0.00.4

0.8

−0.02 −0.01 0.00 0.01 0.02

0.00.4

0.8

−0.02 −0.01 0.00 0.01 0.02

0.00.4

0.8

−0.02 −0.01 0.00 0.01 0.02

0.00.4

0.8

−0.02 −0.01 0.00 0.01 0.02

0.00.4

0.8

−0.02 −0.01 0.00 0.01 0.02

Piotr

Kokoszk

aFunctio

naltim

eseries

Page 13: Some methods for functional econometric time series

Construction of the test statistic

SN(x , t) = N−1/2

[Nx ]∑

i=1

Xi(t), 0 ≤ x ≤ 1,

SN

(k

N, t

)= N−1/2

k∑

i=1

Xi(t), k = 1, 2, . . .N.

UN(x) = SN(x)− xSN(1), 0 ≤ x ≤ 1.

Test statistic:

TN =

∫ 1

0‖UN(x)‖2 dx =

∫ 1

0

{∫U2N(x , t)dt

}dx .

Piotr Kokoszka Functional time series

Page 14: Some methods for functional econometric time series

Null limit of the test statistic

Recall: ση(·, ·) long–run CF of the ηi .Eigenfunctions and eigenvalues:

∫ση(t, s)ϕj (s)ds = λjϕj (t), 1 ≤ j < ∞.

B1,B2, . . . independent Brownian bridges

Theorem

TNd→ T :=

∞∑

j=1

λj

∫ 1

0B2j (x)dx ,

Piotr Kokoszka Functional time series

Page 15: Some methods for functional econometric time series

Approximating the limit

1. Replace T by an approximation T ⋆ which can be computedfrom the observed functions X1,X2, . . . ,XN .Compute ση.The eigenvalues λj may be computed using the functionsvd.tensor in the R package tensorA. (For this problem, one canalso use fda package.)Truncate the infinite sum at the number of numerically availableeigenvalues.

2. Generate a large number, say R = 10E4, of replications of T ⋆.Replications can avoided by using the function imhoff in R and ananalytic expression for the distribution of

∫ 10 B2

j (x)dx .(Replications are very fast and easier to implement by theuninitiated than using imhoff.)

Piotr Kokoszka Functional time series

Page 16: Some methods for functional econometric time series

Pivotal limit

The eigenvalues λj collectively play a role analogous to theunknown long–run variance.Studentized test statistic:

T 0N(d) =

d∑

j=1

λ−1j

∫ 1

0〈UN(x , ·), ϕj 〉 dx

=

d∑

j=1

λ−1j

∫ 1

0

{∫UN(x , t)ϕj (t)dt

}dx .

The truncation level d level d cannot be too large.

Theorem

T 0N(d)

d→ T 0(d) =

d∑

j=1

∫ 1

0B2j (x)dx .

Piotr Kokoszka Functional time series

Page 17: Some methods for functional econometric time series

R implementation in ftsa

Call:

T_stationary(pm_10_GR_sqrt$y, J=100, MC_rep=5000, h=20,

pivotal=T)

Output:

p-value = 0.1188

N (number of functions) = 182

number of MC replications = 5000

Piotr Kokoszka Functional time series

Page 18: Some methods for functional econometric time series

Functional autocovariance under heteroskedasticity

0 5 10 15 20−

0.4

0.2

0.8

Lag

AC

F

Series arma.m

0 5 10 15 20

−0.

20.

41.

0

Lag

AC

F

Series ar.m

0 5 10 15 20

−0.

40.

20.

8

Lag

AC

F

Series ma.m

Piotr Kokoszka Functional time series

Page 19: Some methods for functional econometric time series

Motivation

The usual 1.96n−1/2 bands are valid if the white noise is strong(iid) white noise.

If the white noise is dependent (GARCH-type), the bands are notstraight lines, and are generally wider (well explained in the bookof Francq and Zakoian).

Portmanteau, Ljung-Box type, tests must also be modified in thepresence of GARCH-effects.

How does it work for functional conditionally heteroskedastic timeseries?

Piotr Kokoszka Functional time series

Page 20: Some methods for functional econometric time series

Test problems and assumptions

γh(t, s) = E (X0(t)− µX (t))(Xh(s)− µX (s)), µX (t) = EX0(t).

H0,h : γh(t, s) = 0, H′

0,K : γj(t, s) = 0, 1 ≤ j ≤ K ,

Functional conditionally heteroskedastic white noise:

(i) if u ∈ L2(µ), E 〈Xi , u〉 = 0 for all i ,

(ii) if v ∈ L2(µ ⊗ µ), and i 6= j , E 〈Xi ⊗ Xj , v〉 = 0,

(iii) if w ∈ L2(µ⊗4), and if the indices i , j , k , ℓ ∈ Z have a uniquemaximum, then E 〈Xi ⊗ Xj ⊗ Xk ⊗ Xℓ,w〉 = 0.

Piotr Kokoszka Functional time series

Page 21: Some methods for functional econometric time series

Test statistics

Sample autocovariance functions:

γh(t, s) =1

T

T−h∑

j=1

(Xj(t)− X (t))(Xj+h(s)− X (s))

Test statistics:

QT ,h = T‖γh‖2, VT ,K = T

K∑

h=1

‖γh‖2

These statistics have null limits which can be expressed as infiniteweighted chi-square distributions, and can be numericallyapproximated.

Piotr Kokoszka Functional time series

Page 22: Some methods for functional econometric time series

Application of the test (K = 10 lags)

p-values for portmanteau testsCIDR 5-minute returns

Symbol H′

0,10 SWN Test H′

0,10 SWN Test

S&P 500 0.9721 0.4061 0.5170 0.0000EC 0.5820 0.0798 0.4934 0.0001CL 0.0788 0.0000 0.4462 0.0000AAPL 0.5045 0.0315 0.4737 0.0989WFC 0.1713 0.0604 0.4483 0.2193XOM 0.3759 0.6513 0.5035 0.0332

(All trading days of 2014)

Piotr Kokoszka Functional time series

Page 23: Some methods for functional econometric time series

Confidence bands

Functional autocorrelations:

ρh =‖γh‖∫

γ0(t, t)µ(dt), ‖γh‖2 =

∫∫γ2h(t, s)µ(dt)µ(ds).

0 ≤ ρh ≤ 1

Sample functional autocorrelations:

ρh =‖γh‖∫

γ0(t, t)µ(dt)=

√QT ,h√

T∫γ0(t, t)µ(dt)

.

Since we can approximate the null distribution of QT ,h, we canconstruct h–dependent confidence bands.

Piotr Kokoszka Functional time series

Page 24: Some methods for functional econometric time series

Simulated functional heteroskedastic WN

5 10 15 20

0.0

00.0

50.1

00.1

50.2

0Estimated rho

IID bounds

GARCH bounds

Piotr Kokoszka Functional time series

Page 25: Some methods for functional econometric time series

Daily curves of 5 min SP500 returns

0.0

00

.02

0.0

40.0

60

.08

0.1

00.1

2S&P 500

Estimated rho

IID bounds

GARCH bounds

Piotr Kokoszka Functional time series

Page 26: Some methods for functional econometric time series

Change point tests under heteroskedasticity

Problem: We want to detect a change in the mean structure in thepresence of possible changes in variability (second order structure).There has been related research for scalar time series, e.g. :

Gorecki, T., Horvath, L., and Kokoszka, P.: Change point detection inheteroscedastic time series. Econometrics and Statistics, Forthcoming in 2017

Dalla, V., Giraitis, L. and Phillips, P.C.B.: Testing mean stability ofheteroskedastic time series. Preprint, 2015.

Xu, K–L.: Testing for structural change under non-stationary variances The

Econometrics Journal 18(2015), 274–305.

Zhou, Z.: Heteroscedasticity and autocorrelation robust structural changedetection Journal of the American Statistical Association 108(2013), 726–740.

Piotr Kokoszka Functional time series

Page 27: Some methods for functional econometric time series

Yield curves

i - day (or month)

tj - time to maturity (1 month, 3 months, ... , 30 years)Fractions of bonds with continuous maturities are traded.Our theory can be in discrete or continuous time t.

Xi(tj ) - yield of a bond bought on day i and held for time tj .For the theory, we can use, the yield curves, Xi (t), t ∈ [0,T ].

Piotr Kokoszka Functional time series

Page 28: Some methods for functional econometric time series

Yield curves

US yield curves over five business days around the LehmanBrothers bankruptcy filing on Sep 15 2008.

Piotr Kokoszka Functional time series

Page 29: Some methods for functional econometric time series

Yield curves

US yield curves over N = 100 business days; the central time pointcorresponds to the Lehman Brothers collapse.

Level, range, shape (mean structure)Piotr Kokoszka Functional time series

Page 30: Some methods for functional econometric time series

Nelson–Siegel factors

Nelson–Siegel factors f1(t, λ), f2(t, λ), f3(t, λ).

Piotr Kokoszka Functional time series

Page 31: Some methods for functional econometric time series

Factor models

Xi(tj) =K∑

k=1

βi ,k fk(tj) + εi (tj).

The fk are deterministic functions,treated as known in standard finance methodology

The K time series {βi ,k , = 1, 2, 3, . . .} are modeled as time series(modern dynamic models).

If βi ,k ≡ βk , static model.

Piotr Kokoszka Functional time series

Page 32: Some methods for functional econometric time series

Change point test in a functional factor model

Xi(t) =K∑

k=1

βi ,k fk(t) + εi (t), 1 ≤ i ≤ N.

(Continuous time)

βi ,k = µi ,k + bi ,k , Ebi ,k = 0.

µi = [µi ,1, µi ,2, . . . , µi ,K ]⊤

H0 : µ1 = µ2 = . . . = µN .

Piotr Kokoszka Functional time series

Page 33: Some methods for functional econometric time series

Change point vs. break point

H0: mean structure does not change,µi = µ1, 1 ≤ i ≤ N.

Error functions:∑K

k=1 bi ,k fk(t) + εi (t).The distribution of the error functions can change at known points:

1 = i0 < i1 < i2 < . . . < iM < iM+1 = N.

(Similar to prior information in Bayesian inference)On each segment, error functions are realizations of potentiallydifferent weakly dependent processes in L2.

Compare:unknown change points in mean structureknown break points in error structure

Piotr Kokoszka Functional time series

Page 34: Some methods for functional econometric time series

Determining break points

Dates of substantial central bank intervention,

Dates of events of economic impact,

Exploratory analysis of the variability of the yield curves.

After the application of the test, some change points may beclose to break points.

Piotr Kokoszka Functional time series

Page 35: Some methods for functional econometric time series

Detection through projections onto factors

Vectors of projections:

zi = [〈Xi , f1〉 , . . . , 〈Xi , fK 〉]⊤

Introduce the deterministic matrix

C = [〈fk , fj〉 , 1 ≤ k , j ≤ K ].

and random vectors

bi = [bi ,1, bi ,2, . . . , bi ,K ]⊤, εi = [〈εi , f1〉 , 〈εi , f2〉 , . . . , 〈εi , fK 〉]⊤.

Thenzi = Cµi + γ i , γ i = Cbi + εi ,

Change in the vectors µi is equivalent to a change in the zi at thesame change points.

Piotr Kokoszka Functional time series

Page 36: Some methods for functional econometric time series

Detection through projections onto factors

CUSUM process:

αN(x) = N−1/2

[Nx ]∑

i=1

zi −[Nx ]

N

N∑

i=1

zi

, 0 ≤ x ≤ 1.

Even under H0, the distribution of the zi can change at breakpoints.

{γ(m)i

}- model for the vector errors γ i over the interval (im, im+1].

Long–run covariance matrices:

Vm =

∞∑

ℓ=−∞

cov(γ(m)i ,γ

(m)i+ℓ).

Piotr Kokoszka Functional time series

Page 37: Some methods for functional econometric time series

Detection through projections onto factors

Limit distribution of the CUSUM process:

αN → G0, in DK ([0, 1]), G0(x) = G(x)− xG(1).

{G(x), x ∈ [0, 1]} is a mean zero RK–valued Gaussian process

with covariances

E [G(x)G⊤(y)] =

m∑

j=1

(θj−θj−1)Vj+(x−θm)Vm+1, θm ≤ x ≤ θm+1, y ≥ x

The covariances of the process G0 can be computed explicitly (along formula).Cramer–von–Mises functional

∫ 1

0‖αN(x)‖2 dx →

∫ 1

0

∥∥G0(x)∥∥2 dx .

We must simulate the distribution of the right–hand side.There are at least two ways to do it.We developed four change point tests.

Piotr Kokoszka Functional time series

Page 38: Some methods for functional econometric time series

Application to yield curves

Case (1)

Piotr Kokoszka Functional time series

Page 39: Some methods for functional econometric time series

Application to yield curves

Case (2)

Piotr Kokoszka Functional time series

Page 40: Some methods for functional econometric time series

Application to yield curves

Case (3)

Piotr Kokoszka Functional time series

Page 41: Some methods for functional econometric time series

Application to yield curves

Sampling Period Method Break Point P–value

ProjSim yes 1.5%(1) ProjEigen yes 1.7%

03/20/2008 – 03/19/2009 NFEigen yes 0.1%ProjSim no 87.9%ProjEigen no 85.2%NFEigen no 26.2%

ProjSim yes 0.1%(2) ProjEigen yes 0.0%

06/30/2005 - 06/29/2006 NFEigen yes 0.2%ProjSim no 56.7%ProjEigen no 50.5%NFEigen no 57.2%

ProjSim yes 68.1%(3) ProjEigen yes 66.9%

02/16/2012 – 02/14/2013 NFEigen yes 55.8%ProjSim no 80.4%ProjEigen no 77.7%NFEigen no 76.3%

Piotr Kokoszka Functional time series

Page 42: Some methods for functional econometric time series

Conclusions

Conclusions based on similar data examples and simulations:

1 If a possible break point in the error structure is not takeninto account in any of the testing procedures, an existingchange point in the mean structure may not to be detected.

2 Break points can be misplaced, ±50 days is fine.

3 The tests are generally well calibrated if N = 500. If N = 250,all tests have a tendency to overreject by some 2 percent.

4 If the intelligible factors (Lengwiller and Lenz (2010) are used,the empirical size of projSim test improves at the 5% nominallevel, but the size of the ProjEigen test deteriorates.

5 We recommend ProjSim with intelligible factors and NFEigen.

The paper contains complete asymptotic theory and details ofnumerical implementation.

Piotr Kokoszka Functional time series

Page 43: Some methods for functional econometric time series

Books that contain other FTS topics

Piotr Kokoszka Functional time series