Financial Econometrics Review Session Notes...

22
Financial Econometrics Review Session Notes 2 January 13, 2011 Contents 1 Simulating MA models 2 1.1 Applied Example 1 ............................... 2 1.2 Applied Example 2 ............................... 3 1.3 Applied Example 3 ............................... 4 1.4 Applied Example 4 ............................... 6 2 Estimating MA models 7 3 Simulating ARMA models 8 3.1 Example 5 .................................... 9 4 Estimating ARMA models 10 5 Forecasting 11 1

Transcript of Financial Econometrics Review Session Notes...

Financial EconometricsReview Session Notes 2

January 13, 2011

Contents

1 Simulating MA models 21.1 Applied Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Applied Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Applied Example 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Applied Example 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Estimating MA models 7

3 Simulating ARMA models 83.1 Example 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Estimating ARMA models 10

5 Forecasting 11

1

1 Simulating MA models

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.

8

Figure 7: Simulated path of yt = 2 + 0.75ϵt−1 + ϵt

-2

-1

0

1

2

3

4

5

6

100 200 300 400 500 600 700 800 900 1000

EXAMPLE3

3.1 Example 5

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?

smpl @all

series eps=nrnd

series example5=0

smpl @first+2 @last

example5=0.9*example5(-1)-0.5*example5(-2)+0.1*eps(-1)+eps

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

11

Figure 10: Simulated path of yt = 2 + 0.75ϵt−1 + 0.5ϵt−2 + ϵt

-4

-2

0

2

4

6

8

100 200 300 400 500 600 700 800 900 1000

EXAMPLE4

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.

12

Figure 11: Example 4 correlogram

-.1

.0

.1

.2

.3

.4

.5

.6

.7

2 4 6 8 10 12 14 16 18 20

EXAMPLE4ACF

13

Figure 12: Example 4 correlogram

-.2

-.1

.0

.1

.2

.3

.4

.5

.6

.7

2 4 6 8 10 12 14 16 18 20

EXAMPLE4PACF

14

Figure 13: S&P500

-.06

-.04

-.02

.00

.02

.04

.06

2001 2002 2003 2004 2005 2006 2007 2008

S&P500 Daily Return

15

Figure 14: S&P500 residuals ACF

-.20

-.15

-.10

-.05

.00

.05

.10

.15

.20

2 4 6 8 10 12 14 16 18 20

RESIDMA1ACF

16

Figure 15: S&P500 residuals PACF

-.20

-.15

-.10

-.05

.00

.05

.10

.15

.20

2 4 6 8 10 12 14 16 18 20

RESIDMA1PACF

17

Figure 16: Simulated path of yt = 0.9yt−1 − 0.5yt−2 + 0.1ϵt−1 + ϵt

-6

-4

-2

0

2

4

6

100 200 300 400 500 600 700 800 900 1000

EXAMPLE5

18

Figure 17: Example 5 correlogram

-.4

-.2

.0

.2

.4

.6

.8

2 4 6 8 10 12 14 16 18 20

EXAMPLE5ACF

19

Figure 18: Example 5 correlogram

-.6

-.4

-.2

.0

.2

.4

.6

.8

2 4 6 8 10 12 14 16 18 20

EXAMPLE5PACF

20

Figure 19: S&P500 residuals ACF

-.20

-.15

-.10

-.05

.00

.05

.10

.15

.20

2 4 6 8 10 12 14 16 18 20

RESARAM11ACF

21

Figure 20: S&P500 residuals PACF

-.20

-.15

-.10

-.05

.00

.05

.10

.15

.20

2 4 6 8 10 12 14 16 18 20

RESARMA11PACF

Figure 21: S&P500 forecast

-.03

-.02

-.01

.00

.01

.02

.03

2001 2002 2003 2004 2005 2006 2007 2008

SP500F – 2 S.E.

Forecast: SP500FActual: SPRTRNForecast sample: 1/01/2001 3/25/2009Included observations: 2147Root Mean Squared Error 0.011299Mean Absolute Error 0.008164Mean Abs. Percent Error 127.7219Theil Inequality Coefficient 0.950097 Bias Proportion 0.000000 Variance Proportion 0.902348 Covariance Proportion 0.097652

22