Homework 4: Emmanuel Nkansah Econometrics IV

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Emmanuel Nkansah

Econometrics IV
Homework 4

Question #1

Figure 1: Plot of original data for the first 135 weeks


Question #2

Series: traints
ARIMA (2,0,2) with non-zero mean

Coefficients:
ar1 ar2 ma1 ma2 mean
-0.9894 -0.3849 1.4068 0.8947 47221789.8
s.e. 0.1438 0.1443 0.0996 0.1070 579056.6

sigma^2 estimated as 2.433e+13: log likelihood=-2270.45


AIC=4552.91 AICc=4553.56 BIC=4570.34

The best ARIMA model for this time series is (2,0,2). This is the same as ARMA (2,2).
Question #2B
Using the selected model (ARIMA: 2,0,2) to forecast for the 8 time periods (weeks)
Time Series:
Start = 136
End = 143
Frequency = 1
Table 1: Forecasted next 8 time periods (weeks: 136-143)
Time period (weeks) Forecasted real sales
136 48920784
137 46494482
138 47287476
139 47436733
140 46983838
141 47374495
142 47162286
143 47221890

Question #3

Four different Bayesian Structural time series models

(a) Local level model (with no seasonality)


𝑦𝑡 = 𝜇𝑡 + 𝜀𝑡 𝜀~𝑁(0, 𝜎 2 )
𝜇𝑡 = 𝜇𝑡−1 + 𝜇𝑡 𝜇~𝑁(0, 𝜏 2 )
The point estimate of variances in the local level model
𝜎 2 = 4440917
𝜏 2 =2015614

(b) Local linear trend model (with no seasonality)


𝑦𝑡 = 𝜇𝑡 + 𝜀𝑡 𝜀~𝑁(0, 𝜎 2 )
𝜇𝑡 = 𝜇𝑡−1 + 𝜃𝑡−1 + 𝜇𝑡 𝜇~𝑁(0, 𝜏𝑢2 )
𝜃𝑡 = 𝜃𝑡−1 + 𝑣𝑡 𝑣~𝑁(0, 𝜏𝑣2 )

The point estimate of the variances in the local linear trend model
𝜎 2 = 4262690
𝜏𝑢2 =2411341
𝜏𝑣2 =61168.45

(c) Local level model (with seasonality)


𝑦𝑡 = 𝜇𝑡 + 𝛾𝑡 + 𝜀𝑡 𝜀~𝑁(0, 𝜎 2 )
𝜇𝑡 = 𝜇𝑡−1 + 𝜇𝑡 𝜇~𝑁(0, 𝜏𝑢2 )
𝑆−1
2
𝛾𝑡 = − ∑ 𝛾𝑡−𝑠 + 𝑤𝑡 𝛾~𝑁(0, 𝜏𝑤 )
𝑆=1

The point estimate of the variances in the local level model with seasonality
𝜎 2 = 1255571
𝜏𝑢2 =145002.1
2
𝜏𝑤 =371212.1

(d) Local linear trend model (with no seasonality)


𝑦𝑡 = 𝜇𝑡 + 𝛾𝑡 + 𝜀𝑡 𝜀~𝑁(0, 𝜎 2 )
𝜇𝑡 = 𝜇𝑡−1 + 𝜃𝑡−1 + 𝜇𝑡 𝜇~𝑁(0, 𝜏𝑢2 )
𝜃𝑡 = 𝜃𝑡−1 + 𝑣𝑡 𝑣~𝑁(0, 𝜏𝑣2 )
𝑆−1
2
𝛾𝑡 = − ∑ 𝛾𝑡−𝑠 + 𝑤𝑡 𝛾~𝑁(0, 𝜏𝑤 )
𝑆=1

The point estimate of the variances in the local linear trend model with seasonality
𝜎 2 = 1287449
𝜏𝑢2 =122580.3
𝜏𝑣2 =16736.21
2
𝜏𝑤 =199838.6
Question #4

Table 2: Average AIC for all four of the potential models


Model Average AIC
Model 1 4584.447
Model 2 4593.93
Model 3 4422.267
Model 4 4436.663

The model with the lowest average AIC is model 3 (4422.267).

Question # 5
Table 3: Forecasted next 8 time periods (weeks: 136-143) based on best model
Time period (weeks) Forecasted real sales
136 46860303
137 44109091
138 42825425
139 42921564
140 46808213
141 44388724
142 45143755
143 45318925
Question # 6

Figure 2: Graph showing the original data, ARIMA forecast and BSTS forecast

Question # 7
Table 4: Mean Squared Prediction Error of the forecast
Model Mean Squared prediction error of forecast
ARIMA 4.583571e+12
BSTS 1.103354e+12

The model with the better forecast is the BSTS. BSTS has the smaller mean squared prediction
error of the forecast.

You might also like