Sie sind auf Seite 1von 31

Applied Quantitative Research Methods

Time series

4th March 2020

University of Bristol

1
Time Series

Dr Marion Prat

marion.prat@bristol.ac.uk

Office: 25-27 Belgrave Road, room 2.01

Advice and feedback hours:


Tuesday: 10:30-11:30 and Thursday 13:30-14:30

2
Timetable

5 Lectures: Wed 26th Feb/ Thur 27th Feb/ Mon 2nd March/ Wed
4th March/ Thur 5th March

2 Exercise lectures: Thur 12th March / Thur 19th March

2 Classes: Weeks starting 9th March and 16th March

Mock exam 2 (Easter break)

Revision lecture (TBA)

3
Time series
Times series in regression analysis:

1. Introduction to Time series data


2. Autocorrelation
3. Serial correlation in regression analysis
4. Trends in regression analysis

Forecasting:

5. Introduction to forecasting time series


6. Models for the trend [Diebold: Chapter 5.1-5.2]
7. Forecasting concepts [Diebold: Chapter 5.3-5.4]
8. Modeling seasonality [Diebold: Chapter 6]
9. Modeling cycles [Diebold: Chapters 7 & 8 (hard)]
10. Forecasting cycles [Diebold: Chapters 9 & 10.1-10.2 (hard)]
Textbook: Diebold, F.X., Elements of Forecasting, 4th Ed
4
8. Modeling seasonality

Full model (so far):


v
X s
X
Yt = B1 Tt + + γi EVit + Ci Dit + ut
i=1 i=1

where

Tt is a deterministic time trend (which may also be nonlinear)

Ds are seasonal dummies

EV s are holiday/event dummies. To include v different


holidays/events, we need to include v dummies.

5
8. Modeling seasonality
Example:
Monthly data on new housing starts in the US (thousands of units)

6
8. Modeling seasonality
Example: Monthly housing starts in the US (in thousands of units)
P12
HSt = B1 Timet + i=1 Ci Dit + ut

Dataset

date HS Time D1 D2 D3 D4 ...


Jan-1959 96.2 1 1 0 0 0 ...
Feb-1959 99 2 0 1 0 0 ...
Mar-1959 127.7 3 0 0 1 0 ...
Apr-1959 150.8 4 0 0 0 1 ...
May-1959 152.5 5 0 0 0 0 ...
... ... ... ... ... ... ... ...
7
8. Modeling seasonality
Example: Monthly housing starts in the US (in thousands of units)
HSt = B1 Timet + 12
P
i=1 Ci Dit + ut
Coef se p-value
Time -.0520 .006 0.000
D1 104.951 4.565 0.000
D2 107.865 4.583 0.000
D3 137.177 4.585 0.000
D4 153.366 4.588 0.000
D5 158.653 4.590 0.000
D6 157.668 4.595 0.000
D7 151.983 4.598 0.000
D8 149.924 4.597 0.000
D9 143.337 4.600 0.000
D10 147.421 4.603 0.000
D11 126.335 4.605 0.000
D12 109.953 4.608 0.000
Estimation results (OLS)
8
8. Modeling seasonality
Example: Monthly housing starts in the US (in thousands of units)

Coef se p-value
Time -.0520 .006 0.000
D1 104.951 4.565 0.000
D2 107.865 4.583 0.000
D3 137.177 4.585 0.000
D4 153.366 4.588 0.000

Time trend: Over the sample period, there were on average 50 fewer
housing starts each month.
January dummy: on average there were 104 951 new housing starts
in January.
April dummy: on average there were 153 366 new housing starts in
May. On average there were 48 415 more new housing starts in April
compared to January.
9
8. Modeling seasonality
Assumption 1: The error term ut is a non-autocorrelated
(cov (ut , ut−j ) = 0) zero-mean series with constant variance (σ 2 )

A white noise series

Assumption 2: ut is normally distributed.


10
8. Modeling seasonality
Example: Monthly housing starts in the US (in thousands of units)
P12
et = HSt − b1 Timet − i=1 ci Dit

Residual plot

Does the residual plot look like a white noise process?


11
9. Modeling cycles

Next, we are going to:

Define cycles

Discuss methods for characterizing / describing cycles

Discuss how we can test whether a time series is white noise

Present a class of models for the cycle: AR(p) processes

12
9. Modeling cycles
Example: Monthly housing starts in the US (in thousands of units)

Residual plot

A cycle corresponds to any sort of dynamics not captured by trends


and seasonality. The present is linked to the past and the future to
the present.
Autocorrelated series exhibit cycles. 13
9. Modeling cycles
Example: Monthly housing starts in the US (in thousands of units)

Residual plot

Booms and recessions


Shocks: oil price shock, natural disaster, terrorist attack,...
14
9. Modeling cycles

White noise processes:


Do not exhibit cycles.
Are key building blocks of more complex time series processes.
Characterise one-step-ahead forecast errors in optimal forecasting
models.
15
9. Modeling cycles

Series exhibiting trends and seasonal patterns are not stationary:

The mean of an upward trending trend is increasing over time.

Seasonality implies that the mean is different across seasons.

The cyclical component is what remains after we have detrended and


deseasonalised the time series.

Assumption 3: The cyclical component is stationary

16
9. Modeling cycles
Characterizing cycles: Autocorrelation Function (ACF)
Example: Monthly housing starts in the US (in thousands of units)

residual plot Residual sample ACF

17
9. Modeling cycles
Characterizing cycles: Autocorrelation Function (ACF)

