Anda di halaman 1dari 37

Review

• Assembling classical decomposition:


– Determine the trend and seasonal component
– Determine an ARMA specification for the ‘residual’ (ie, cycle)
– Check the model adequacy by examining the ARMA residuals
– Use the full model to make forecasts
• Dealing with variables in logarithms
– If 𝑋 ~ 𝒩(𝜇, 𝜎 2 ), then the mean of 𝑌 = exp(𝑋) is given as:

𝔼 𝑌 = 𝔼 exp 𝑋 = exp(𝜇 + 12𝜎2 )

1
Review
• Checking model stability:
– Recursive parameter estimates – do the parameters change much as
the time series sample grows?
– Recursive residuals – if the model is stable then the standardised
recursive residuals should be ~ 𝑖𝑖𝑖𝒩(0,1)
– CUMSUM test – cumulative sum of standardised recursive residuals.
Reject null of correct model specification and parameter stability if
CUMSUM goes outside the probability bands.

2
Review Questions
• When putting trend, seasonality and cycle together, how do
you express the full model?
• How do you forecast the full model (conceptually and
computationally)?
• Suppose that we estimated a linear model for ln(𝑦𝑡 ). How do
you forecast 𝑦𝑡 ?
• What are recursive estimates? Recursive residuals? CUMSUM
test? What are their purpose?

3
PS1 : Question 1, pp. 214
Using ‘liquor.dat’, 1967M1 to 1998M12
Estimate the quadratic trend model for log liquor sales with
seasonal dummies and three lags of the dependent variable
included directly.
Discuss your results and compare them with those we obtained
when we instead allowed for AR(3) disturbances in the
regression.

4
PS1 : Answers

5
PS1 : Answers
Equation 1 – AR cycle Equation 2 – Lags of Log Sales

6
PS1 : Answers
Although the OLS coefficients differ from the NNLS coefficients,
we claim that the two approaches are identical in terms of fitting
the data. This can be seen by comparing the log-likelihood, R-
squared, SSR, SIC and the AR coefficients.
The differences in other coefficients are caused by the AR
dynamics. The model with the AR(3) disturbances (cycle), which
is eqn(1), may be written as:
12
𝑦𝑡 = 𝛽1 𝑡 + 𝛽2 𝑡 2 + � 𝛾𝑖 𝐷𝑖𝑖 + 𝑥𝑡
𝑖=1
Φ 𝐿 𝑥𝑡 = 𝜀𝑡
𝜀𝑡 ~𝑊𝑊 0, 𝜎 2

7
PS1 : Answers
Where Φ 𝐿 = 1 − 𝜙1 𝐿 − 𝜙2 𝐿2 − 𝜙3 𝐿3 . Applying the AR
polynomial to 𝑦𝑡 gives:
12
Φ 𝐿 𝑦𝑡 = 𝛽1 Φ 𝐿 𝑡 + 𝛽2 Φ 𝐿 𝑡 2 + � 𝛾𝑖 Φ 𝐿 𝐷𝑖𝑖 + 𝜀𝑡
𝑖=1
Which is in the form of eqn(2).

Note that 𝛽1 Φ 𝐿 𝑡 + 𝛽2 Φ 𝐿 𝑡 2 is still a quadratic trend and


∑12
𝑖=1 𝛾𝑖 Φ 𝐿 𝐷𝑖𝑖 still represents the seasonality. But the
coefficients of the trend and monthly dummies differ from those
in eqn(1) and the difference is caused by the AR polynomial
Φ 𝐿 .

8
PS2 : Question 2 (a) & (c), pp 214
Critique the liquor sales forecasting model that we adopted (log
liquor sales with quadratic trend, seasonal dummies, and AR(3)
disturbances).
(a) If the trend is not a good approximation to the actual trend
series, would it greatly affect short-run forecasts? Long-run
forecasts?
(c) How might you fit and assess the adequacy of a broken linear
trend? How might you decide on the location of the break point?

9
PS2 : Answers
The model approximates the actual trend in the data as a
quadratic function of time. This is certainly not desirable for
long-run forecasting. For instance, the estimated coefficient on
𝑡 2 is negative, implying that the long-run sales forecasts will
eventually be negative. (see P4 & P5 for examples)

10
PS2 : Answers
(a) If the trend is not a good approximation of the actual trend in
the series, the long-run forecasts will be affected to a much
greater extent than short-run forecasts.

11
PS2 : Answers
(c) Broken linear trend is based on the idea that the slope of the
(linear) trend changes at a number of points in time (ie, using a
linear trend to approximate the actual trend for a short period of
time).
It can be implemented by including appropriate dummy
variables, 𝛽1 𝑡 + 𝛿1 𝑡𝐷𝑡 (𝑇𝑏 ), where the dummy 𝐷𝑡 (𝑇𝑏 ) is zero for
𝑡 ≤ 𝑇𝑏 and one for 𝑡 > 𝑇𝑏 .
Here the breakpoint 𝑇𝑏 may be selected based on prior
knowledge or by minimising the SSR (ie, Chow test). The broken
linear trend model could be compared to other trend models
using the usual criteria (ie, AIC or SIC).

