0% found this document useful (0 votes)
19 views29 pages

MFIN 514 Mod 4

1) Time series data are observations collected over multiple time periods on the same observational unit. 2) Stationarity and autocorrelation are important concepts for time series data as they can distort models if not accounted for. 3) A common goal with time series data is forecasting future values using historical data, though past performance does not necessarily predict future results.

Uploaded by

Liam Fraleigh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views29 pages

MFIN 514 Mod 4

1) Time series data are observations collected over multiple time periods on the same observational unit. 2) Stationarity and autocorrelation are important concepts for time series data as they can distort models if not accounted for. 3) A common goal with time series data is forecasting future values using historical data, though past performance does not necessarily predict future results.

Uploaded by

Liam Fraleigh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

MFIN 514:

Time Series

Dr. Ryan Ratcliff

SCHOOL OF BUSINESS
Time Series Data: What’s Different?
Time series data are data collected on the same observational
unit at multiple time periods.
Stationarity: Does
the ave. yield
measure “central
tendency” here?

Autocorrelation:
Serial correlation
distorts OLS, but is
everywhere in time
series data.

SCHOOL OF BUSINESS
Time Series Data: Forecasting
A common goal w/ time series data is forecasting: fitting a
model to historical data, then using it to predict the future

Statistical forecasting
assumes the future
is like the past, but

“Past performance
does not necessarily
predict future
results.”

SCHOOL OF BUSINESS
Time Series Data: Forecasting
Recall our basic strategy with regression was we wanted a
model where errors were unbiased (on average zero) and
minimum variance.

In the forecasting context, we want to add unforecastable


errors. Intuitively, if you can predict you’re going to make a
forecast error, revise your forecast.

More specifically, think Eff. Mkts. Hypothesis: the


error/surprise in tomorrow’s stock price shouldn’t be
predictable based on what you know today.

SCHOOL OF BUSINESS
Notation: Lags

Yt = SP5002015Q4 = 2100, Yt-1 = SP5002015Q3 = 1900


ΔYt = Yt - Yt-1 = 2100 – 1900 = 200
dlog(Yt) = ln(2100) – ln(1900) = 0.10 = 10% (dlog is a growth rate)

SCHOOL OF BUSINESS
Autocorrelation

SCHOOL OF BUSINESS
Autocorrelation Function
If we calculate AC(1) = Corr(Yt , Yt-1 ), AC(2) = Corr(Yt , Yt-2 ) …
AC(h) = Corr(Yt , Yt-h ), we can assemble a table of the
autocorrelations.
SE = 1
n
Lag Autocorrelation SE t-stat
1 0.1884 0.1414 1.3324
2 0.3363 0.1414 2.3784
3 –0.1218 0.1414 –0.8614
4 –0.0285 0.1414 –0.2016

Since 1 n = 0.1414 → n = 50

SCHOOL OF BUSINESS
Stationarity: Trend Models
A simple approach to modeling a
growing, nonstationary series is to
17,000,000 model “average change.”
16,000,000
An easy way to do that with
15,000,000 regression is to fit a single line
through the series.
14,000,000

13,000,000 Specifically, we include a “time


trend” as our X variable: t = 0 for
12,000,000 the first observation, and increases
by 1 each period.
11,000,000
90 92 94 96 98 00 02 04 06 08 10 12 14

NFPE_CA NFPE_CAF Intuitively, what’s the slope mean?

SCHOOL OF BUSINESS
Stationarity: Trend Models
NFPE = 12.30 mill + 11497.70t + et
17,000,000

16,000,000

15,000,000

14,000,000

13,000,000

12,000,000

11,000,000
90 92 94 96 98 00 02 04 06 08 10 12 14

NFPE_CA NFPE_CAF

Usual regression tools (significance, R2, predicted values,


etc.) all apply here – but notice that these forecast errors
are almost certainly autocorrelated (graph, low DW stat).

SCHOOL OF BUSINESS
Trend Models: Forecasting
NFPE = 12.30 mill +
11497.70t + R1t

• If NFPEJul14 = 15,524,100 what


does our model forecast for
NFPEMay15?

• Your initial instinct might be


E(Xt+h)= Xt + bh

15.5241m + 11497.70 x 10
months = 15.639 million

But that’s not what this


model predicts…

SCHOOL OF BUSINESS
Trend Models: Forecasting
NFPE = 12.30 mill + 11497.70t + et
17,000,000

• Our model’s actual forecast is


16,000,000
E(Xt+h)= a + b(t+h)
15,000,000

14,000,000 12.30m + 11497.7 x 304 =


13,000,000
E(CA_NFPEMay15) = 15.7 m

• This model completely ignores


12,000,000

11,000,000 the current value of the series –


90 92 94 96 98 00 02 04 06 08 10 12 14
it’s totally deterministic. If we’re
NFPE_CA NFPE_CAF below trend today, our forecast is
exactly on trend tomorrow…

SCHOOL OF BUSINESS
Stationarity: Trend Models
Linear trend is a bad fit for many econ/finance series.
A “log-linear” trend is a better fit for exp. growth.
DJIA DJIA (log scale)
14,000 100,000