Residual sample ACF

Test of significance (5% sig. level):


H0 : ρj = 0 vs H0 : ρj 6= 0
The 2-standard-error bands (dashed lines) are calculated as ± √2
(T )

If the ρj = 0, then ρˆj should fall within this interval 95% of the time.
Reject H0 when ρˆj lies outside 2-standard-error bands 18
9. Modeling cycles
Characterizing cycles: Partial Autocorrelation Function (PACF)

The 1st partial autocorrelation coefficient is the coefficient B1 in the


population regression:
Yt = B0 + B1 Yt−1 + ut

The 2nd partial autocorrelation coefficient is the coefficient B2 in the


population regression:
Yt = B0 + B1 Yt−1 + B2 Yt−2 + ut
The jth partial autocorrelation coefficient is the coefficient Bj in the
population regression:
Yt = B0 + B1 Yt−1 + B2 Yt−2 + ... + Bj Yt−j + ut

The partial autocorrelations measure the association between Yt and Yt−j ,


controlling for the effects of Yt−1 ,Yt−2 ,...,Yt−j+1
19
9. Modeling cycles
Characterizing cycles: Partial Autocorrelation Function (PACF)

To obtain an estimate bj of the partial autocorrelation coefficient Bj using


sample data:
Ŷt = b0 + b1 Yt−1 + b2 Yt−2 + ... + bj Yt−j

Residual sample PACF


20
9. Modeling cycles
Characterizing cycles: Partial Autocorrelation Function (PACF)

Residual sample PACF

Test of significance (5% sig. level):


H0 : bj = 0 vs H0 : bj 6= 0
The 2-standard-error bands (dashed lines) are calculated as ± √2
(T )

If the bj = 0, then ρˆj should fall within this interval 95% of the time.
Reject H0 when bˆj lies outside 2-standard-error bands 21
9. Modeling cycles
Autocorrelation and Partial Autocorrelation Functions (ACF and PACF)

Definition: A white noise process is a non-autocorrelated


(cov (ut , ut−j ) = 0) zero-mean series with constant variance (σ 2 )

A white noise series


22
9. Modeling cycles
Autocorrelation and Partial Autocorrelation Functions (ACF and PACF)

Because a white noise process is not autocorrelated:


Autocorrelation function: ρj = 0 for all j > 1
Partial autocorrelation function: bj = 0 for all j > 1

ACF PACF

Autocorrelation and partial autocorrelation functions of a white noise series

23
9. Modeling cycles

Testing whether a time series is white noise

We need to test whether all the autocorrelation coefficients are jointly zero:

H0 : ρ1 = ρ2 = ... = ρj = 0 [white noise]


HA : at least one ρj 6= 0 [not a white noise]

Pm  1

Construct (Ljung-Box) Q-statistic: QLB = T (T + 2) j=1 T −j ρ̂2j

Under H0 , QLB follows a χ2m distribution.

Reject H0 when p-value lower than significance level.

24
9. Modeling cycles
Testing whether a time series is white noise

Residual Q-statistic and p-value

Lag Q-stat p-value


1 635.92 0.000
2 1228.5 0.000
3 1780.3 0.000
4 2291 0.000
5 2774.8 0.000
...
12 5554.1 0.000

Reject H0 : ρ1 = ρ2 = ... = ρj = 0 for j=1,2,3,4,5,12 at the 1%


significance level (p − value = 0.000 < 0.01).
Strong evidence that the housing starts residual series is not white
noise.
→ We need a model for the residual series.
25
9. Modeling cycles

v
X s
X
Yt = B1 Tt + + γi EVit + Ci Dit + ut
i=1 i=1

A First-order Autoregressive process, AR(1) is defined as:

ut = B0 + B1 ut−1 + t

t is a white noise process


A Second-order Autoregressive process, AR(2) is defined as:

ut = B0 + B1 ut−1 + +B2 ut−2 + t

t is a white noise process

26
9. Modeling cycles
Example: First-order Autoregressive process AR(1)

ut = 0.95ut−1 + t

Autocorrelation function Partial autocorrelation function

27
9. Modeling cycles
Example: Second-order Autoregressive process AR(2)

ut = 0.5ut−1 + 0.2ut−2 + t

Autocorrelation function Partial autocorrelation function

28
9. Modeling cycles

Similarly we can define AR processes of higher orders.

A pth-order autoregressive process, AR(p) is defined as:

Yt = B0 + B1 Yt−1 + B2 Yt−2 + ... + Bp Yt−p + t


t is a white noise process

29
9. Modeling cycles
Example: Monthly housing starts in the US (in thousands of units)

How to determine the order the AR process?

Approach 1: inspect the Partial autocorrelation function (PACF)

Housing starts residuals

→ AR(2) might fit the series best


30
9. Modeling cycles

Example: Monthly housing starts in the US (in thousands of units)

How to determine the order the AR process?

Approach 2: Choose the model that minimizes the AIC/SIC criteria

AR(0) AR(1) AR(2) AR(3) AR(4) AR(5) AR(6) AR(7)


AIC 7061.3 5544.4 5514.0 5514.4 5516.3 5514.3 5515.7 5517.0
SIC 7125.4 5613.1 5587.3 5592.3 5598.7 5601.3 5607.3 5613.2

Selected model:
12
X
HSt = B1 Timet + Ci Dit + ut
i=1

ut = A1 ut−1 + A1 ut−2 + t

31

Das könnte Ihnen auch gefallen