time series building

21
Time Series Building - Simple time series plot : preliminary assessment tool for stationarity - Non stationarity: consider time series plot of first (d th ) differences - Unit root test of Dickey & Fuller : check for the need of differencing - Sample ACF & PACF plots of the original time series or d th differences - 20-25 sample autocorrelations sufficient 1. Model Identification 2. Parameter Estimation - Methods of moments, maximum likelihood, least squares 3. Diagnostic checking- check for adequacy - Residual analysis: Residuals behave like a white noise Autocorrelation function of the residuals r e (k) not differ significantly from zero - check the first k residual autocorrelations together p i q i i t i i t i t t y y 1 1 ˆ ˆ ˆ ˆ ˆ ) ( ~ 2 1 2 q p K X k r d N Q K k e 1

Upload: ossie

Post on 22-Feb-2016

56 views

Category:

Documents


0 download

DESCRIPTION

Time Series Building. 1. Model Identification. Simple time series plot : preliminary assessment tool for stationarity Non stationarity : consider time series plot of first ( d th ) differences Unit root test of Dickey & Fuller : check for the need of differencing - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Time Series Building

1

Time Series Building

-Simple time series plot : preliminary assessment tool for stationarity-Non stationarity: consider time series plot of first (dth) differences -Unit root test of Dickey & Fuller : check for the need of differencing-Sample ACF & PACF plots of the original time series or dth differences-20-25 sample autocorrelations sufficient

1. Model Identification

2. Parameter Estimation- Methods of moments, maximum likelihood, least squares

3. Diagnostic checking- check for adequacy

-Residual analysis:

Residuals behave like a white noiseAutocorrelation function of the residuals re(k) not differ significantly from zero- check the first k residual autocorrelations together

p

i

q

iitiititt yy

1 1

ˆˆˆˆˆ

)(~ 2

1

2 qpKXkrdNQK

ke

Page 2: Time Series Building

2

Example

May exist some autocorrelation between the number of applications in the current week & the number of loan applications in the previous weeks

Page 3: Time Series Building

3

Weekly data: -Short runs -Autocorrelation-A slight drop in the mean for the 2nd year (53-104 weeks) :-Safe to assume stationarity

Sample ACF plot:-Cuts off after lag 2 (or 3)MA(2) or MA(3) model -- Exponential decay patternAR(p) model

Sample PACF plot: -Cuts off after lag 2Use AR(2) model

Page 4: Time Series Building

4

- Parameter estimates:Significant - Box-Pierce test: no autocorrelation-sample ACF & PACF: confirm also

42.0ˆ&27.0ˆ21

Page 5: Time Series Building

5

Acceptable fit

Fitted values: smooth out the highs and lows in the data

Page 6: Time Series Building

6

Example

Signs of non-stationarity:-changing mean & variance-Sample ACF: slow decreasing-Sample PACF: significant value at lag 1, close to 1

Significant sample PACF value at lag 1: AR(1) model

Page 7: Time Series Building

7

Residuals plot: changing variance- Violates the constant variance assumption

Page 8: Time Series Building

8

- AR(1) model coefficient:Significant - Box-Pierce test: no autocorrelation-sample ACF & PACF: confirm also

9045.0ˆ

Page 9: Time Series Building

9

Plot of the first difference: -level of the first difference remains the same

Sample ACF & PACF plots: first difference white noise

RANDOM WALK MODEL, ARIMA(0,1,0)

Page 10: Time Series Building

10

Decide between the 2 models AR(1) & ARIMA(0,1,0)

-Use specific criteria-Use subjective matter /process knowledge

Do we expect a financial index as the Dow Jones Index to be around a fixed mean, as implied by AR(1)?

ARIMA(0,1,0) takes into account the inherent non stationarity of the process

However

A random walk model means the price changes are random and cannot be predicted

Not reliable and effective forecasting model

Random walks models for financial data

Page 11: Time Series Building

11

Forecast ARIMA process

How to obtain Best forecast

The mean square error for which the expected value of the squared forecast errors is minimized

22ˆ TTT eETyyE

Best forecast in the mean square sense

iiTiTTTT yyyETy ,/ˆ 1,

Forecast error

1

0

ˆ

i

iTiTTT Tyye

Page 12: Time Series Building

12

21

0

22

1

0

21

0

)(

0

ii

iiTi

iiTiT

T

VarVareVar

eEVariance of the forecast errors: bigger with increasing forecast lead times

Prediction Intervals

Mean & variance

azTyyzTyP aTTaT

1ˆˆ

22

100(1-a) percent prediction interval

2

ˆ aT zTy

Page 13: Time Series Building

13

iiTiTTTT yyyETy ,/ˆ 1, 2 problems

-Infinite many terms in the past, in practice have finite number of data-Need to know the magnitude of random shocks in the past

-Estimate past random shocks through one-step forecasts

ARIMA model

q

iiti

dp

iititt yy

11

ˆˆ

Page 14: Time Series Building

14

ARIMA(1,1,1) process

TT ByBB 111

1. Infinite MA representation of the model

2211

1

TT

iiTiTy

11ˆ TTT Ty

forecast

weights

BBBBB pp 111 110

Random shocks 1ˆ1 Tyye TTT

forecast

Page 15: Time Series Building

15

2. Use difference equations

2ˆ1ˆ1ˆ2

11,,\ˆ1

1

1111

121

TTT

TTTTTTT

TTTTT

yyTy

eyyyyyETy

yyy

Page 16: Time Series Building

16

Seasonality in a time series is a regular pattern of changes that repeats over S time periods, where S defines the number of time periods until the pattern repeats again.

Page 17: Time Series Building

17

SEASONAL PROCESS

ttt NSy St deterministic with periodicity s Nt stochastic, modeled ARMA

01 ts

stt SBSS

ts

ts

ts NBSByB 111

wt seasonally stationary process

ts

t BBwB 1Model Nt with ARMA

Assume after seasonal differencing ts

t yBw 1 becomes stationary

Seasonal ARMA model

tQsq

sst

Psp

ss BBBwBBB *2*2

*1

*2*2

*1 11

ts

t NBw 1

Page 18: Time Series Building

18

Example

ARIMA model (p,d,q)x(P,D,Q) with period s

ts

tDsds BByBBBB ** 11

Page 19: Time Series Building

19

Monthly seasonality, s=12: -ACF values at lags 12, 24,36 are significant & slowly decreasing-PACF values: lag 12 significant value close to 1-Non-stationarity: slowly decreasing ACF

Remedy of non-stationarity: take first differences & seasonal differencing

-Eliminates seasonality-stationary

tt yBBw 1211

Sample ACF: significant value at lag 1Sample PACF : exponentially decaying values at the first 8 lagsUse non seasonal MA(1) model

Remaining seasonality: Sample ACF: significant value at lag 12Sample PACF : lags 12, 24,36 alternate in signUse seasonal MA(1) model

Example

Page 20: Time Series Building

20

Coefficient estimates: MA(1) & seasonal MA(1) significantSample ACF & PACF plots: still some significant valuesBox-Pierce statistic: most of the autocorrelation is out

ARIMA(0,1,1)x(0,1,1)12

Page 21: Time Series Building

21

ARIMA(0,1,1)x(0,1,1)12 : reasonable fit