Docsity

Best Linear Predictor in Time Series: Theory and Algorithms - Prof. Arthur S. Berg, Assignments of Statistics

Partial preview of the text

Download Best Linear Predictor in Time Series: Theory and Algorithms - Prof. Arthur S. Berg and more Assignments Statistics in PDF only on Docsity!

STA 6857—Forecasting (§3.5 cont.)

Outline

(^1) Forecasting

(^2) Homework 3e

Best Linear Predictor

We will focus on linear predictors of the form

x

n

n+m

= α 0

n ∑

k= 1

α k

x k

Theorem (Best Linear Prediction for Stationary Processes)

Given data x 1

, x 2

,... , x n

, the best linear predictor of x n+m

for m ≥ 1 is found by

solving

E

[

(x n+m

− x

n

n+m

)x k

]

= 0 , k = 0 , 1 ,... , n

where x 0

Equations (?) are called the prediction equations, and they provide a useful tool

in computing the best linear predictor x

n

n+m

Prediction Equation Picture

E

[

(x n+m

− x

n

n+m

)x k

]

= 0 , k = 0 , 1 ,... , n

Matrix Formulation of the Prediction Equations

From the equations

n ∑

j= 1

φ

(m)

nj

γ(k − j) = γ(k + m − 1 ), k = 1 ,... , n

we have the following compact representation

n

φ

(m)

n =^ γ

(m)

n

where

n

= {γ(k − j)}

n

j,k= 1

γ( 0 ) γ( 1 ) · · · γ(n − 1 )

γ( 1 ) γ( 0 ) · · · γ(n − 2 )

γ(n − 1 ) γ(n − 2 ) · · · γ( 0 )

φ

(m)

n =

φ

(m)

n 1

, φ

(m)

n 2

,... , φ

(m)

nn

′

and

γ

(m)

n = (γ(m), γ(m^ +^1 ),... , γ(m^ +^ n^ −^1 ))

′

.

A Solution by Matrix Inversion

If Γn is invertible, then from

n

φ

(m)

n

= γ

(m)

n

we can solve φ

(m)

n

to be

φ

(m)

n = Γ

− 1

n

γ

(m)

n

When n is large and Γ n

is difficult to invert, the Durbin-Levinson recursive

algorithm can be used.

Durbin-Levinson Algorithm

Algorithm (Durbin-Levinson Algorithm)

The algorithm is initiated with

φ 00 = 0 P

0

1

= γ( 0 ).

For n ≥ 1 ,

φnn =

ρ(n) −

n− 1

k= 1

φ n− 1 ,k

ρ(n − k)

n− 1

k= 1

φ n− 1 ,k

ρ(k)

P

n

n+ 1

= P

n− 1

n

( 1 − φ

2

nn

where, for n ≥ 2 ,

φ nk

= φ n− 1 ,k

− φ nn

φ n− 1 ,n−k

, k = 1 , 2 ,... , n − 1.

Bonus: The PACF of a stationary process x t

is given by φ nn

in (?).

Using the Complete Past

The prediction

̂ x n+m

= E(x n+m

|x n

, x n− 1

,... , x 1

can be approximated by the prediction derived from conditioning on the infinite

past given as

˜xn+m = E(xn+m|xn, xn− 1 ,.. .)

Using this approximation and replacing the unknown values of x 0

, x 1

,... with 0,

we construct the forecast for a general ARMA process as

˜x n+m

φ 1

x n+m− 1

  • · · · φ p

˜x n+m−p

  • θ 1

w˜ n+m− 1

  • · · · + θ q

˜w n+m−q

where

˜x t

0 , t ≤ 0

x, 1 ≤ t ≤ n

w ˜t =

0 , t ≤ 0 or t > n

φ(B)˜x t

− θ 1

w˜ t− 1

− · · · − θ q

˜w t−q

, 1 ≤ t ≤ n.

Prediction Intervals

( 1 − α) prediction intervals are of the form

x

n

n+m

± z α/ 2

P

n

n+m

So for an approximate 95% prediction interval, one can use z. 025 ≈ 2.

Back to the Recruitment Series

setwd("C:/Users/berg.UFAD/Documents/sta 6857/R")

rec = ts(scan("mydata/recruit.dat"), start=1950, frequency=12)

Recruitment Series (cont.)

(fit = ar.ols(rec,order=2,demean=F,intercept=T))

Call:

ar.ols(x = rec, order.max = 2, demean = F, intercept = T)

Coefficients:

1 2

1.3541 -0.

Intercept: 6.737 (1.111)

Order selected 2 sigma^2 estimated as 89.

fit$asy.se

$x.mean

[1] 1.

$ar

[1] 0.04178901 0.

Recruitment Series (cont.)

rec.pr = predict(rec.yw, n.ahead=24)

U = rec.pr$pred + rec.pr$se

L = rec.pr$pred - rec.pr$se

minx = min(rec,L)

maxx = max(rec,U)

ts.plot(rec, rec.pr$pred, xlim=c(1980,1990), ylim=c(minx,maxx))

lines(rec.pr$pred, col="red", type="o")

lines(U, col="blue", lty="dashed")

lines(L, col="blue", lty="dashed")

Outline

(^1) Forecasting

(^2) Homework 3e

Do Your Homework!

You should be up to §3.6 on the reading.