Introduction To Time Series Regression and Forecasting: (SW Chapter 14)
Introduction To Time Series Regression and Forecasting: (SW Chapter 14)
Introduction To Time Series Regression and Forecasting: (SW Chapter 14)
and Forecasting
(SW Chapter 14)
14-1
Example #1 of time series data: US rate of price inflation, as
measured by the quarterly percentage change in the
Consumer Price Index (CPI), at an annual rate
14-2
Example #2: US rate of unemployment
14-3
Why use time series data?
14-4
Time series data raises new technical issues
Time lags
Correlation over time (serial correlation, a.k.a.
autocorrelation)
Forecasting models built on regression methods:
o autoregressive (AR) models
o autoregressive distributed lag (ADL) models
o need not (typically do not) have a causal interpretation
Conditions under which dynamic effects can be estimated,
and how to estimate them
Calculation of standard errors when the errors are serially
correlated
14-5
Using Regression Models for Forecasting
(SW Section 14.1)
For forecasting,
o R 2 matters (a lot!)
o Omitted variable bias isn’t a problem!
o We will not worry about interpreting coefficients in
forecasting models
o External validity is paramount: the model estimated
using historical data must hold into the (near) future
14-6
Introduction to Time Series Data
and Serial Correlation
(SW Section 14.2)
14-8
Example: Quarterly rate of inflation at an annual rate (U.S.)
CPI = Consumer Price Index (Bureau of Labor Statistics)
CPI in the first quarter of 2004 (2004:I) = 186.57
CPI in the second quarter of 2004 (2004:II) = 188.60
Percentage change in CPI, 2004:I to 2004:II
188.60 186.57 2.03
= 100 = 100 = 1.088%
186.57 186.57
Percentage change in CPI, 2004:I to 2004:II, at an annual
rate = 4´1.088 = 4.359% 4.4% (percent per year)
Like interest rates, inflation rates are (as a matter of
convention) reported at an annual rate.
Using the logarithmic approximation to percent changes
yields 4´100´[log(188.60) – log(186.57)] = 4.329%
14-9
Example: US CPI inflation – its first lag and its change
14-10
Autocorrelation
14-11
14-12
Sample autocorrelations
The jth sample autocorrelation is an estimate of the jth
population autocorrelation:
Y ,Y )
cov( t j
ˆ j = t
Y)
var( t
where
1 T
Y ,Y ) =
cov( t t j
T t j 1
(Yt Y j 1,T )(Yt j Y1,T j )
14-13
Example: Autocorrelations of:
(1) the quarterly rate of U.S. inflation
(2) the quarter-to-quarter change in the quarterly rate of
inflation
14-14
The inflation rate is highly serially correlated (1 = .84)
Last quarter’s inflation rate contains much information
about this quarter’s inflation rate
The plot is dominated by multiyear swings
But there are still surprise movements!
14-15
Other economic time series:
14-16
Other economic time series, ctd:
14-17
Stationarity: a key requirement for external validity of
time series regression
14-19
The First Order Autoregressive (AR(1)) Model
Yt = 0 + 1Yt–1 + ut
14-20
Example: AR(1) model of the change in inflation
(0.126) (0.096)
14-21
Example: AR(1) model of inflation – STATA
First, let STATA know you are using time series data
14-22
Example: AR(1) model of inflation – STATA, ctd.
. gen lcpi = log(cpi); variable cpi is already in memory
This creates a new variable, inf, the “nth” observation of which is 400
times the difference between the nth observation on lcpi and the “n-1”th
observation on lcpi, that is, the first difference of lcpi
14-23
Example: AR(1) model of inflation – STATA, ctd
------------------------------------------------------------------------------
| Robust
dinf | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dinf |
L1. | -.2380348 .0965034 -2.47 0.015 -.4285342 -.0475354
_cons | .0171013 .1268831 0.13 0.893 -.2333681 .2675707
------------------------------------------------------------------------------
14-24
Forecasts: terminology and notation
Predicted values are “in-sample” (the usual definition)
Forecasts are “out-of-sample” – in the future
Notation:
o YT+1|T = forecast of YT+1 based on YT,YT–1,…, using the
population (true unknown) coefficients
o Yˆ
T 1|T= forecast of YT+1 based on YT,YT–1,…, using the
estimated coefficients, which are estimated using data
through period T.
o For an AR(1):
YT+1|T = 0 + 1YT
YˆT 1|T = ˆ0 + ˆ1 YT, where ˆ0 and ˆ1 are estimated
using data through period T.
14-25
Forecast errors
14-26
Example: forecasting inflation using an AR(1)
so
Inf
= Inf2004:IV +
Inf 2005:I |2000: IV 2005:I |2000:IV = 3.5 – 0.4 = 3.1%
14-27
The AR(p) model: using multiple lags for forecasting