This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
A moving average model of order 1 says that yt is determined by a current shock ϵt anda lagged shock ϵt−1. Formally, the MA(1) model is given by:
(1.1) yt = µ+ θϵt−1 + ϵt,
where the ϵt are iid N(0, σ2).
Question 1. What are the three parameters that we need to estimate?
1.1 Applied Example 1
Let’s simulate 1000 observations from an MA(1) model with lag parameter 0.9. Specifi-cally, we simulate 1000 observations from:
yt = 0.9ϵt−1 + ϵt, ϵ ∼ N(0, 1).
Question 2. What are the values of the three parameters?
To simulate this in EViews, simulate first the ϵ series and then use the MA(1) relationto compute the simulation of y. The code for this is:
smpl @all
series eps=nrnd
smpl @first+1 @last
series example1=0.9*eps(-1)+eps
Question 3. Why is there a jagged behavior? How do we see the 3 parameters?
Recall that we can construct the autocorrelation function by opening the series corre-sponding to example 1 and, from the drop down menu, select View/Correlogram. Thisdisplays the Correlogram Specification dialog box. Select level in the Correlogramof: drop-down menu and enter 20 in the Lag Specification: lags to include box.
Question 4. What does the ACF suggest? At what lag is the ACF ”cutting off”?
Similarly, we are able to examine the PACF:
Question 5. What kind of behavior is the PACF exhibiting for our MA(1) model? Whatdoes it suggest?
2
Figure 1: Simulated path of yt = 0.9ϵt−1 + ϵt
-4
-3
-2
-1
0
1
2
3
4
5
100 200 300 400 500 600 700 800 900 1000
EXAMPLE1
1.2 Applied Example 2
Let’s simulate 1000 observations from an MA(1) model with lag parameter -0.9. Specifi-cally, we simulate 1000 observations from:
yt = −0.9ϵt−1 + ϵt, ϵ ∼ N(0, 1).
Question 6. What are the values of the three parameters?
To simulate this in EViews, simulate first the ϵ series and then use the MA(1) relationto compute the simulation of y. The code for this is:
smpl @all
series eps=nrnd
smpl @first+1 @last
series example2=-0.9*eps(-1)+eps
Question 7. How do this compare to the previous graph? How do we see the 3 parameters?
Recall that we can construct the autocorrelation function by opening the series corre-sponding to example 1 and, from the drop down menu, select View/Correlogram. This
3
Figure 2: Example 1 correlogram
-.1
.0
.1
.2
.3
.4
.5
.6
2 4 6 8 10 12 14 16 18 20
displays the Correlogram Specification dialog box. Select level in the Correlogramof: drop-down menu and enter 20 in the Lag Specification: lags to include box.
Question 8. What does the ACF suggest? At what lag is the ACF ”cutting off”?
Similarly, we are able to examine the PACF:
Question 9. What kind of behavior is the PACF exhibiting for our MA(1) model? Whatdoes it suggest?
1.3 Applied Example 3
Let’s simulate 1000 observations from an MA(1) model with lag parameter 0.75 andintercept 2. Specifically, we simulate 1000 observations from:
yt = 2 + 0.75ϵt−1 + ϵt, ϵ ∼ N(0, 1).
Question 10. What are the values of the three parameters?
To simulate this in EViews, simulate first the ϵ series and then use the MA(1) relationto compute the simulation of y. The code for this is:
4
Figure 3: Example 1 correlogram
-.4
-.2
.0
.2
.4
.6
2 4 6 8 10 12 14 16 18 20
EXAMPLE1PACF
smpl @all
series eps=nrnd
smpl @first+1 @last
series example3=2+0.75*eps(-1)+eps
Question 11. How does this plot compare with the previous plots? What is the uncondi-tional mean?
Recall that we can construct the autocorrelation function by opening the series corre-sponding to example 1 and, from the drop down menu, select View/Correlogram. Thisdisplays the Correlogram Specification dialog box. Select level in the Correlogramof: drop-down menu and enter 20 in the Lag Specification: lags to include box.
Question 12. What does the ACF suggest? At what lag is the ACF ”cutting off”?
Similarly, we are able to examine the PACF:
Question 13. What kind of behavior is the PACF exhibiting for our MA(1) model? Whatdoes it suggest?
5
Figure 4: Simulated path of yt = −0.9ϵt−1 + ϵt
-5
-4
-3
-2
-1
0
1
2
3
4
100 200 300 400 500 600 700 800 900 1000
EXAMPLE2
1.4 Applied Example 4
Let’s simulate 1000 observations from an MA(2) model with lag parameters 0.75 and0.5, intercept 2, and whose innovation terms have a variance equal to 1. Specifically, wesimulate 1000 observations from:
yt = 2 + 0.75ϵt−1 + 0.5ϵt−2 + ϵt, ϵ ∼ N(0, 1).
Question 14. How many parameters are we interested in here? What are their values?
To simulate this in EViews, simulate first the ϵ series and then use the MA(1) relationto compute the simulation of y. The code for this is:
smpl @all
series eps=nrnd
smpl @first+2 @last
series example4=2+0.75*eps(-1)+0.5*eps(-2)+eps
Question 15. How does this plot compare with the previous plots? What is the uncondi-tional mean?
6
Figure 5: Example 2 correlogram
-.6
-.5
-.4
-.3
-.2
-.1
.0
.1
2 4 6 8 10 12 14 16 18 20
EXAMPLE2ACF
Recall that we can construct the autocorrelation function by opening the series corre-sponding to example 1 and, from the drop down menu, select View/Correlogram. Thisdisplays the Correlogram Specification dialog box. Select level in the Correlogramof: drop-down menu and enter 20 in the Lag Specification: lags to include box.
Question 16. What does the ACF suggest? At what lag is the ACF ”cutting off”?
Similarly, we are able to examine the PACF:
Question 17. What kind of behavior is the PACF exhibiting for our MA(1) model? Whatdoes it suggest?
2 Estimating MA models
We have a dataset of daily returns on the S&P500 index. We want to model the behaviorof the daily returns. Load the data set.
Question 18. What does the plot suggest? What behavior does the process appear toexhibit?
7
Figure 6: Example 2 correlogram
-.6
-.5
-.4
-.3
-.2
-.1
.0
.1
2 4 6 8 10 12 14 16 18 20
EXAMPLE2PACF
Let’s fit an MA(1) model to the high frequency returns dataset. In EViews, run:
ls sprtrn c ma(1)
Question 19. What is our estimate of the intercept? What is our estimate of the MAcoefficient?
Question 20. What is our estimate for the intercept’s SE? What is our estimate of theMA coefficient’s SE?
Question 21. How do we write out the final estimated model?
Question 22. How do we assess the adequacy of our fitted model?
We can also plot the acf and the pacf of the residuals:
Question 23. What do the ACF and PACF plots suggest?
3 Simulating ARMA models
More generally, the ARMA class of models is of great interest in the financial econometricsliterature and work well in practice.
Let’s simulate 1000 observations from an ARMA(2,1) model with AR lag parameters 0.9and -0.5 and MA lag parameter 0.1 and whose innovation terms have variance equal to 1:
yt = 0.9yt−1 − 0.5yt−2 + 0.1ϵt−1 + ϵt.
Question 24. How many parameters are we interested in here? What are their values?
Question 25. How does this plot compare with previous plots?
Recall that we can construct the autocorrelation function by opening the series corre-sponding to example 1 and, from the drop down menu, select View/Correlogram. Thisdisplays the Correlogram Specification dialog box. Select level in the Correlogramof: drop-down menu and enter 20 in the Lag Specification: lags to include box.
9
Figure 8: Example 3 correlogram
-.1
.0
.1
.2
.3
.4
.5
.6
2 4 6 8 10 12 14 16 18 20
EXAMPLE3ACF
Question 26. What does the ACF suggest? At what lag is the ACF ”cutting off”?
Similarly, we are able to examine the PACF:
Question 27. What kind of behavior is the PACF exhibiting for our MA(1) model? Whatdoes it suggest?
4 Estimating ARMA models
Consider once again the daily stock returns data and estimate an ARMA(1,1) model. InEViews, use:
ls sprtrn c ar(1) ma(1)
series resarma11=resid
Question 28. What is our estimate of the intercept?
Question 29. What is our estimate of the MA coefficient? What is our estimate of theAR coefficient?
Question 30. What is our estimate for the intercept’s SE?
10
Figure 9: Example 3 correlogram
-.3
-.2
-.1
.0
.1
.2
.3
.4
.5
.6
2 4 6 8 10 12 14 16 18 20
EXAMPLE3PACF
Question 31. What is our estimate of the MA coefficient’s SE? What is our estimate ofthe AR coefficient’s SE?
Question 32. How do we write out the final estimated model?
Question 33. How do we assess the adequacy of our fitted model?
Question 34. Why did we choose an ARMA(1,1) model?
Question 35. How would we write out the final model?
Question 36. What does the residual plot suggest?
5 Forecasting
Suppose we would now like to create the in-sample one-step-ahead forecast for the MA(1)model we estimated in Section 2. Open the equation object corresponding to the MA(1)regression. To create the one-step-ahead forecast, all you need to do is to select theForecast tab in the equation view and check the Static forecast option. EViews then
automatically generates the desired forecast (for the difference between the static forecastoption and the dynamic forecast option, see User Guide II), as well as the 95% confidenceinterval bounds and forecast evaluation measures. Notice that, once we freeze the forecast,it becomes a graph which we can then save to disk as usual.