12,000
10,000

10,000

1,000
8,000

6,000
100

4,000

10
2,000

- 1
28
34
40

46
52
57
63
69
75

81
86

92
98
04

28

34

40

46

52

57

63

69

75

81

86

92

98

04
19
19
19

19
19
19
19
19
19

19
19

19
19
20

19

19

19

19

19

19

19

19

19

19

19

19

19

20
SCHOOL OF BUSINESS
Stationarity: Log-Linear Trend
10

1.5
4
1.0
2
0.5

0.0

-0.5

-1.0
20 30 40 50 60 70 80 90 00

Residual Actual Fitted

In month t=1000, ln(Y) = 4.039 + 0.004645*(1000) = 8.684


Predicted Y = exp(8.684) = 5908 (underpredicts)

0.004645 * 12 = 5.57% ave. annual growth (cont. compounded)

SCHOOL OF BUSINESS
Serial Correlation in Trend Models
• Obvious that these errors
10
are serially correlated/
8
predictable.
6

1.5
4 • CFA thinks this makes
1.0
2 trend models worthless.
0.5

0.0

-0.5 • Really, it just means we


-1.0 need to also model the
20 30 40 50 60 70 80 90 00
predictable part of these
Residual Actual Fitted residuals. More on this
in a bit…

SCHOOL OF BUSINESS
Autoregression (AR)
Main idea: The dependent variable is regressed on prior value(s) of
itself
Simplest form: AR(1) model:
x t = b0 + b1x t–1 +  t
Or more generally, AR(p) model:
x t = b0 + b1x t–1 + b2 x t–2 + ... + bp x t–p +  t
X needs to be “Covariance Stationary”: mean, variance,
autocorrelations stable across time. In particular, careful using AR
models on data with even a hint of a trend (see “Unit Root”
discussion later)

SCHOOL OF BUSINESS
AR: Mean Reversion
x t = b0 + b1x t–1 +  t Say, Xt = 10 + 0.5Xt-1 + et
Unforecastable errors → Prediction Et(Xt+1) = 10 + 0.5Xt
So if X5 = 16: E5(X6) = 10 + 0.5(16) = 18
E5(X7) = 10 + 0.5(18) = 19
E5(X8) = 10 +0.5(19) = 19.5, etc.
Forecasts converge to b0 / (1-b1) = 20. We call this mean reversion.
b1 = 0.5 predicts half of the deviation from the mean lives on to
next period. Or, fraction (1- b1) of that deviation goes away each
period. Bigger values of b1 imply slower mean reversion.

SCHOOL OF BUSINESS
AR: Estimate, Check ACF, Re-esimate
AC SE T
1 -0.287 0.038 -7.51
2 -0.002 0.038 -0.05
3 0.062 0.038 1.622
4 0.077 0.038 2.014
5 0.029 0.038 0.758
6 0.057 0.038 1.491
7 0.023 0.038 0.602
8 -0.022 0.038 -0.58
9 0.096 0.038 2.511
Estimate AR(1) via OLS 10 -0.045 0.038 -1.18

Check if residuals have significant Common Sucker Question:


autocorrelation. If so, add one DON’T use Durbin-Watson
more AR lag. Rinse and Repeat… with AR model!

SCHOOL OF BUSINESS
AR: Estimate, Check ACF, Re-esimate
AC SE T
1 -0.01 0.038 -0.21
2 -0.01 0.038 -0.34
3 -0.01 0.038 -0.13
4 0.009 0.038 0.235
5 0.03 0.038 0.785
6 0.096 0.038 2.511
7 0.024 0.038 0.628
8 -0.02 0.038 -0.52
This is CFA’s simplified version 9 0.054 0.038 1.412
of a more complicated story. 10 -0.06 0.038 -1.44

Know how they say it works…


but recognize their method
seldom works in practice.

SCHOOL OF BUSINESS
AR Models and Seasonality
• Time Series often show a recurring
seasonal “sawtooth” pattern, like a
surge in hiring in Nov/Dec every year.
17,000,000

16,000,000

15,000,000
• This shows up as significant
autocorrelation at lag 4 (Qtrly), lag 12
14,000,000
(Monthly), etc.
13,000,000

12,000,000

• Including NFPE(-12) can model the


11,000,000
90 92 94 96 98 00 02 04 06 08 10 12 14 seasonality, and will remove AC fr.
NFPE_CA NFPE_CAF seasonality.

• When you see higher, nonsequential AR


terms = modeling seasonality

SCHOOL OF BUSINESS
Random Walk

80
• AR(1) model with b0=0, b1=1

60
Yt+1 = Yt +vt+1

40
• Next period’s value is today’s
value, plus an unpredictable
20 shock.

0 • This series isn’t stationary,


and doesn’t revert to any
value since b0/(1-b1) = ???
-20
25 50 75 100 125 150 175 200 225 250

SCHOOL OF BUSINESS
Random Walk with Drift
• We can tweak our model a bit to
allow for a RW that generally
250 rises/falls over time:

