lesson 14: model checkinglesson 14: model checking umberto triacca dipartimento di ingegneria e...

21
Lesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit` a dell’Aquila, [email protected] Umberto Triacca Lesson 14: Model Checking

Upload: others

Post on 01-Aug-2020

4 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Lesson 14: Model Checking

Umberto Triacca

Dipartimento di Ingegneria e Scienze dell’Informazione e MatematicaUniversita dell’Aquila,

[email protected]

Umberto Triacca Lesson 14: Model Checking

Page 2: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

Given the time series

{xt ; t = 1, ...,T}

suppose that we have estimated the following ARMA model

xt =

p∑j=1

φjxt−j +

q∑j=1

θj ut−j

Umberto Triacca Lesson 14: Model Checking

Page 3: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

The residuals from fitted model are obtained by applyingrecursively for t = 1, 2, ...,T , the following formula

ut = xt −p∑

j=1

φjxt−j −q∑

j=1

θj ut−j t = 1, 2, ...,T

where xt = 0 and ut = 0 for t < 1.

Umberto Triacca Lesson 14: Model Checking

Page 4: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

For example, for the MA(1) process with zero mean, we haveut = xt − θut−1. Assuming ut = 0, then we compute theinnovations recursively as follows:

u1 = x1

u2 = x2 − θx1

u3 = x3 − θx2 + θ2x1

and so on. That is,

ut =t−1∑i=0

(−1)i θixt−i

Umberto Triacca Lesson 14: Model Checking

Page 5: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

The adequacy of the estimated model, can be evaluated byexamining the residuals from fitted model.

Why?

Umberto Triacca Lesson 14: Model Checking

Page 6: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

We observe that if the time series {xt ; t = 1, ...,T} is arealization of an ARMA(p, q) process

φ(L)xt = θ(L)ut , ut ∼ WN(0, σ2)

then the filter

π(L) =φ(L)

θ(L)

transforms the oservations {xt ; t = 1, ...,T} in a realization ofa Gaussian white noise.

Umberto Triacca Lesson 14: Model Checking

Page 7: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

Thus if p and q are well specified (the model chosen iscorrect), and if the estimated parameters are close to theactual values, then the residuals should be a realization of awhite noise.

If the diagnostics, such as graphs of the residuals, SACF,SPACF, histogram do not indicate a Gaussian white noise, themodel is found to be inadequate.

In this case it is necessary to go back and try to identify abetter model.

Umberto Triacca Lesson 14: Model Checking

Page 8: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

In addition to the visual inspection of the graphs, theBox-Pierce statistic

QK = TK∑

k=1

ρ2k

or the the Ljung-Box statistic

QK = T (T + 2)K∑

k=1

ρ2k/(T − k)

can be used for testing the hypothesis that the residuals arerealization of a white noise.

Umberto Triacca Lesson 14: Model Checking

Page 9: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

In fact, when p and q are well specified and when the numberof observation T is large, these statistics follows a chi-squaredistribution with K − p − q degrees of freedom (if a constantis included, the degrees of fredom are K − p − q − 1).

In practice, K is chosen between 15 and 30.

Umberto Triacca Lesson 14: Model Checking

Page 10: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking

We therefore reject the adequacy of the fitted model at level αif

QK > χ21−α,K−p−q

where χ21−α,K−p−q is the 1− α quantile of the chi-squared

distribution with K − p − q degrees of freedom.

Umberto Triacca Lesson 14: Model Checking

Page 11: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some example

Consider the series

Umberto Triacca Lesson 14: Model Checking

Page 12: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

Suppose that we have estimated the following model

xt = ut + 0.973ut−1

Umberto Triacca Lesson 14: Model Checking

Page 13: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

The residuals

Umberto Triacca Lesson 14: Model Checking

Page 14: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

Umberto Triacca Lesson 14: Model Checking

Page 15: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

The Box-Pierce statistic

Q20 = 68.7

The p-value is 0.026.

Umberto Triacca Lesson 14: Model Checking

Page 16: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

Suppose that we have re-estimated the model obtaining

xt = 0.64xt−1 + ut + 0.81ut−1

Umberto Triacca Lesson 14: Model Checking

Page 17: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

The residuals

Umberto Triacca Lesson 14: Model Checking

Page 18: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

Umberto Triacca Lesson 14: Model Checking

Page 19: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

The Box-Pierce statistic

Q20 = 15.16

The p-value is 0.307.

Umberto Triacca Lesson 14: Model Checking

Page 20: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

The histogram of the residuals:

Umberto Triacca Lesson 14: Model Checking

Page 21: Lesson 14: Model CheckingLesson 14: Model Checking Umberto Triacca Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit a dell’Aquila, umberto.triacca@univaq.it

Model checking: some examples

To check whether the residuals are normally distributed, wealso use the chi-square goodness of fit test:

Chi-square(2) = 1.374

with p-value 0.50307

Umberto Triacca Lesson 14: Model Checking