12
PS3 : Question 4 pp. 215
Using ‘hstarts.dat’ 1946M1 to 1994M11
Consider the housing starts forecasting model that we built in
Chapter 6.
(a) Perform a CUMSUM analysis of a housing starts forecasting
model that does not account for cycles. (Recall that our model in
Chapter 6 did not account for cycles). Discuss your results.

(b) Specify and estimate a model that does account for cycles.

(c) Do a CUMSUM analysis of the model that accounts for cycles.


Discuss your results and compare them with those of part (a).

13
PS3 : Answers
(a)

14
PS3 : Answers
(a)

15
PS3 : Answers
(a)

16
PS3 : Answers
(a) The series only contains seasonal and cyclical components
(see Ch.6). As the CUMSUM goes outside the 5% bands, the
hypothesis of correct model specification and parameter stability
is rejected.
In this case, however, because the model is mis-specified (ie,
without the cycle component), the rejection is really about the
model specification rather than parameter stability.

17
PS3 : Answers
(b)

18
PS3 : Answers
(b) The correlogram of the residual series from the model in (a)
indicate that an AR(2) model for the cycle component appears
adequate, which can be implemented by including the first 2 lags
of the dependent variable in the regression (see next question).

19
PS3 : Answers
(c)

20
PS3 : Answers
(c)

21
PS3 : Answers
(c) The CUMSUM test on the model in (b) does not reject the
hypothesis of correct model specification and parameter
stability, as we have now taken into account the cycle
component in the series.

22
PS4 & 5 : Question 10 pp. 217
Using our unobserved-components perspective, we’ve discussed
trends, seasonality, cycles, and noise. Clearly we can’t model or
forecast the noise; by construction, it is unforecastable. Instead,
the noise is what remains after accounting for the other
components.
We call the other components signals and the signals are buried
in the noise. Good models fit signals, not noise. Data-mining
expeditions, in contrast, lead to models that often fit very well
over this historical sample but that fail miserably for out-of-
sample forecasting.
That is because such data mining effectively tailors the model to
fit the idiosyncrasies of the in-sample noise, which improves the
in-sample fit but is of no help in out-of-sample forecasting
23
PS4 : Question 10 pp. 217
Using ‘yen.dat’ 1986M1 to 1994M4
(a) Graph the series

(b) Regress the first 20 observations on a 5th-order polynomial


time trend, and allow for 5 AR lags as well. Graph the actual and
fitted values from the regression. Discuss.

(c) Use your estimated model to produce an 80-step-ahead


extrapolation forecast. Graphically compare your forecast with
the actual realisation. Discuss.

24
PS4 : Answers
(a)

25
PS4 : Answers
(b)

26
PS4 : Answers
(b)

27
PS4 : Answers
(b) The in-sample fit of the model appears good in the residual
plot, because of the high order trend and high-order AR
specification for the cycle component.
While the model fits very well for the first 20 observations in
terms of R-squared and visual impression; using only 20
observations to estimate the model with 11 parameters is over-
fitting (ie, more of fitting nosing than fitting signals).

28
PS4 : Answers
(c)

29
PS4 : Answers
(c) In the forecast plot the extrapolation forecasts based on the
model in (b) are very poor indeed. At long-horizons, the
dominant component of forecasts is the 𝑡 5 term that has a
negative coefficient.
This is the typical consequence of over-fitting data. In general, an
over-fitting model leads to good in-sample fit but poor out-of-
sample forecast performance.

30
PS5 : Question 10 pp. 217
Using ‘oz-gdp.dat’ 1970Q1 1998Q4
(a) Graph the series

(b) Regress the first 20 observations on a f5th-order polynomial


time trend, and allow for 5 AR lags as well. Graph the actual and
fitted values from the regression. Discuss.

(c) Use your estimated model to produce an 80-step-ahead


extrapolation forecast. Graphically compare your forecast with
the actual realisation. Discuss.

31
PS5 : Answers
(a)

32
PS5 : Answers
(b)

33
PS5 : Answers
(b)

34
PS5 : Answers
(c)

35
PS5 : Answers
(c) (NB: comments for Question 4 apply to Question 5 as well)
The poor out-of-sample forecast performance is (again) caused
by the dominance of the term 𝑡 5 in the model.

36
Eviews Commands
' Problem set 1
' Dataset: liquor.dat
' program: liquor.prg

' Problem set 3


' Dataset: hstarts.dat
' program: hstarts02.prg

' Problem set 4


' Dataset: yen.dat
genr y = log(yen)
genr tt = @trend(1986:1)
smpl 1986:01 1988:01 'Estimation subsample
equation eq1.ls y c tt tt^2 tt^3 tt^4 tt^5 y(-1 to -5)
genr yf = y - resid
smpl 1988:02 1988:09 'Forecast subsample
eq1.forecast yhat se 'Generate forecasts
genr yf = yhat
smpl 1986:01 1994:04 'Plot everything for full sample
plot y yf

' Problem set 3


' Dataset: oz-gdp.dat
' program: oz-gdp2.prg

' EOF

37

Anda mungkin juga menyukai