Economics 430
Lecture 5 Characterizing Cycles Autoregressive Models
1
Today’s Class
• Cycles
• Autoregressive (AR) Models
– The AR(1) Process – The AR(2) Process – The AR(p) Process
• Chain Rule for Forecasting • R Example
2
Cycles 1 of 3
• Def: Cycle = Time series pattern of periodic fluctuations.
– Deterministic: Common in engineering, physical sciences, etc. Example: Yt = 2 cos(0.5t+0.8)+εt
– Stochastic: Common in economics, business, etc. Example: Yt = 0.5Yt-1 + 0.3Yt-2 +εt
3
Cycles 2 of 3
4 3 2 1 0
-1 -2 -3 -4
5 10 15 20 25 30 35 40
Deterministic
Yt = 2 cos(0.5t+0.8)+εt
Y=2cos(0.5 t +0.78) + e Y_determ=2cos(0.5 t +0.78)
Stochastic
Yt = 0.5Yt-1 + 0.3Yt-2 +εt
4
B A
D
Cycles 3 of 3
C
5
Autoregressive Models
• Def: AR(p) = Autoregressive process of order p≥0:Yt =c+φ1 Yt-1 +φ2Yt-2 +…+φqYt-p+εt, where , and φ = persistence parameter.
• Examples:
–AR(1): Yt =c+φ1 Yt-1 +εt
– AR(2): Yt = c +φ1 Yt-1 + φ2Yt-2+ εt – AR(6): Yt = c +φ6Yt-6+ εt
6
Autoregressive Models
For every AR(p) process, we need to address the following 3 questions:
1. WhatdoesatimeseriesofanARprocess look like?
2. WhatdothecorrespondingACFsandPACFs look like?
3. Whatistheoptimalforecast?
7
Autoregressive Models
Example: AR(1) Process
• (1) What does a time series of an AR process look like?
• Consider the following AR(1) process: Yt =c+φYt-1 +εt
• We can plot this process for c =1, and different values of φ, e.g., for φ=0.4, φ=0.7, φ=0.95, and φ=1.
• We can show that E(Yt)=c+φμ, and σ2(Yt) = σ2ε / (1-φ2) Note: Since E(Yt)=μ μ =c+φμ μ = c/(1-φ )
8
AR(1): Yt = c +φYt-1 + εt
3.5
3.0 φ=0.4 4.5
5.0
4.0 3.5 3.0 2.5 2.0 1.5
200 225 250 275 300 325 350 375 400 YY
23 400
2.5 2.0 1.5 1.0 0.5 0.0
φ=0.7
17 16 15
200 225 250 275 300 325 350 375 400
φ=0.95 360 φ=1 320
22
21
20
19 280 18
240 200 160
200 225 250 275 300 325 350 375 400 YY
200 225 250 275 300 325 350 375 400
9
Autoregressive Models
Example: AR(1) Process
• (2) What do the corresponding ACFs and PACFs look like?
• ACF:
– We would expect to see that ρ1 = p1 = φ, and all others
decay to zero according to ρk= φk.
• PACF:
– We would expect to see only 1 spike different from zero, i.e., p1 = φ, and all others equal to zero (pk=0, k>1).
10
Autocorrelation Functions of Simulated AR(1) Processes
φ = 0.4 Small persistence
faster decay to 0
For all three cases
φ = 0.95 Large persistence
slower decay to 0 11
φ = 0.7
Yt =c+φYt-1 +εt
Autoregressive Models
Example: AR(1) Process
• A useful Property for AR Processes:
A necessary and sufficient condition for an AR(1) process Yt = c +φYt-1 + εt to be covariance stationary is that |φ|<1.
12
12 10 8 6 4 2
Autoregressive Models
Example: AR(1) Process
01970 1975 1980 1985 1990 1995 2000
Q: Does this series look like an AR(1) process? A: Yes, since ρ1 = p1 = φ and ρk0 for k>1.
Personal Income Growth in CA
13
Autoregressive Models
Forecasting in an AR(1) Process
• Considerfirstthe1-step-aheadforecast,h=1: AR(1): Yt =c+φYt-1 +εt Yt+1 =c+φYt +εt+1
• Optimal Point Forecast: ft,1 = E(Yt+1|It) = c +φYt
• One-period-ahead Forecast Error: et,1 = Yt+1 – ft,1= εt+1
• Uncertainty of the Forecast: σ2t+1|t = var(Yt+1|It) = σ2ε
• Density Forecast: f(Yt+1|It) ~ N(c +φYt , σ2ε )
– Note: We can compute the confidence intervals from the density forecast.
Please go over the steps for h=1 and h=2 (Section 7.2a)
14
Autoregressive Models
Forecasting in an AR(1) Process
• Consider the k-step-ahead forecast, h = k for the AR(1): Yt = c +φYt-1 + εt process:
• Optimal Point Forecast: ft,k = E(Yt+k|It) = c(1+φ+…+φk-1) +φkYt
• k-period-ahead Forecast Error:
et,k = Yt+k – ft,k=εt+k+ φεt+k-1+…+ φk-1εt+1
• Uncertainty of the Forecast:
σ2t+k|t = var(Yt+k|It) = σ2ε(1+φ2+φ4+…+φ2(k-1))
• Density Forecast: f(Yt+k|It) ~ N(μt+k|t , σ2t+k|t )
– Note: We can compute the confidence intervals from the density forecast.
15
Autoregressive Models
Forecasting in an AR(1) Process
• Recallthatforcovariance-stationaryprocesses, |φ|<1 and φk 0 for large values of k (k∞). Therefore, the optimal forecast does not depend on the information set, and thus has a ‘short-term memory’.
ft,k = c(1+φ+φ2+...) = c/(1-φ)
σ2t+1|t = σ2ε(1+φ2+φ4+...) = = σ2ε /(1-φ2) 16
Autoregressive Models
Example: AR(2) Process
• Example: Yt = c +φ1 Yt-1 + φ2 Yt-2 +εt
• A useful Property for an AR(2) Process:
The necessary conditions for an AR(2) process to be covariance stationary are that -1<φ2<1 and -2<φ1<2,
and the sufficient conditions are that φ1+φ2<1 and φ2-φ1<1.
• Note: For an AR(2) the respective unconditional mean is given by:
17
520 500 480 460 440 420 400 380
Autoregressive Models
Example: AR(2) Process
Q: Is this process stationary?
A: No since φ1+φ2=1
Yt = 1 +0.5Yt-1 +0.5Yt-2 +εt
600 625
650 675 700 725 750
18
Autoregressive Models
Example: AR(2) Process
Yt =1+Yt−1−0.5Yt−2 +εt Yt =1−0.5Yt−1+0.4Yt−2 +εt Yt =1+0.5Yt−1+0.3Yt−2 +εt
All three AR(2) Processes have in common:
ρ1 = p1, p2 = φ2, and p1≠0 and p2≠0, all other pk =0 (k>2)
19
Autoregressive Models
Example: AR(2) Process
1913-2003 Inflation Rate
20 15 10
5
0 -5 -10 -15
Q: What model would you suggest? A: An AR(2) with φ = -0.25
20 30 40 50 60 70 80 90 00
Inflation (cpi growth)
20
Multistep Forecast of the U.S. Inflation Rate
h=1 2004
ˆˆ
f t , 1 = cˆ + φ 1 Y t + φ 2 Y t − 1 =
= 1.49 + 0.79 × 2.25 − 0.25 × 1.56 = ≈ 2.90
σ2 =σˆ2 =3.742 t+1|t ε
f(Y |I )→N(μ ,σ2 ) t+1 t t+1|t t+1|t
= N(2.90,3.742 )
h=2 2005
ˆˆ
f t , 2 = cˆ + φ 1 f t , 1 + φ 2 Y t =
= 1.49 + 0.79 × 2.90 − 0.25 × 2.25 = ≈ 3.25
ˆ
σ2 =σˆ2(1+φ 2)=
t+2|t ε 1
= 3.742 (1+ 0.792 ) = ≈ 4.812
f (Yt+2 | It ) → N(3.25,4.812 )
h=3 2006
ˆˆ
ft,3 =cˆ+φ1 ft,2 +φ2 ft,1 =
= 1.49 + 0.79 × 3.25 − 0.25 × 2.90 = ≈ 3.36
ˆ σ2 =σˆ2(1+φ2 +
t+3|t ˆˆ
ε 1 +(φ2 +φ12)2)=
≈ 5.032
f (Yt+3 | It ) → N(3.36,5.032 )
h=4 2007
ˆˆ
ft,4 =cˆ+φ1 ft,3 +φ2 ft,2 =
= 1.49 + 0.79 × 3.36 − 0.25 × 3.25 = ≈ 3.37
σ 2 ≈ 5.042 t+4|t
f (Yt+4 | It ) → N(3.37,5.042 )
h=5 2008
ˆˆ
ft,5 =cˆ+φ1 ft,4 +φ2 ft,3 =
= 1.49 + 0.79 × 3.37 − 0.25 × 3.36 = ≈ 3.34
σ 2 ≈ 5.042 t+5|t
f (Yt+5 | It ) → N(3.34,5.042 )
h=6 2009
ˆˆ
ft,6 =cˆ+φ1 ft,5 +φ2 ft,4 =
=1.49+0.79×3.34−0.25×3.37 = ≈ 3.32
σ 2 ≈ 5.042 t+6|t
f (Yt+6 | It ) → N(3.32,5.042 )
21
Autoregressive Models
Example: AR(2) Process
16 12 8 4 0 -4 -8
estimation sample
forecasting sample
multistep forecast
95 96 97 98 99 00 01 02 03 04 05 06 07 08 09
Actual data (CPI inflation)
Forecast
Upper bound, 95% confidence interval Lower bound, 95% confidence interval
22
• •
Autoregressive Models
AR(P) Process
In general, for an AR(p) process:
Yt = c +φ1Yt-1 +φ2Yt-1 +… +φpYt-p+ εt We can show that
– ρ1=p1,
– The speed of the ACF’s decay depends on the persistence
of φ1+φ2+… +φp
– p1≠0, p2≠0, …pp≠0, and pp=0 for k>p
23
Autoregressive Models
Forecasting in an AR(p) Process
• Consider the k-step-ahead forecast, h = k for the AR(p): Yt = c +φ1Yt-1 +φ2Yt-2 +… +φpYt-p+ εt process:
• OptimalPointForecast:
ft,k = E(Yt+k|It) = c+φ1ft,k-1+…+φpft,k-p
• k-period-ahead Forecast Error:
et,k = Yt+k – ft,k=εt+k+ φ1et,k-1+…+ φpet,k-p
• Uncertainty of the Forecast:
σ2t+1|t
• DensityForecast:f(Yt+k|It)~N(μt+k|t,σ2t+k|t)
24
Autoregressive Models
Forecasting in an AR(p) Process
• Chain Rule for Forecasting
Yt = c +φ1Yt-1 +φ2Yt-2 +… +φpYt-p+ εt
– Step1 (change tt+1): Compute ft,1 = Yt+1 ft,1 = c +φ1Yt +φ2Yt-1 +… +φpYt+1-p
– Step2 (repeat Step 1): Compute ft,2 ft,2 = c +φ1Yt+1 +φ2Yt +… +φpYt+2-p
= c + ft,1 + φ2Yt +… +φpYt+2-p …
ft,k = c+ ft,k-1 + φ2 ft,k-2 +… +φp ft,k-p
25
Moving Average Models
Example: AR(p) Process Q: What type of a process is this?
1900 1800 1700 1600 1500 1400 1300 1200 1100 1000
AR(4)
1990 1992 1994 1996 1998 2000 2002
Unemployed looking for part time work
In general, for any AR(p) process, pk = 0 for any k>p.
26
in thousands