200
Yt+1 = δ + Yt +vt+1
150
• At first glance, this looks like we
100
would fit a linear time trend to this
series.
50
• However, the forecast here is a
0 constant growth from the current
value.
-50
25 50 75 100 125 150 175 200 225 250 • This is a common expression of
the Efficient Markets Hypothesis:
some small predictable increases,
but mostly unpredictable.

SCHOOL OF BUSINESS
Trend + AR vs. RW w/ Drift
Real GDP Forecasts from 1982Q4
Real GDP Forecasts from 1982Q4 • CFA doesn’t ask about this,
7,500 but I want you to see it.

7,000 • A popular modeling strategy


is to make an AR model of
the residuals from a trend.
6,500

• Since the residuals would be


6,000 mean reverting, this is a
model of “reverting to
trend.”
5,500

• In contrast, RW w/ Drift
5,000 doesn’t revert to trend.
80 81 82 83 84 85 86 87 88 89 90

Forecast: RW w/ Drift
Time Trend
Forecast: Trend Reverting

SCHOOL OF BUSINESS
Unit Root Problem
• AR(1) model with b1 “close to 1” will make us worry that
maybe the data is a random walk -- hard to reject H0: b1 =
1 when estimate is 0.98…

• Unit Root tests let us test the null hypothesis that the data
is a random walk, vs. alternative that it’s AR with b1 < 1.

• Another “Name Drop.” Know that the Dickey-Fuller test


has the null that the data is a random walk. I haven’t seen
the actual test in sample Qs…

• Most sample questions show you AR model with b1 = 1 and


want you to ID that as a unit root.

SCHOOL OF BUSINESS
Unit Root Fix
• For RW or RW with drift, transforming to model the difference
of the data makes the model stationary.

Xt = b0 + Xt-1 + et
(Xt – Xt-1) = b0 + et

• Notice the new model says that the forecast of the change in
X is a constant – same idea as RW w/ Drift, but stationary.

• Extensions not on the exam:


➢ Unit root in AR(p)? Model difference as AR(p-1).
➢ dlog also solves the problem, modeling average growth in
stead of average change.

SCHOOL OF BUSINESS
Non-Constant Volatility
DLOG(SP500)
• The “width” of the plot of daily returns
.12
offers some evidence that volatility isn’t
.08
constant: some periods seem to vary in
.04
wider ranges than others.
.00

-.04

-.08 • Recalling that the std. dev. is the average


-.12 of the squared residuals from our model,
-.16 we can look at the squared residuals for
-.20 each period as another way to see time-
-.24 varying volatility.
55 60 65 70 75 80 85 90 95 00 05
(DLOG(SP500)-@MEAN(DLOG(SP500),"1/03/1950 11/09/2009"))^2
.06
• We see ”clusters”: if today had a big
.05
(r-b0)2 squared deviation, tomorrow does, too.
.04

.03
• The idea of clustering leads naturally to
an autoregressive model of volatility:
.02
ARCH (Autoregressive Conditional
.01 Heteroskedasticity)
.00
55 60 65 70 75 80 85 90 95 00 05

SCHOOL OF BUSINESS
ARCH Models
x t = b0 + b1x t–1 +  t • The basic idea is that we build an AR
model of the squared residuals from
some other model.

εˆ 2t = a0 + a1εˆ 2t–1 + t • This model captures volatility


clustering: a big residual today
makes us revise up our estimate of
the conditional variance, which leads
to a bigger residuals tomorrow.

• Key Idea: we’re forecasting variance

• Even if the WN shocks are normal,


the volatility clustering will cause
excess kurtosis in the residuals. If
the volatility tends to be higher in
bad periods (see table), this model
can also generate negative skew.

SCHOOL OF BUSINESS
Out-of-Sample Forecast Validation
• Since we care about forecasting, our primary measure of a good
model is the “out-of-sample” prediction – we simulate a forecast.

• For example, say we have DJIA monthly through 2009. We’ll


estimate some models of DJIA using most of the data: 1920 – 2006.
This is the “in-sample” period.

• Based on the estimates, we’ll make “out-of-sample” (OOS) forecasts


for 2007 – 2009, and compare those to what actually happened.

• Specifically, we’ll calculate the OOS forecast errors, square each one,
and take the average: Mean Sq. Error. Typically, we then take
square root to get RMSE (same def’n from Mod 2-3)

• The “best” time series model is the one with the lowest OOS
RMSE.

SCHOOL OF BUSINESS
OOS Forecast Errors
• Here’s a table that gives the RMSE
for a linear and quadratic trend
model of DJIA. Remember DJIA was
our example for log-lin, so a trend
with no curve will stink.

• Not surprisingly, the quadratic


modelhas a lower OOS RMSE. Recall
trend model forecast don’t start from
the last in-sample obs…
14,000

13,000

12,000

11,000

10,000

9,000

8,000

7,000

6,000

5,000
00 01 02 03 04 05 06 07 08 09

DJIA.US LINF
LOGF QUADF

SCHOOL OF BUSINESS
Keys to the Exam: Time Series

• Autocorrelation
• Linear / Log-Linear Trends
• AR models
• Covariance stationarity,
random walks, unit roots
• ARCH basics
• Forecasting using time
series models

SCHOOL OF BUSINESS

You might also like