Analysis of Financial Time Series, 3rd Edition
BY Tsay
Solutions to Exercises of Chapter 1 Problem 1: Summary statistics of daily returns from January 1999 to December 2008. Stock
mean
St. Dev. Skew Ex. Kurt. Min. Max. t-ratio(p-value) (a) Percentage simple returns: 2515 data points AXP 0.015 2.446 -0.035 6.048 −17.595 17.927 0.299(0.77) CAT 0.060 2.170 0.012 4.453 −14.518 14.723 1.375(0.17) SBUX 0.048 2.683 −0.082 8.746 −28.286 14.635 0.898(0.37) (b) Percentage log returns: 2515 data points AXP −0.015 2.453 −0.336 6.486 −19.352 16.489 −0.316(0.75) CAT 0.036 2.171 −0.202 4.695 −15.686 13.735 0.830(0.41) SBUX 0.012 2.696 −0.597 12.90 −33.249 13.659 0.221(0.83) The sample means of the log returns are not significantly different from zero at the 5% level. Problem 2: Summary statistics of monthly returns from 1975 to 2008. Stock
mean
St. Dev. Skew Ex. Kurt. Min. Max. t-ratio(p-value) (a) Percentage simple returns: 408 data points GM 0.557 9.273 −0.383 2.048 −38.931 27.662 1.213(0.23) VW 1.012 4.507 −0.743 2.666 −22.536 14.160 4.534(0.00) EW 1.331 5.596 −0.300 4.334 −27.225 29.926 4.806(0.00) SP 0.730 4.360 −0.571 2.269 −21.763 13.177 3.382(0.00) (b) Percentage log returns: 408 data points GM 0.110 9.950 −1.024 4.021 −49.317 24.422 0.232(0.82) VW 0.905 4.561 −1.051 3.938 −25.536 13.243 4.006(0.00) EW 1.167 5.626 −0.836 5.242 −31.779 26.179 4.190(0.00) SP 0.632 4.402 −0.855 3.335 −24.543 12.378 2.900(0.00) The sample mean of the monthly GM stock return is not significantly different from zero, but those of the monthly log returns of indices are all significantly different from zero at the 5% level. Problem 3: Focus on monthly S&P composite log returns. • Average annual return = sample mean * 12 = (sum of log returns)/(number of years) = 7.583%. P • V = exp(0.07583 ∗ (2008 − 1975 + 1)) ≈ $13.17. (or V = exp( 408 t=1 rt ), where rt is the monthly log return). 3
4 Problem 4: Daily log returns of American Express stock from 1999 to 2008. p • Skewness: test-statistic is t = −0.336/ 6/2515 = −6.888 with p value 5.66 × 10−12 . Thus, we reject the null hypothesis of no skewness at the 5% level. • Kurtosis: test-statistic is t = √ 6.486
24/2515
= 66.40, which is large and has a p value close to zero.
Thus, we reject the null hypothesis of zero excess kurtosis. That is, the distribution of the log returns has heavy tails.
Problem 5: Summary statistics for daily foreign exchange rates from January 4, 2000 to March 27, 2009. Currency CA EU JP UK
mean Variance Skew Ex. Kurt. Min. Percentage log returns: 2322 data points −0.0068 0.345 −0.239 8.245 −5.072 0.011 0.428 0.126 2.805 −3.003 −0.002 0.440 −0.671 4.581 −5.216 −0.006 0.382 −0.395 7.061 −4.966
Max. 3.807 4.621 2.708 4.435
The sample means of daily log returns of the exchange rates considered are small. The returns all have positive excess kurtosis, indicating heavy tails.
0.4 0.0
0.2
density
0.6
0.8
5
−2
0
2
4
log−return
Figure 1: Empirical density function of the daily log returns of USEU exchange rate: January 4, 2000 to March 27, 2009.
6
Solutions to Exercises of Chapter 2 1. From the model, R101 = a101 + 0.2a100 . Taking conditional expectation at t = 100, we have R100 (1) = 0.2a1000 = 0.2 × 0.01 = 0.002 The associated forecastp error is e100 (1) = R101 − R100 (1) = a101 . Therefore, the standard deviation of the forecast error is Var[e100 (1)] = std(a101 ) = 0.025. For 2-step ahead forecast, we have R102 = a102 + 0.2a101 ,
and R100 (2) = E(R102 |F100 ) = 0. The forecast error is e100 (2) = R102 − R100 (2) = a102 + 0.2a101 p p with standard deviation Var(a102 + 0.2a101 ) = 1.04σa2 = 0.0255. To compute ACF of Rt , use the model to obtain • Var(Rt ) = (1 + 0.22 )σa2 = 0.00065.
• Cov(Rt , Rt−1 ) = Cov(at + 0.2at−1 , at−1 + 0.2at−2 ) = Cov(0.2at−1 , at−1 ) = 0.2σa2 = 0.000125.
• Cov(Rt , Rt−ℓ ) = 0 for ℓ ≥ 2.
Therefore, ACF of Rt is ρ1 = 0.192, ρℓ = 0 for ℓ ≥ 2. 2. Taking expectation of the model, we have E(rt ) = 0.01 + 0.2E(rt−2 ). 0.01 = 0.0125. Taking variance of the model, we obtain Therefore, E(rt ) = 1−0.2
Var(rt ) = 0.04Var(rt−2 ) + σa2 . 0.02 Therefore, Var(rt ) = 1−0.96 = 0.0208. For autocorrelation function, we may drop the constant term and multiply the equation by rt−ℓ to obtain
rt rt−ℓ = 0.2rt−2 rt−ℓ + at rt−ℓ . Taking the expectation for ℓ > 0, we have γℓ = 0.2γℓ−2 , where γℓ is the lag-ℓ autocovariance of rt . Therefore, ρℓ = 0.2ρℓ−2 for ℓ > 0. Since ρ0 = 1, we have ρ2 = 0.2, ρ4 = 0.22 , · · · for even number ℓ. For ℓ = 1, we use ρℓ = ρ−ℓ to obtain ρ1 = 0.2ρ−1 = 0.2ρ1 . This implies 0.8ρ1 = 0. Therefore, ρℓ = 0 if ℓ is an odd number. 7
4
6
rate
8
10
8
1950
1960
1970
1980
1990
2000
2010
year
Figure 2: Time series plot for monthly US unemployment rate.
For 1-step ahead forecast at t = 100, we have r101 = 0.01 + 0.2r99 + a101 . Taking conditional expectation, r100 (1) = 0.01 + 0.2r99 = 0.01 + 0.2 × (0.02) = 0.014. √ The forecast error is e100 (1) = a101 with standard deviation 0.02 = 0.141. For 2-step ahead forecast, using r102 = 0.01 + 0.2r100 + a102 , we obtain r100 √ (2) = 0.01 + 0.2(−0.01) = 0.008. The associated forecast error is a102 with standard deviation 0.02 = 0.141. 3. Consider the monthly U.S. unemployment rate from January 1948 to March 2009. The data are seasonally adjusted and obtained from the Federal Reserve Bank at St Louis’ website: http://research.stlouisfed.org/fred/. Build a time series model for the series and use the model to forecast the unemployment rate for April, May, June and July 2009. In addition, compute the average period of business cycles if they exist? [Note that there are more than one model fits the data well. You only need an adequate model.] Explanatory Analysis of the Series The first thing one should do is an exploratory analysis of the series to try and figure out what the data looks like. Let Xt be the series of monthly unemployment rate, in percentages. Figure 2 shows that there seems to be some sort of cycle, since every so often there are peaks, although they do not seem to occur at “regular” intervals. This may be an indication of a business cycle or a combination of business cycles and seasonal effect (even though we are told the data has been seasonally adjusted.) Figure 3 shows the ACF and the PACF for Xt . On the ACF we see that the serial correlations
9
Partial ACF
0.4 0.0
ACF
0
5
10
15
20
25
−0.1 0.0 0.1 0.2 0.3
Series diff(rate)
0.8
Series rate
0
5
Lag
10
15
20
25
Lag
−0.2
0.2
ACF
0.6
1.0
Series diff(rate)
0
5
10
15
20
25
Lag
Figure 3: Autocorrelation function and partial autocorrelation function for monthly US unemployment rate.
decay slowly. This could be an indication that the series may not be stationary and, thus, a (regular) difference might be needed. The ACF and PACF of the differenced series (1 − B)Xt show two important characteristics. First, the differeced series appears to be stationary as the serial correlations are small in magnitude. Second, there are serial correlations at lags 12 and 24, indicating that some seasonality remains even though the data were seasonally adjusted. Fitting the Model If the command ar with maximum likelihood method is used, one identifies an AR(11) model for the series: (1 − 0.99B − 0.24B 2 + 0.07B 3 + 0.06B 4 − 0.03B 5 + 0.13B 6 + 0.04B 7 − 0.05B 8 + 9
0.01B + 0.13B
10
11
− 0.13B )(Xt − 5.66) = at
(1) (2)
iid
where at ∼ N (0, 0.0387). Several coefficients are not significant at the 5% level so that the model can be simplified. The resulting model is (1 − 0.98B − 0.17B 2 + 0.17B 6 + 0.12B 10 − 0.13B 11 )(Xt − 5.661) = at , iid
where at ∼ N (0, 0.039). The characeristic roots of the fitted model contain conjugate complex roots so that it indicates the existence of business cycles. Each pair of the complex roots provides a period of the cycle. For instance, the roots 0.721 ± 1.087i with modulous 1.305 give a period k = 2π/ cos−1 (0.721/1.305) = 6.38 months.
10
−8 −4 0
4
Standardized Residuals
0
200
400
600
Time
ACF
0.0 0.4 0.8
ACF of Residuals
0
5
10
15
20
25
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
0
5
10
15
20
25
30
35
lag
Figure 4: Model chekcing of fitted AR(11) model for monthly US unemployment rate
Alternatively, to handle the serial correlations at seasonal lags, one can employ a multiplicative seasonal model. For simplicity, lower-order models are entertained and we obtain (1 − 0.58B − 0.24B 2 )(1 − 0.561B 12 )Xt = (1 − 0.581B)(1 − 0.819B 12 )at , where σa2 = 0.03725. Except for the seasonality, this multiplicative model does not contain business cycle. Residual Analysis An important part of model fitting is to check the assumptions that we made. Most of these can be done using the residuals of the models. We use the command tsdiag in R to check the two fitted models. the results are shown in Figures 4 and 5. From the plots, we see that residuals of the AR(11) model still have some minor serial correlations whereas those of the seasonal model appears to be adequate. Finally, using fitted models the forecasts of unemployment arte for April, May, June and July 2009 are > predict(m1,6) # AR(11) model $pred Time Series: Start = 736 End = 741 Frequency = 1 [1] 8.796765 8.981996 9.112555 9.246428 9.277609 9.276570
11
−8 −4 0
4
Standardized Residuals
0
200
400
600
Time
ACF
0.0 0.4 0.8
ACF of Residuals
0
5
10
15
20
25
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
0
5
10
15
20
25
30
35
lag
Figure 5: model checking for a fittd ARIMA model
$se Time Series: Start = 736 End = 741 Frequency = 1 [1] 0.1975856 0.2767134 0.3556580 0.4358310 0.5206642 0.6121825 > predict(m2,6) # seasonal model $pred Time Series: Start = 736 End = 741 Frequency = 1 [1] 8.841844 9.017154 9.126917 9.231977 9.338707 9.439207 $se Time Series: Start = 736 End = 741 Frequency = 1 [1] 0.1930098 0.2728039 0.3632395 0.4508560 0.5384476 0.6247633
4. Consider the monthly simple returns of the Decile 1, Decile 2, Decile 9, and Decile 10 of NYSE/AMEX/NASDAQ based on market capitalization. The data span is from January 1970 to December 2008, and the data are obtained from CRSP.
12 • Test H0 : ρ1 = ρ2 = · · · = ρ12 = 0 versus Ha : ρi 6= 0 for some i ∈ {1, 2, . . . , 12}. Apply the Ljung-Box statistics. For Decile 2 returns, we have Q(12) = 11.88 with p value 0.46. For Decile 10 returns, we have Q(12) = 36.10 with p value 0.0003. Therefore, we reject H0 for Decile 10 returns, but cannot reject H0 for Decile 2 returns. > da=read.table("m-dec12910.txt",header=T) > d2=da$dec2 > d10=da$dec10 > Box.test(d2,lag=12,type=’Ljung’) Box-Ljung test data: d2 X-squared = 11.8766, df = 12, p-value = 0.4556 > Box.test(d10,lag=12,type=’Ljung’) Box-Ljung test data: d10 X-squared = 36.103, df = 12, p-value = 0.0003119
• The ACF of Decile 2 returns indicates some serial correlation at lag 1. See Figure 6. Therefore, an MA(1) or an AR(1) model is entertained. The fitted MA(1) model is rt = 0.0092 + (1 + 0.123B)at , where σa2 = 0.0023. Model checking of the fitted model is shown in Figure 7. From the plots, the fitted model is adequate. • The 1-step to 12-step ahead forecasts are give below: > predict(m1,12) $pred Time Series: Start = 469 End = 480 Frequency = 1 [1] 0.014015984 0.009192279 0.009192279 0.009192279 0.009192279 0.009192279 [7] 0.009192279 0.009192279 0.009192279 0.009192279 0.009192279 0.009192279 $se Time Series: Start = 469 End = 480 Frequency = 1 [1] 0.04829823 0.04867484 0.04867484 0.04867484 0.04867484 0.04867484 [7] 0.04867484 0.04867484 0.04867484 0.04867484 0.04867484 0.04867484
5. Consider the daily simple returns of IBM stock in the file d-ibm3dx7008.txt. Compute the first 100 lags of ACF of the absolute daily simple returns of IBM stock. Is there evidence of long-range dependence? Why? Figure 8 shows that sample ACF of the absolute simple returns of IBM stock. The ACFs are not large in magnitude, but decay slowly. These features indicate that there is long memory in the
13
0.0
0.2
0.4
ACF
0.6
0.8
1.0
Series d2
0
5
10
15
20
25
Lag
Figure 6: Autocorrelation function fo monthly Decile 2 returns
−4
0 2
Standardized Residuals
0
100
200
300
400
Time
ACF
0.0 0.4 0.8
ACF of Residuals
0
5
10
15
20
25
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
2
4
6
8
10
12
lag
Figure 7: Model checking of MA(1) model for monthly Decile 2 returns
14 abs(ibm)
0.0
0.2
0.4
ACF
0.6
0.8
1.0
Series
0
20
40
60
80
100
Lag
Figure 8: Autocorrelation function of absolute returns of IBM stock.
absolute returns. 6. Consider the demand of electricity of a manufacturing sector in the US. The data are logged and denote the demand of a fixed day of each month in file ’power6.txt’. Build a time series model for the series and use the fitted model to produce 1 to 24-step ahead forecasts. Figure 6 presents the time series plot of the monthly log demand for electricity. We can see that there is a strong seasonal component as well as non-stationarity. This kind of series is a typical example in which the so-called airline model might work. After checking the ACF and PACF for the original series, as well as the series with one regular difference, one seasonal difference, and both, we conclude that both differences are needed. The fitted model is (1 − B)(1 − B 12 )Dt = (1 − 0.487B)(1 − 0.966B 12 )at iid
where at ∼ N (0, 3.337 × 10−4 ). > da=read.table("power6.txt",header=F) > pow=da[,1] > m1=arima(pow,order=c(0,1,1),seasonal=list(order=c(0,1,1),period=12)) > m1 Call: arima(x=pow,order=c(0,1,1),seasonal = list(order=c(0,1,1),period = 12)) Coefficients: ma1 -0.4865 s.e. 0.0631
sma1 -0.9664 0.1179
(3)
9.4
9.6
pow
9.8
10.0
15
0
50
100
150
200
250
Index
Figure 9: Time series plot for monthly log demand of electricity.
sigma^2 estimated as 0.0003337:
log likelihood = 633.59,
aic = -1261.17
> tsdiag(m1,gof=36) > predict(m1,24) $pred Time Series: Start = 265 End = 288 Frequency = 1 [1] 9.882315 9.867492 9.873761 9.892808 9.921631 10.006038 10.046234 [8] 10.063123 10.072570 10.006692 9.951904 9.928664 9.910806 9.895983 [15] 9.902252 9.921299 9.950123 10.034529 10.074725 10.091614 10.101061 [22] 10.035183 9.980395 9.957155 $se Time Series: Start = 265 End = 288 Frequency = 1 [1] 0.01845143 0.02073927 0.02279866 0.02468686 0.02644055 0.02808495 [7] 0.02963826 0.03111412 0.03252307 0.03387347 0.03517206 0.03642438 [13] 0.03789603 0.03918050 0.04042417 0.04163071 0.04280325 0.04394451 [19] 0.04505688 0.04614244 0.04720304 0.04824032 0.04925577 0.05025070
Both coefficients are significant. However, θ̂12 is very close to one, indicating that the seasonal
16
−3
−1
1 2
Standardized Residuals
0
50
100
150
200
250
Time
0.0 0.4 0.8
ACF
ACF of Residuals
0
5
10
15
20
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
0
5
10
15
20
25
30
35
lag
Figure 10: Analysis of residuals for model (3).
pattern is stable. Figure 6 shows the analysis of the residuals for model (3). From there we see that the model seems to be appropiate. The Ljung-Box statistic for lag 24 is Q(24) = 24.9, which compared to a χ2 with 22 degrees of freedom gives a p value of 0.302. Thus, we do not have enough evidence to reject the null of no autocorrelation. We also observe constant variance, and most residuals within the confidence bands. Finally, the forecats using model (3) are shown in the above output. 7. Let rt be the “ew” return, in percentages, and Mt , Ut , Wt and Rt denote Monday, Tuesday, Wednesday and Thursday dummy variables. Analysis based on Splus (OLS command): (a) If linear regression is used, the model is rt = 0.224 − 0.317Mt − 0.198Ut − 0.102Wt − 0.103Rt + et , where all estimates are highly singificant with maximum p value 0.0008. If HAC is used (Newey-West method), the magnitudes of t-ratios of the coefficient estimate increase.Therefore, use of HAC estimator does not change the conclusion. The residuals of the model, however, has strong serial correlation. (b) If a regression model with time-series errors is used, the fitted model is (1−0.54B−0.32B 2 )(1+0.04B 5 )(rt −0.22+0.32Mt +0.20Ut +0.11Wt +0.10Rt ) = (1−0.43B−0.40B 2 )at , (4)
17
−10
0 5
15
Standardized Residuals
0
2000
4000
6000
Time
0.4 0.0
ACF
0.8
ACF of Residuals
0
10
20
30
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
5
10
15
20
lag
Figure 11: Analysis of residuals for model (4).
where all estimates are significant at the 5% level and the variance of at is 0.6412. Model checking in Figure 7 indicates that there are some minor serial correlations at the higher order lags. For simplicity, we shall not consider those higher-order model. Thus, the weekday effects remain siginificant. 8. As demonstrated by the prior exercise, daily returns of equal-weighted index have some weekday effects. How about daily returns of the &P composite index? Let rt be the simple return of the S&P index, in percentages. Let the weekdays indicators be Mt , Ut , Wt , Rt , Ft , respectively. In what follows, we use all five indicators but require no constant term in the model. • The regression model is rt = −0.004Mt + 0.074Ut + 0.064Wt + 0.006Rt + 0.033Ft + et , where the standard error of et is 1.117. Among the weekday indicators, only Tuesday and Wednesday have significant coefficients at the 5% level. The t-ratios are 2.566 and 2.219, respectively. However, the residuals of the model have strong serial correlations because the series gives Q(12) = 67.02 with a p value 1.149 × 10−9 .
• A regression model with time-series errors is enterained and the fitted model is
(1−0.07B−0.31B 2 )(rt +0.004Mt −0.075Ut −0.063Wt −0.008Rt −0.032Ft ) = (1−0.09B−0.37B 2 )at ,
18 where several estimates ate not significant at the 5% level. A simplifed model becomes (1 − 0.38B 2 )(rt − 0.075Ut − 0.062Wt − 0.032Ft ) = (1 − 0.34B 2 )at , where the variance of at is 1.24. The Ljung-Box statistics of the residuals give Q(10) = 16.37 with a p value 0.09. Thus, the model seems adquate. The t-ratio for the Firday dummy is 0.032/0.029 = 1.10, which is smaller than the 95% critical value of 2. Thus, the effect of Friday is not significant at the 5% level. 9. Now, consider similar problems for individual stock returns. We use the daily simple returns of the IBM stock in this study. Let rt be the daily simple returns of IBM stock, in percentages. The same weekday indicators as those of Exercise 2.8. • The linear regression model is rt = 0.200Mt + 0.144Ut − 0.036Wt + 0.002Rt − 0.059Ft + et , where the standard error of et is 1.785. Based on the fitted regression model, only Monday and Tuesday have significant coefficients at the 5% level. The t-ratio for Friday dummy is −1.264 with a p value 0.21 so that there is no Friday effect on IBM simple daily returns.
• Ljung-Box statistics of the residuals give Q(12) = 16.84 with a p value 0.16 so that the residuals have no serial correlations. However, ACF of the residuals shows a minor lag-1 serial correlations. • The fitted regression model with time-series errors is rt − 0.20Mt − 0.14Ut + 0.04Wt − 0.002Rt + 0.059Ft + (1 − 0.032B)at ,
where the variance of at is 3.179. The Ljung-Box statistics of the residuals give Q(12) = 9.42 with a p value 0.67. Therefore, the model is adequate in capturing the serial correlations in the series. 10. Consider the weekly yields of Moody’s AAA & BAA seasoned bonds from January 5, 1962 to April 10, 2009. The data are obtained from Federal Reserve Bank at St Louis. Weekly yields are averages of daily yields. Obtain the summary statistics (sample mean, standard deviation, skewness, excess kurtosis, minimum and maximum) of the two yield series. Are the bond yields skewed? Do they have heavy tails? Answer the questions using 5% significance level. The sample size is 2467. Table 1 gives the summary statistics for both time series. The standard errors for the skewness and kurtosis are computed under the normality assumption. Thus, Var(Ŝ(x)) = 6/T , and Var(K̂(x)) = 24/T . For the Aaa bond yield, we have that Ŝ 0.857 t(S) = p = = 17.38, 6/2467 6/T
19 Table 1: Summary statistics for weekly yields of Moody’s AAA & BBB seasoned bonds from January 5, 1962 to April 10, 2009.
Aaa Baa
X̄
σ̂
Ŝ(x)
K̂(x)
Min
Max
7.83 8.85
2.419 2.717
0.857 0.930
0.578 0.761
4.19 4.78
15.85 17.29
which gives a p value close zero. Hence, we reject the null hypothesis of no skewness. Similarly, K̂ − 3 0.579 = 5.866, t(K) = p = 24/2467 24/T
with a p value of 0.01. Thus, we also reject the null hypothesis of no excess kurtosis. In particular, to test for heavy tails we need a one sided test. The p value for that is 0.01/2 = 0.005. Therefore, the bond yield does have heavy tails. A similar analysis can be done for the Baa bond yield. We have t(S) = 18.86, and t(K) = 7.72. Both t-statistics have a p value of zero. Therefore, we reject that the yield is not skewed, and also we conclude that it has heavy tails. 11. Consider the weekly Aaa bond yield. Build a time series model for the series. Figure 11 shows the time plot of the Aaa bond yields. The series is not stationary. ACF of the bond yields shows stron serial correlations so that we examine the differenced series (1 − B)Yt , where Yt is the weekly Aaa bond yield. The ar command identifies an AR(9) for (1 − B)Yt . Thus, one can employ and ARIMA(9,1,0) model. The fitted model is (1−0.37B +0.06B 2 −0.08B 3 −0.01B 4 −0.04B 5 +0.03B 6 +0.05B 7 −0.03B 8 +0.06B 9 )(1−B)Yt = at , where the variance of at is 0.00793. Several coefficient estimates are not significant at the 5% level. Alternatively, one can use ARIMA models. To keep the model simple, we focus on lower-order models and obtain (1 − 1.44B + 0.67B 2 )(1 − B)Yt = (1 − 1.061B + 0.213B 2 + 0.223B 3 )at , where the variance of at is 0.00798. All coefficient estimates are significant at the 5% level. The Ljung-Box statistics of the residuals give Q(10) = 11.89 with a p value 0.29. Thus the model appears to be adquate. 12. Again, consider the two bond yield series. What is the relationship between the two series? To answer this question, build a time series model using yields of Aaa bond as the dependent variable and yields of Baa bond as the independent variable.
4
6
8
Aaa 10
12
14
16
20
0
500
1000
1500
2000
2500
time
Figure 12: Time series plot of Aaa bond yields from January 5, 1962, to April 10, 2009
Define yt = (1 − B)Yt and xt = (1 − B)Xt , where Yt and Xt are the weekly yields of Aaa and Baa bonds. The difference is taken as the individual yield series contains a unit root. [Note that a proper way to analyze the data is to model the two series jointly; see the chapter on vector time series.] We start the analysis with the model yt = βxt + et . The fitted model is yt = 0.946xt + et . The estimate is highly significant. However,the residuals show certain serial correlations. Based on the ACF and PACF of the residuals, we specify the model (1 − 0.25B + 0.02B 2 − 0.04B 3 + 0.07B 4 )(yt − 0.948xt ) = at , where the residual variance is 0.00267. The Ljung-Box statistics of the residuals give Q(12) = 24.87 with a p value 0.02. The model needs further improvement. 13. Denote the monthly equal-weighted return by rt . Model specification: • t-ratio of the sample mean = 4.04, indicating the need of a constant term.
• PACF suggests an AR(1) model • ACF suggests an MA(1) model Estimation of AR(1) model shows
(1 − 0.227B)(rt − 1.063) = at ,
σa = 5.45
21 where standard errors of the coefficients are 0.046 and 0.260, respectively. Residual Q-statistic gives Q(12) = 13.68 with a p value 0.32. Thus, there is no significant serial correlations at the 5% level for lags 1 to 12. For MA(1) model, we have rt = 1.061 + at + 0.239at−1 ,
σa = 5.44
where standard errors of the coefficients are 0.316 and 0.045. Residual Q-statistic gives Q(12) = 11.62, which is also insignificant at the 5% level. The two models are adequate. Forecasts (standard errors) at the time point t = 456 are time 457 458
AR(1) 2.601 (5.448) 1.411 (5.586)
MA(1) 2.250 (5.439) 1.061 (5.592)
Model comparison: Express the AR(1) model as (1 − 0.227B)rt = 0.826 + at . Using long-division, we have rt = 1.069 + at + 0.227at−1 + 0.052at−2 + 0.012at−3 + 0.003at−4 + · · · which is very close to the MA(1) model. Thus, the two models are essentially equivalent. 14. Due the small magnitude of the data, I use percentage returns, i.e. yt = 100(ft − ft−1 ) and xt = 100(st − st−1 ). The correlation between yt and xt is 0.389. Thus, I start with the simple linear regression model yt = βxt + et . The fitted model is yt = 0.621xt + et . The residuals, however, show strong serial dependence, e.g. Q(10) = 115.0. I then use EACF to identify an ARMA model for the residual and it suggests clearly an ARMA(1,1) model. Consequently, the model becomes yt = 0.723 +
1 − 0.936B at 1 − 0.820B
where all estimates are highly significant and σa = 0.029. The residual series has no significant serial correlations because Q(10) = 5.5, which is low. Note that if one employs autoregressive models only, then he needs a high order model; see Chapter 8 where an AR(8) model is used. This appears to be an excellent example for demonstration the usefulness of using ARMA models. Also, the residuals appear to be heteroscedastic. One can further refine the model by using the models discussed in Chapter 3. 15. Let yt be the logarithm of the GDP deflator. The ACF and PACF of (1 − B)yt suggests an ARMA model. The fitted model is (1 − 0.877B − 0.011B 2 )(xt − 0.0086) = (1 − 0.338B)at ,
22 where σa2 = 1.76 × 10−5 and xt = (1 − B)yt , where yt is the logarithm of the GDP deflator. The AR(2) coefficient is insiginificant. In addition, residual ACF shows some serial correlation at lag 7. Therefore, we refine the model as (1 − 1.245B + 0.27B 2 )(xt − 0.0084) = (1 − 0.69B)(1 − 0.30B 7 )at , where the variance of at is 1.66 × 10−5 . All estimates, except the AR(2), are significant at the 5% level. The t-ratio for the AR(2) coefficient is −1.69. Model checking of the fitted model is shown in Figure 15 and the model appears to be adequate. Finally, the prediction of the model are 4.819, 4.825, 4.830 and 4.836, respectively. These predictions care obtained as below: > predict(m1,4) $pred Time Series: Start = 248 End = 251 Frequency = 1 [1] 0.004792946 0.005783540 0.005385856 0.005764302 $se Time Series: Start = 248 End = 251 Frequency = 1 [1] 0.004073850 0.004661837 0.004969789 0.005200728 > y[length(y)] [1] 4.814166 > mp=predict(m1,4) > names(mp) [1] "pred" "se" > Y=y[length(y)]+mp$pred[1] > Y [1] 4.818959 > Y1=Y+mp$pred[2] > Y1 [1] 4.824743 > y2=Y1+mp$pred[3] > y2 [1] 4.830128 > y3=y2+mp$pred[4] > y3 [1] 4.835893
23
−4
0 2 4
Standardized Residuals
0
50
100
150
200
250
Time
0.0 0.4 0.8
ACF
ACF of Residuals
0
5
10
15
20
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
5
10
15
20
lag
Figure 13: Model checking for the fitted model of Exercise 2.15
24
Solutions to Exercises of Chapter 3 For the first two exercises, we use the notation and concept below. Following the text, write at = σt ǫt . Let h be the forecast origin and Fh be the information available at time h. Then, for ℓ>0 2 2 2 E(a2h+ℓ |Fh ) = E(σh+ℓ ǫ2h+ℓ |Fh ) = E(σh+ℓ |Fh )E(ǫ2h+ℓ |Fh ) = E(σh+ℓ |Fh ), (5) where we have used the independence between ǫt+h and σh+ℓ and E(ǫ2h+ℓ |Fh ) = E(ǫ2h+ℓ ) = 1.
2 . For 1-step ahead 1. Write the GARCH(2,1) model as σt2 = α0 + α1 a2t−1 + α2 a2t−2 + β1 σt−1 forecast, t = h + 1 and the model gives
σh2 (1) = α0 + α1 a2h + α2 a2h−1 + β1 σh2 . 2 For 2-step ahead, taking the coditional expectation of σh+2 given Fh and using Eq(5), we have
σh2 (2) = α0 + α1 σh2 (1) + α2 a2h + β1 σh2 (1) = α0 + (α1 + β1 )σh2 (1) + α2 a2h . In general, for ℓ-step ahead forecast with ℓ > 2, the same method gives σh2 (ℓ) = α0 + (α1 + β1 )σh2 (ℓ − 1) + α2 σh2 (ℓ − 2). 2 2 . For 1-step ahead 2. Write the GARCH(1,2) model as σt2 = α0 + α1 a2t−1 + β1 σt−1 + β2 σt−2 forecast, t = h + 1 and the model gives 2 σh2 (1) = α0 + α1 a2h + β1 σh2 + β2 σh−1 .
Using the same method as Problem 1, we obtain the 2-step ahead forecast as σh2 (2) = α0 + (α1 + β1 )σh2 (1) + β2 σh2 , and the ℓ-step ahead forecast as σh2 (ℓ) = α0 + (α1 + β1 )σh2 (ℓ − 1) + β2 σh2 (ℓ − 2),
ℓ > 2.
For Exercises 3 and 4, we use the partition of Eq (1.16) of the text, namely f (r1 , · · · , rn ) =
n Y t=2
25
f (rt |Ft−1 ) × f (r1 ).
26 Taking log, we have ln[f (r1 , · · · , rn )] =
n X t=2
ln[f (rt |Ft−1 )] + ln[f (r1 )].
3. Let θ = (µ, φ1 , α0 , α1 , β1 )′ be the parameter vector. Then, the conditional log likelihood function, which omits f (r1 ), is ln[f (r1 , · · · , rn |θ)] = =
n X
t=2 n X t=2
ln[f (rt |θ, Ft−1 )] 1 (rt − µ − φ1 rt−1 )2 − [ln(2π) + ln(σt2 ) + ] 2 σt2
2 . The starting innovation a can be obtained as a = r − µ where σt2 = α0 + α1 a2t−1 + β1 σt−1 1 1 1 and the initial volatility σ12 can assume an arbitrary positive number, e.g. r12 or the sample variance of the returns.
4. Using the notation of Exercise 3 and the result in subsection 3.4.3 of the text, the conditional log likelihood function is ln[f (r1 , · · · , rn |θ) = (n − 1)[ln(Γ((v + 1)/2) − ln(Γ(v/2)) − 0.5 ln((v − 2)π)] n X (rt − µ − φ1 rt−1 )2 1 v+1 2 ln 1 + + ln(σt ) − 2 2 (v − 2)σt2 t=2
2 where σt2 = α0 + α1 a2t−1 + β1 σt−1 and Γ(.) is the Gamma function.
5. We use fGarch package to build two GARCH(1,1) models for the data. The first model uses Gaussian innovations and the second uses standardized Student-t distribution. Based on both AIC and BIC criteria, the model with Student-t innovations is selected. The fitted model is rt = 0.016 + σt ǫt ,
ǫt ∼ t∗6.83
2 σt2 = 0.0012 + 0.105a2t−1 + 0.818σt−1
where t∗v denotes standardized Student-t distribution with v degrees of freedom. The p values for the coefficients of volatility equation are 0.043, 0.005 and 0.0, respectively. For standardized residuals, we have Q(10) = 8.14 with p value 0.61. For the squared standardized residuals, we obtain Q(10) = 1.16 with p value 1.0. Thus, the model is adequate in modeling the first two conditional moments of the Intel returns. The 1- to 5-step ahead forecasts are given below, where volatility denotes conditional standard error: Step return volatility
1 0.0159 0.1218
2 0.0159 0.1220
3 0.0159 0.1222
4 0.0159 0.1222
5 0.0159 0.1223
27 6. First, we checked the serial correlations of the log returns and found that the lag-1 ACF is significant at the 5% level. In fact, the Ljung-Box statistics give Q(12) = 27.24 with p value 0.007. The ACF indicates lag-1 serial correlation. An MA(1) model is fitted to the return series. The Ljung-Box statistics of the residuals give Q(10) = 16.12 with p-value 0.096. We then use the residuals of the MA(1) model to check for ARCH effect. (a) The Ljung-Box statistics of the squared residuals shows that Q(12) = 32.27 with p value 0.001. Thus, there is significant ARCH effect in the log return series. (b) The PACF of the MA(1) residuals indicates an ARCH(3) model for the data. Therefore, we employ an MA(1)-ARCH(3) model for the log return series of Merck stock. The fitted model is rt = 0.014 + at − 0.075at−1 ,
at = σt ǫt , σt2
ǫt ∼ N (0, 1)
= 0.0041 + 0.0197a2t−1 + 0.0749a2t−2 + 0.0842a2t−3 .
The standardized residuals of the fitted model gives Q(10) = 16.52 with p value 0.086. The squared of the standardized residuals give Q(10) = 9.37 with p value 0.497. Thus, the model is adequate in describing the mean and volatility of the returns. Details of the output are given below: > m2=garchFit(~arma(0,1)+garch(3,0),data=mrk,trace=FALSE) > summary(m2) Title: GARCH Modelling Call: garchFit(formula = ~arma(0, 1) + garch(3, 0), data = mrk, trace = FALSE) Mean and Variance Equation: data ~ arma(0, 1) + garch(3, 0) [data = mrk] Conditional Distribution: norm Coefficient(s): mu ma1 0.0120080 -0.0751723 Std. Errors: based on Hessian Error Analysis:
omega 0.0040608
alpha1 0.0197029
alpha2 0.0748575
alpha3 0.0842134
28 Estimate Std. Error t value Pr(>|t|) mu 0.0120080 0.0023572 5.094 3.50e-07 *** ma1 -0.0751723 0.0357058 -2.105 0.0353 * omega 0.0040608 0.0003239 12.536 < 2e-16 *** alpha1 0.0197029 0.0347460 0.567 0.5707 alpha2 0.0748575 0.0374821 1.997 0.0458 * alpha3 0.0842134 0.0387548 2.173 0.0298 * --Log Likelihood: 933.9829 normalized: 1.243652 Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test LM Arch Test
R R R R R R^2 R^2 R^2 R
Chi^2 W Q(10) Q(15) Q(20) Q(10) Q(15) Q(20) TR^2
Statistic p-Value 25.3437 3.138234e-06 0.9941619 0.005351261 16.51536 0.08579968 27.59654 0.02423543 33.85983 0.02708868 9.37162 0.4972357 14.96659 0.4538268 16.47867 0.68652 11.94917 0.4497703
Information Criterion Statistics: AIC BIC SIC HQIC -2.471326 -2.434404 -2.471452 -2.457100 7. Let rt be the monthly log returns of 3M stock. (a) Considering the Ljung-Box statistics, we have Q(12) = 27.69 (0.006) for rt , Q(6) = 24.45 (0.000) and Q(12) = 32.66 (0.001) for rt2 , where the number in parentheses denotes p value. Thus, based on the 5% significance level, the log return series has some serial correlations, but has strong ARCH effects. (b) The PACF of the squared returns is given in Figure 7b. From the plot, an ARCH(2) model is specified. The fitted model is rt = 0.011 + at , σt2
=
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 0.0032 + 0.0781at−1 + 0.128at−2 .
All estimates are statistically significant at the 10% level. See below for further output. > m1=garchFit(~arma(0,0)+garch(2,0),data=mmm,trace=FALSE) > summary(m1) Title:
29 GARCH Modelling Call: garchFit(formula = ~arma(0, 0) + garch(2, 0), data = mmm, trace = FALSE) Mean and Variance Equation: data ~ arma(0, 0) + garch(2, 0) [data = mmm] Conditional Distribution: norm Coefficient(s): mu omega 0.010615 0.003228
alpha1 0.078122
alpha2 0.128041
Std. Errors: based on Hessian Error Analysis: Estimate Std. Error t value Pr(>|t|) mu 0.010615 0.002205 4.814 1.48e-06 *** omega 0.003228 0.000256 12.609 < 2e-16 *** alpha1 0.078122 0.044993 1.736 0.0825 . alpha2 0.128041 0.053228 2.406 0.0162 * --Log Likelihood: 1017.364 normalized: 1.347502 Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test LM Arch Test
R R R R R R^2 R^2 R^2 R
Chi^2 W Q(10) Q(15) Q(20) Q(10) Q(15) Q(20) TR^2
Statistic p-Value 41.06987 1.207233e-09 0.9917288 0.0003161969 19.81877 0.03101420 29.37285 0.01439508 32.61738 0.03714796 9.053344 0.5270487 16.91694 0.3238542 24.24292 0.2319419 10.14719 0.6030498
Information Criterion Statistics: AIC BIC SIC HQIC -2.684407 -2.659895 -2.684463 -2.674965
30
0.00 −0.05
Partial ACF
0.05
0.10
Series mmm^2
0
5
10
15
20
25
Lag
Figure 14: PACF of squared monthly log returns of 3M stock from 1946 to 2008.
(c) To produce out-of-sample forecasts, we re-fit the ARCH(2) model using the first 750 observations. The fitted model is then used to produce forecasts. The forecasts of volatility (or standard deviation) are given below: > mmma=mmm[1:750] > m2=garchFit(~arma(0,0)+garch(2,0),data=mmma,trace=FALSE) > summary(m2) Title: GARCH Modelling Call: garchFit(formula = ~arma(0, 0) + garch(2, 0), data = mmma, trace = FALSE) Mean and Variance Equation: data ~ arma(0, 0) + garch(2, 0) [data = mmma] Conditional Distribution: norm Coefficient(s): mu omega 0.0109217 0.0032036
alpha1 0.0800950
alpha2 0.1264015
31 Std. Errors: based on Hessian Error Analysis: Estimate Std. Error t value Pr(>|t|) mu 0.0109217 0.0022035 4.956 7.18e-07 *** omega 0.0032036 0.0002542 12.602 < 2e-16 *** alpha1 0.0800950 0.0449762 1.781 0.0749 . alpha2 0.1264015 0.0525631 2.405 0.0162 * --Standardised Residuals Tests: Statistic p-Value Jarque-Bera Test R Chi^2 42.29064 6.556988e-10 Shapiro-Wilk Test R W 0.9914569 0.0002500154 Ljung-Box Test R Q(10) 20.25332 0.02694572 Ljung-Box Test R Q(15) 29.55337 0.01363789 Ljung-Box Test R Q(20) 32.82521 0.0352608 Ljung-Box Test R^2 Q(10) 9.654784 0.4712841 Ljung-Box Test R^2 Q(15) 18.49898 0.2373414 Ljung-Box Test R^2 Q(20) 25.76902 0.1735768 LM Arch Test R TR^2 10.73783 0.5515106 Information Criterion Statistics: AIC BIC SIC HQIC -2.690206 -2.665566 -2.690262 -2.680711 > predict(m2,5) meanForecast meanError standardDeviation 1 0.01092165 0.07074065 0.07074065 2 0.01092165 0.06003729 0.06003729 3 0.01092165 0.06422518 0.06422518 4 0.01092165 0.06316345 0.06316345 5 0.01092165 0.06359692 0.06359692 (d) Again, focus on the first 750 observations. Based on the ARCH(2) model, we consider an ARCH(2)-M model and obtain the fit rt = 0.020 − 2.32σt2 + at ,
σt2
=
at = σt ǫt , 2 0.0032 + 0.079at−1 + 0.127at−2 .
ǫt ∼ N (0, 1)
The t-ratio of the risk premium parameter is −0.743, indicating that the risk premium is not statistically significant at the 5% level. (Results are from OX-G@RCH package.) > source("garchoxfit_R.txt") > m3=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(0,2), series=mmma,arch.in.mean=T)
32 Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.019799 0.012162 1.628 0.1040 Cst(V) 31.977946 2.5483 12.55 0.0000 ARCH(Alpha1) 0.079440 0.043687 1.818 0.0694 ARCH(Alpha2) 0.127342 0.051711 2.463 0.0140 ARCH-in-mean(var) -2.319737 3.1207 -0.7433 0.4575 (e) The fitted EGARCH(1,1) model is rt = 0.010 + at , at = σt ǫt , ǫt ∼ N (0, 1) 1 + 2.609B ln(σt2 ) = −5.545 + g(ǫt−1 ) 1 − 0.593B where g(ǫt ) = 0.003ǫt + 0.088(|ǫt | − 0.80), and the standard errors of the estimates are given below. The estimates 2.609, 0.003, and 0.088 are insignificant, indicating that EGARCH model might not be appropriate for the return series. In other words, there is no leverage effect in the returns. > source("garchoxfit_R_w.txt") > m4=garchOxFit(formula.mean=~arma(0,0),formula.var=~egarch(1,1),series=mmma) Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.010178 0.0021279 4.783 0.0000 Cst(V) -55453.933545 696.05 -79.67 0.0000 ARCH(Alpha1) 2.609094 3.1293 0.8338 0.4047 GARCH(Beta1) 0.592854 0.10149 5.842 0.0000 EGARCH(Theta1) 0.002920 0.013848 0.2108 0.8331 EGARCH(Theta2) 0.088276 0.079724 1.107 0.2685 Warning : To avoid numerical problems, the estimated parameter Cst(V), and its std.Error have been multiplied by 10^4. *************** ** FORECASTS ** *************** Number of Forecasts: 15 Horizon 1 2 3 4 5
Mean 0.01018 0.01018 0.01018 0.01018 0.01018
Variance 0.04157 0.127 0.2941 0.484 0.6502
33 8. Let rt be the monthly log returns of GM stock. The returns are in percentages. The Ljung-Box statistics of rt indicate some serial dependence in the returns. However, a close examination shows that the major serial correlations of the returns are at higher lags and are of small magnitude. Thus, we shall use the constant as the mean equation. (a) We fit a GARCH(1,1) model. The result is rt = 0.901 + at , σt2
=
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 2 1.217 + 0.116at−1 + 0.874σt−1 ,
where the standard errors and t-ratios of the estimates are given below. Except for the normality condition, the fitted model seems adequate for modeling the first two conditional moments of rt . > gm=log(da$gm+1)*100 > acf(gm) > m1=garchFit(~arma(0,0)+garch(1,1),data=gm,trace=FALSE) > summary(m1) Title: GARCH Modelling Call: garchFit(formula = ~arma(0, 0) + garch(1, 1), data = gm, trace = FALSE) Mean and Variance Equation: data ~ arma(0, 0) + garch(1, 1) [data = gm] Conditional Distribution: norm Coefficient(s): mu omega 0.90075 1.21708
alpha1 0.11594
beta1 0.87380
Std. Errors: based on Hessian Error Analysis: Estimate mu 0.90075 omega 1.21708 alpha1 0.11594 beta1 0.87380
Std. Error 0.24033 0.65470 0.02620 0.02889
t value Pr(>|t|) 3.748 0.000178 *** 1.859 0.063031 . 4.424 9.67e-06 *** 30.244 < 2e-16 ***
34 --Log Likelihood: -2389.371 normalized:
-3.374817
Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test LM Arch Test
R R R R R R^2 R^2 R^2 R
Chi^2 W Q(10) Q(15) Q(20) Q(10) Q(15) Q(20) TR^2
Statistic p-Value 32.41207 9.158187e-08 0.9907211 0.0001954494 12.40986 0.2585622 18.43059 0.2407048 22.79112 0.2991672 7.814781 0.6469232 17.3923 0.2959586 21.05005 0.394192 12.92393 0.3745942
Information Criterion Statistics: AIC BIC SIC HQIC 6.760934 6.786710 6.760870 6.770893 > predict(m1,6) meanForecast meanError standardDeviation 1 0.9007476 27.53715 27.53715 2 0.9007476 27.41764 27.41764 3 0.9007476 27.29885 27.29885 4 0.9007476 27.18076 27.18076 5 0.9007476 27.06337 27.06337 6 0.9007476 26.94669 26.94669 (b) For GARCH-M modeling, we use the GARCH(1,1) model of Part(a) as the baseline model. Based on the OX-G@RCH package, we have the fitted model rt = 1.347 − 0.0102σt2 + at ,
σt2
=
at = σt ǫt , 2 2 1.257 + 0.116at−1 + 0.873σt−1 ,
ǫt ∼ N (0, 1)
where the standard errors are given in the output below: > source("garchoxfit_R.txt") > m2=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(1,1), series=gm,arch.in.mean=T) ******************** ** SPECIFICATIONS ** ******************** Dependent variable : X Mean Equation : ARMA (0, 0) model. No regressor in the mean
35 Variance Equation : GARCH (1, 1) model. in-mean No regressor in the variance The distribution is a Gauss distribution. Strong convergence using numerical derivatives Log-likelihood = -2388.67 Please wait : Computing the Std Errors ... Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 1.347262 0.45691 2.949 0.0033 Cst(V) 1.257305 0.68195 1.844 0.0656 ARCH(Alpha1) 0.115985 0.027053 4.287 0.0000 GARCH(Beta1) 0.872823 0.030280 28.83 0.0000 ARCH-in-mean(var) -0.010214 0.0089202 -1.145 0.2526 *************** ** FORECASTS ** *************** Number of Forecasts: 15 Horizon 1 2 3 4 5 6
Mean -5.408 -5.345 -5.284 -5.222 -5.162 -5.102
Variance 648.7 642.7 636.7 630.8 625 619.3
(c) For GARCH models with Student t innovations, we have rt = 0.866 + at ,
at = σt ǫt ,
ǫt ∼ t∗9.42
2 σt2 = 1.263 + 0.104a2t−1 + 0.882σt−1 ,
where the standard errors are given in the output below and the estimated degrees of freedom are 9.42 with standard error 2.97. Since t = (9.42 − 6)/2.97 = 1.15, which is less than 1.96 so that we cannot reject the null hypothesis that the number of degrees of freedom is 6. > m3=garchFit(~arma(0,0)+garch(1,1),data=gm,trace=FALSE,cond.dist="std") > summary(m3) Title: GARCH Modelling Call:
36 garchFit(formula = ~arma(0, 0) + garch(1, 1), data = gm, cond.dist = "std", trace = FALSE) Mean and Variance Equation: data ~ arma(0, 0) + garch(1, 1) [data = gm] Conditional Distribution: std Coefficient(s): mu omega 0.86551 1.26260
alpha1 0.10420
beta1 0.88243
shape 9.41762
Std. Errors: based on Hessian Error Analysis: Estimate Std. Error t value Pr(>|t|) mu 0.86551 0.23651 3.659 0.000253 *** omega 1.26260 0.80666 1.565 0.117530 alpha1 0.10420 0.02820 3.694 0.000220 *** beta1 0.88243 0.03445 25.612 < 2e-16 *** shape 9.41762 2.96757 3.174 0.001506 ** --Log Likelihood: -2381.935 normalized: -3.364315 Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test LM Arch Test
R R R R R R^2 R^2 R^2 R
Chi^2 W Q(10) Q(15) Q(20) Q(10) Q(15) Q(20) TR^2
Statistic p-Value 34.59002 3.082284e-08 0.9903886 0.0001405580 12.51282 0.2521997 18.60857 0.2320223 22.88629 0.2944122 7.630578 0.6648709 17.04128 0.3164026 20.52841 0.4253414 12.77153 0.385863
Information Criterion Statistics: AIC BIC SIC HQIC 6.742754 6.774975 6.742655 6.755203 > tt=(9.42-6)/2.97
37 > tt [1] 1.151515 > > predict(m3,6) meanForecast meanError standardDeviation 1 0.8655075 26.54116 26.54116 2 0.8655075 26.38709 26.38709 3 0.8655075 26.23420 26.23420 4 0.8655075 26.08247 26.08247 5 0.8655075 25.93190 25.93190 6 0.8655075 25.78248 25.78248 (d) For numerial stability, the log return is used, i.e. not in percentage. The fitted EGARCH(1,1) model is rt = 0.0076 + at , at = σt ǫt , ǫt ∼ ged 1 − 0.028B ln(σt2 ) = −5.198 + g(ǫt−1 ) 1 − 0.896B where g(ǫt ) = −0.104ǫt + 0.350(|ǫt | − 0.80). All estimates, but the coefficient −0.028, are significant at the 10% level. The estimate −.104 has a p value 0.0587 so that it is marginally significant. > gm=gm/100 > m4=garchOxFit(formula.mean=~arma(0,0),formula.var=~egarch(1,1),series=gm) ******************** ** SPECIFICATIONS ** ******************** Dependent variable : X Mean Equation : ARMA (0, 0) model. No regressor in the mean Variance Equation : EGARCH (1, 1) model. No regressor in the variance The distribution is a Gauss distribution. Strong convergence using numerical derivatives Log-likelihood = 856.079 Please wait : Computing the Std Errors ... Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.007554 0.0023529 3.211 0.0014 Cst(V) -5.197746 0.12966 -40.09 0.0000 ARCH(Alpha1) -0.028442 0.24290 -0.1171 0.9068 GARCH(Beta1) 0.896412 0.033152 27.04 0.0000 EGARCH(Theta1) -0.103697 0.054773 -1.893 0.0587
38 EGARCH(Theta2)
0.350269
0.083786
4.181
0.0000
No. Observations : Mean (Y) : Skewness (Y) : Log Likelihood :
708 0.00411 -1.01957 856.079
No. Parameters Variance (Y) Kurtosis (Y)
: : :
6 0.00656 8.46108
*************** ** FORECASTS ** *************** Number of Forecasts: 15 Horizon 1 2 3 4 5 6
Mean 0.007554 0.007554 0.007554 0.007554 0.007554 0.007554
Variance 0.08037 0.05956 0.04656 0.03734 0.03063 0.02566
(e) The volatility forecasts of each model built are given below. The EGARCH(1,1) model seems to produce volatility forecasts that decay faster than those of other models. Other three models give similar forecasts. Returns are in percentages. Model-innov. GARCH(1,1)-N(0,1) GARCH(1,1)-M GARCH(1,1)-t EGARCH(1,1)
1 27.54 25.47 26.54 28.35
2 27.42 25.35 26.39 24.40
3 27.30 25.23 26.23 21.58
4 27.18 25.12 26.08 19.32
5 27.06 25.00 25.93 17.50
6 26.95 24.89 25.78 16.02
9. Again, let rt be the monthly log return of the GM stock. The fitted threshold GARCH (GJR) model is rt = 0.0077 + at , σt2
=
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 2 0.00016 + 0.068at−1 + 0.088Nt−1 a2t−1 + 0.870σt−1 ,
where Nt−1 = 1 if at−1 < 0 and = 0 otherwise. The leverage effect parameter is significant at the 5% level with p value 0.0234. Except for normality assumption, the model seems adequate. The 1- to 6-step ahead volatility forecasts are 0.312, 0.309, 0.307, 0.304, 0.302, and 0.299, respectively. > m4=garchOxFit(formula.mean=~arma(0,0),formula.var=~gjr(1,1),series=gm) ******************** ** SPECIFICATIONS ** ******************** Dependent variable : X Mean Equation : ARMA (0, 0) model. No regressor in the mean
39 Variance Equation : GJR (1, 1) model. No regressor in the variance The distribution is a Gauss distribution. Strong convergence using numerical derivatives Log-likelihood = 873.631 Please wait : Computing the Std Errors ... Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.007687 0.0024703 3.112 0.0019 Cst(V) 0.0001583.3408e-005 4.729 0.0000 ARCH(Alpha1) 0.067718 0.028833 2.349 0.0191 GARCH(Beta1) 0.870232 0.020803 41.83 0.0000 GJR(Gamma1) 0.087696 0.038596 2.272 0.0234 No. Observations : Mean (Y) : Skewness (Y) : Log Likelihood :
708 0.00411 -1.01957 873.631
No. Parameters Variance (Y) Kurtosis (Y)
: : :
5 0.00656 8.46108
The sample mean of squared residuals was used to start recursion. The condition for existence of the second moment of the GJR is observed. This condition is alpha(1) + beta(1) + k gamma(1) < 1 (with k = 0.5 with this distribution.) In this estimation, this sum equals 0.981698. The condition for existence of the fourth moment of the GJR is observed. The constraint equals 0.994322 (should be < 1). => See Ling & McAleer (2001) for details. *************** ** FORECASTS ** *************** Number of Forecasts: 15 Horizon 1 2 3 4 5 6
Mean 0.007687 0.007687 0.007687 0.007687 0.007687 0.007687
Variance 0.09741 0.09579 0.09419 0.09263 0.09109 0.08958
**** S-Plus results > mm=garch(gm~1,~tgarch(1,1),leverage=T) > summary(mm) Call: garch(formula.mean = gm ~ 1, formula.var =
~ tgarch(1, 1), leverage = T)
Mean Equation: structure(.Data = gm ~ 1, class = "formula") Conditional Variance Equation: structure(.Data=~tgarch(1,1),class="formula")
40 Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 0.0078058 2.573e-03 3.033 0.002507 A 0.0001476 5.791e-05 2.549 0.011004 ARCH(1) 0.0667597 2.202e-02 3.031 0.002525 GARCH(1) 0.8741240 2.402e-02 36.399 0.000000 GAMMA(1) 0.0841015 3.128e-02 2.689 0.007346 -------------------------------------------------------------AIC(5) = -1737.215, BIC(5) = -1714.403 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 34.98 2.539e-08 0.9896 0.9186 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 15.46 0.2172 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 12.08 0.439 12 Lagrange multiplier test: -------------------------------------------------------------Lag 1 Lag 2 Lag 3 Lag 4 Lag 5 Lag 6 Lag 7 Lag 8 Lag 9 Lag 10 Lag 11 0.06302 -0.594 -1.53 -0.3675 1.123 -1.265 -0.635 0.9434 0.9248 -0.5962 1.9 Lag 12 C 0.1062 0.1958 TR^2 P-value F-stat P-value 11.96 0.4487 1.107 0.4637 > predict(mm,6) $series.pred: [1] 0.007805777 0.007805777 0.007805777 0.007805777 0.007805777 0.007805777 $sigma.pred: [1] 0.3097932 0.3073787 0.3049867 0.3026172 0.3002699 0.2979446
10. Let rt be the monthly log return of the S&P 500 index.
41 (a) The fitted Gaussian GARCH(1,1) model is rt = 0.0064 + at , σt2
=
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 2 0.000086 + 0.113at−1 + 0.846σt−1 ,
where all parameter estimates are significant at the 5% level. The normaility test shows that the innovations are not Gaussian, but other checking statistics indicate that the model is adequate in modeling the first two conditional moments. > m1=garch(sp5~1,~garch(1,1)) > summary(m1) Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 6.438e-03 1.517e-03 4.245 2.483e-05 A 8.556e-05 3.061e-05 2.795 5.325e-03 ARCH(1) 1.126e-01 2.484e-02 4.533 6.834e-06 GARCH(1) 8.460e-01 2.784e-02 30.393 0.000e+00 -------------------------------------------------------------AIC(4) = -2528.741, BIC(4) = -2510.491 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 179.7 0 0.9735 4.213e-06 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 11.09 0.5209 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 6.02 0.915 12
(b) Define an indicate It = 1 if t is in June, July and August, and It = 0 otherwise. The modified GARCH(1,1) model is rt = 0.0063 + at , σt2
=
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 2 0.000034 + 0.101at−1 + 0.842σt−1 + 0.00029It
where all parameter estimates, but the constant of the volatility equation, are significant at the 5% level. Thus, model indicates that the volatility of the index is higher during the summer months. > It=rep(c(0,0,0,0,0,1,1,1,0,0,0,0),59) > fit=garch(sp5~1,~garch(1,1)+It) > summary(fit) garch(formula.mean = sp5 ~ 1, formula.var =
~ garch(1, 1) + idx)
42 Mean Equation: sp5 ~ 1 Conditional Variance Equation: ~ garch(1, 1) + idx Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 6.314e-03 1.527e-03 4.1344 3.988e-05 A 3.377e-05 3.469e-05 0.9735 3.306e-01 ARCH(1) 1.010e-01 2.429e-02 4.1585 3.599e-05 GARCH(1) 8.415e-01 3.167e-02 26.5710 0.000e+00 It 2.936e-04 9.800e-05 2.9955 2.836e-03 -------------------------------------------------------------AIC(5) = -2534.322, BIC(5) = -2511.51 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 137.6 0 0.9759 0.0001461 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 12.22 0.4285 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 6.931 0.8621 12 (c) Let zt = (yt − ȳ)2 , where yt is the monthly log return of GM stock and ȳ is the sample mean of yt . We use zt−1 as an explanatory variable to the volatility of the S&P 500 index returns. The fitted GARCH(1,1) model is rt
=
σt2
=
0.0064 + at ,
at = σt ǫt ,
ǫt ∼ N (0, 1) 2 2 0.000080 + 0.105at−1 + 0.852σt−1 + 0.0014zt−1 .
For the attached output, the effect of zt−1 on the volatility of S&P 500 index returns is small with p value 0.42. > gmsq=(gm-mean(gm))^2 > m3=garch(sp[2:708]~1,~garch(1,1)+gmsq[1:707]) > summary(m3) Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 6.396e-03 1.531e-03 4.1786 3.304e-05 A 7.982e-05 3.158e-05 2.5273 1.171e-02 ARCH(1) 1.046e-01 2.925e-02 3.5767 3.718e-04
43 GARCH(1) 8.524e-01 3.147e-02 27.0878 0.000e+00 gmsq[1:707] 1.364e-03 1.690e-03 0.8074 4.197e-01 -------------------------------------------------------------AIC(5) = -2522.632, BIC(5) = -2499.827 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 172 0 0.9745 1.972e-05 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 10.84 0.5429 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 6.021 0.915 12
11. Consider the daily log return of GM stock. (a) Let Rtg be the daily simple return of GM stock. Then rtg = log(1 + Rtg ) corresponds to the daily log return. The results from the Ljung-Box statistic with lag 10 are given below. > autocorTest(gm,lag=10) Test for Autocorrelation: Ljung-Box Null Hypothesis: no autocorrelation Test Statistics: Test Stat 28.3992 p.value 0.0016 Dist. under Null: chi-square with 10 degrees of freedom Total Observ.: 2515 > acf(gm,lag=10) Autocorrelation matrix: lag gm 1 0 1.0000 2 1 0.0267 3 2 -0.0652 4 3 0.0214 5 4 0.0161 6 5 -0.0372 7 6 0.0191 8 7 0.0042 9 8 0.0465
44 10 11
9 -0.0105 10 -0.0392
> archTest(gm,lag=10) Test for ARCH Effects: LM Test Null Hypothesis: no ARCH effects Test Statistics: Test Stat 626.2534 p.value 0.0000 Dist. under Null: chi-square with 10 degrees of freedom Total Observ.: 2515 > > acf(gm,type=’partial’,lag=10) Call: acf(x = gm, lag.max = 10, type = "partial") Partial Correlation matrix: lag gm 1 1 0.0267 2 2 -0.0660 3 3 0.0252 4 4 0.0105 5 5 -0.0351 6 6 0.0226 7 7 -0.0024 8 8 0.0509 9 9 -0.0134 10 10 -0.0345
The p value is about 0, and therefore we have strong evidence to reject the null of no ARCH effects. (b) Compute the PACF of the squared log returns (10 lags). Figure 11b shows the Partial Autocorrelation Function for rt for lags 1 to 10. From the plot, the maximum PACF occurs at lage 2. (c) We first employ an AR(2)-GARC(1,1) model, but the two AR coefficients are insignificant. Therefore, we employ an GARCH(1,1) model The fitted model is rtg = 0.00041 + at , σt2
=
at = σt ǫt
2 0.000011 + 0.073a2t−1 + 0.917σt−1
iid
where ǫt ∼ N (0, 1). The relevant Splus output is given below: > m1=garch(gm~ar(2),~garch(1,1)) > summary(m1)
(6.1) (6.2)
45
−0.06
−0.04
Partial ACF −0.02 0.0
0.02
0.04
Series : gm
0
2
4
Lag
6
8
10
Figure 15: PACF of GM squared daily log returns from January 1998 to December 31, 2008.
Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 1.654e-04 4.764e-04 0.3472 0.7285 AR(1) 1.682e-02 2.130e-02 0.7893 0.4300 AR(2) 1.416e-02 2.140e-02 0.6619 0.5081 A 1.093e-05 1.061e-06 10.2980 0.0000 ARCH(1) 7.391e-02 6.512e-03 11.3491 0.0000 GARCH(1) 9.157e-01 6.296e-03 145.4291 0.0000 -------------------------------------------------------------> m1=garch(gm~1,~garch(1,1)) > summary(m1) Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 4.061e-04 4.760e-04 0.8532 0.3936 A 1.068e-05 9.606e-07 11.1170 0.0000 ARCH(1) 7.262e-02 6.351e-03 11.4352 0.0000 GARCH(1) 9.172e-01 6.053e-03 151.5189 0.0000 -------------------------------------------------------------AIC(4) = -11448.75, BIC(4) = -11425.43 Normality Test:
46 -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 3450 0 0.9614 2.261e-25 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 15.36 0.2225 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 3.549 0.9903 12
All the parameters in the volatility equation are significantly different from zero. We cannot reject the null hypothesis of no serial correlation of the standardized residuals (using 12 lags), since the p value is 0.22. A similar result holds for the squared residuals. The Q(12) = 3.549 with p value 0.99. (d) Using GED, we obtained the model rtg = −0.00044at ,
σt2
= 4.95 × 10
−6
at = σt ǫt 2 + 0.0675a2t−1 + 0.9290σt−1
(7.1) (7.2)
where ǫt follows the generalized error distribution (ged) with density function f (u) =
ν exp [−(1/2) |u/λ|ν ] λ · 2(ν+1)/ν Γ(1/ν)
1/2 where λ = 2−2/ν Γ(1/ν)/Γ(3/ν) , and ν ∈ (0, ∞]. The estimate of ν is 1.2689 with standard error 0.033. This estimate of ν confirms the heavy tails of the innovations. The Splus output is: > m2=garch(gm~1,~garch(1,1),cond.dist="ged") > summary(m2) Conditional Distribution: ged with estimated parameter 1.268922 and standard error 0.03259006 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C -4.422e-04 3.763e-04 -1.175 2.401e-01 A 4.953e-06 1.571e-06 3.153 1.633e-03 ARCH(1) 6.750e-02 9.976e-03 6.767 1.636e-11 GARCH(1) 9.290e-01 9.817e-03 94.633 0.000e+00 -------------------------------------------------------------AIC(5) = -11658.63, BIC(5) = -11629.48 Normality Test: --------------------------------------------------------------
47 Jarque-Bera P-value Shapiro-Wilk P-value 5336 0 0.9565 8.944e-27 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 16.26 0.1797 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 4.208 0.9794 12
All the parameters of the volatility equation are significantly different from zero. The unconditional mean of returns is not significantly different from zero. The estimate of ν is 1.27, which corresponds to a distribution with heavier tails than the normal. Neither of the standardized residuals or square standardized residuals show evidence of serial correlation, with p values 0.18 and 0.98, respectively. We reject the normality test, but that is OK, because we have assumed the ged for the errors. 12. Consider the daily simple returns of S&P composite index in the file “d-gmsp9908.txt.” (a) There are significant serial correlations in the daily returns so that we fit an AR(2) model. The residuals indicate that most serial correlations are removed. > sp=da$sp > autocorTest(sp,lag=10) Test for Autocorrelation: Ljung-Box Null Hypothesis: no autocorrelation Test Statistics: Test Stat 57.0623 p.value 0.0000 Dist. under Null: chi-square with 10 degrees of freedom Total Observ.: 2515 > acf(sp,type=’partial’) > m1=arima.mle(sp,model=list(order=c(2,0,0))) > summary(m1) Call: arima.mle(x = sp, model = list(order = c(2, 0, 0))) Method: Maximum Likelihood with likelihood conditional on ARIMA order:
2 0 0
Value Std. Error t-value
2 observations
48 ar(1) -0.08501 ar(2) -0.09765
0.01985 0.01985
-4.282 -4.919
Variance-Covariance Matrix: ar(1) ar(2) ar(1) 0.0003941364 0.0000305258 ar(2) 0.0000305258 0.0003941364 Estimated innovations variance:
0.0002
Optimizer has converged Convergence Type: relative function convergence AIC: -14579.4258 > r1=m1$residuals > autocorTest(r1[3:2515],lag=10) Test for Autocorrelation: Ljung-Box Null Hypothesis: no autocorrelation Test Statistics: Test Stat 20.7425 p.value 0.0230 Dist. under Null: chi-square with 10 degrees of freedom Total Observ.: 2513 > r1=r1[3:2515] > archTest(r1,lag=10) Test for ARCH Effects: LM Test Null Hypothesis: no ARCH effects Test Statistics: Test Stat 757.1373 p.value 0.0000 Dist. under Null: chi-square with 10 degrees of freedom Total Observ.: 2513
We strongly reject the null hypothesis of no ARCH effects. The Q(10) statistic is huge with a p value close to zero. (b) Let Rts be the daily simple returns of the S&P index. The variance of the series can approximately be modeled as a GARCH(1,1). The innovations appear to have heavier tails than normal, and a scaled t-distribution is used instead.
49
Thus, the model for Rts is given by s s Rts = 0.00046 − 0.0602Rt−1 − 0.0504Rt−2 + at ,
σt2
= 5.76 × 10
−7
at = σt ǫt
2 + 0.0715a2t−1 + 0.9276σt−1
iid
where [ν/(ν − 2)]1/2 ǫt ∼ tν . The estimate of ν is 9.66 with standard error 1.48. The Splus output is given below. > m2=garch(sp~ar(2),~garch(1,1),cond.dist=’t’) > summary(m2) Conditional Distribution: t with estimated parameter 9.656801 and standard error 1.482693 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 4.646e-04 1.743e-04 2.665 7.747e-03 AR(1) -6.022e-02 2.212e-02 -2.722 6.534e-03 AR(2) -5.042e-02 2.016e-02 -2.501 1.244e-02 A 5.760e-07 2.706e-07 2.129 3.338e-02 ARCH(1) 7.154e-02 9.984e-03 7.166 1.011e-12 GARCH(1) 9.276e-01 9.799e-03 94.668 0.000e+00 -------------------------------------------------------------AIC(7) = -15766.56, BIC(7) = -15725.75 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 286.7 0 0.9886 2.807e-13 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 16.68 0.162 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 13.56 0.33 12 > p2=predict(m2,4) > names(p2) [1] "series.pred" "sigma.pred" "asymp.sd" > predict(m2,4) $series.pred: [1] -0.0016187301 -0.0001518297 0.0005553614 $sigma.pred: [1] 0.02867461 0.02867300 0.02867138 0.02866976
0.0004388058
(8.1) (8.2)
50 All parameters are significant at the 5% level. The residual analysis give p values of 0.16 and 0.33 for Q(12) of the standardized and squared standardized residuals, respectively. (c) Compute 1- to 4-step ahead forecasts of the simple return and its volatility based on the fitted model. Results are shown in Table 2 Table 2: Mean and standard deviation 1- to 4-step ahead forecasts for model (3) (in percentages). Horizon (ℓ) R̂ts (ℓ) σ̂t (ℓ)
1
2
3
4
-0.0016 0.0286
-0.0002 0.02867
0.0006 0.02867
0.0004 0.02867
13. Again, consider the daily simple returns of GM stock. (a) The fitted model is Rtg = 0.00078 − 0.481σt + at , σt2
= 1.1 × 10
−5
at = σt ǫt 2 2 + 0.0725at−1 + 0.9159σt−1
iid
where ǫt ∼ N (0, 1). The parameter estimates using S-Plus are > gm=da$gm > m1=garch(gm~1+var.in.mean,~garch(1,1)) > summary(m1) Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 0.0007784 6.557e-04 1.1871 0.2353 ARCH-IN-MEAN -0.4813894 8.732e-01 -0.5513 0.5815 A 0.0000110 1.025e-06 10.7304 0.0000 ARCH(1) 0.0725461 6.492e-03 11.1750 0.0000 GARCH(1) 0.9159180 5.972e-03 153.3658 0.0000 -------------------------------------------------------------AIC(5) = -11448.05, BIC(5) = -11418.9 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 2824 0 0.9624 4.53e-25 Ljung-Box test for standardized residuals: --------------------------------------------------------------
(9.1) (9.2)
51 Statistic P-value Chi^2-d.f. 14.46 0.2721 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 3.379 0.9922 12
All parameters of the volatility equation are significant, but those of the mean equation are not. (b) The EGARCH structure allows for asymmetric responses for negative an positive returns. The fitted model, as described in the book, is Rtg = −8.61 × 10−5 + σt ǫt |at−1 | − 0.5302at−1 2 ln(σt2 ) = −0.1973 + 0.12 + 0.985 ln(σt−1 ), σt−1 iid
where ǫt ∼ N (0, 1). The parameter estimates and residual analysis using Splus are shown below. > m3=garch(gm~1,~egarch(1,1),leverage=T) > summary(m3) Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C -8.609e-05 0.0004595 -0.1873 0.8514 A -1.973e-01 0.0180746 -10.9155 0.0000 ARCH(1) 1.203e-01 0.0113133 10.6329 0.0000 GARCH(1) 9.853e-01 0.0016503 597.0650 0.0000 LEV(1) -5.302e-01 0.0629702 -8.4201 0.0000 -------------------------------------------------------------AIC(5) = -11465.24, BIC(5) = -11436.09 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 2010 0 0.9661 6.808e-24 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 13.21 0.3537 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 6.067 0.9126 12
(10) (11)
52 All paramters of the volatility equation are significant. The leverage effect is indeed significant with a p value close to zero. Model checking indicates that the fitted model is adequate. 14. Let rt and rp,t be thedaily log returns,in percentages, of the GM stock and S&P 500 index, respectively. (a) The fitted AR(5)-GARCH(1,1) model for rp,t is rp.t = 0.057 − (0.063B + 0.050B 2 + 0.017B 3 + 0.018B 4 + 0.043B 5 )rp,t + a(12.1) t at = σts ǫt
(12.2)
σts 2
(12.3)
=
0.0070 + 0.0709a2t−1 + 0.9269σ s2t−1
iid
where ǫt ∼ ged, with estimated parameter 1.4952 (and standard error 0.0500.) The estimates, standard errors, and other statistics of the model are given below. > gm=log(da$gm+1)*100 > sp=log(da$sp+1)*100 > m1=garch(sp~ar(5),~garch(1,1),cond.dist=’ged’) > summary(m1) Conditional Distribution: ged with estimated parameter 1.495181 and standard error 0.05002465 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 0.056966 0.017446 3.2653 1.108e-03 AR(1) -0.062613 0.021538 -2.9072 3.679e-03 AR(2) -0.049834 0.019919 -2.5018 1.242e-02 AR(3) -0.016739 0.020070 -0.8340 4.043e-01 AR(4) -0.018054 0.019548 -0.9236 3.558e-01 AR(5) -0.043333 0.020037 -2.1626 3.066e-02 A 0.006983 0.002473 2.8238 4.783e-03 ARCH(1) 0.070875 0.010168 6.9701 4.033e-12 GARCH(1) 0.926851 0.010128 91.5094 0.000e+00 -------------------------------------------------------------AIC(10) = 7396.517, BIC(10) = 7454.817 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 308.2 0 0.9874 4.29e-14 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 11.83 0.4598 12 Ljung-Box test for squared standardized residuals: --------------------------------------------------------------
53 Statistic P-value Chi^2-d.f. 13.14 0.3587 12
The AR coefficients at lags 3 and 4 are insignificant, but all other parameters re significant at the 5% level. The Ljung-Box statistics for the standardized residuals and theri squared series give Q(12) = 11.83 and 13.14, respectively. The corresponding p values are 0.46 and 0.36 so that the model is adequate. (b) Estimate the following model in Splus fit = garch(gm ∼ 1, ∼garch(1,1)+spvol, cond.dist=’ged’) Write down the fitted model. Let σ̂ts be the estimated conditional standard deviation produced by the model described in (12.2)-(12.3). The fitted model is rt = −0.047 + at ,
σt2
=
at = σtg ǫt
2 0.0194 + 0.0675a2t−1 + 0.9254σt−1 + 0.0509σ̂ts
iid
(13.1) (13.2)
where ǫt ∼ ged, with estimated parameter 1.261 (and standard error 0.033.) The estimates, standard errors, and other statistics of the model are given below. > spvol=m1$sigma.t > m2=garch(gm~1,~garch(1,1)+spvol,cond.dist=’ged’) > summary(m2) Conditional Distribution: ged with estimated parameter 1.26079 and standard error 0.03306789 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C -0.04691 0.03770 -1.244 2.135e-01 A 0.01943 0.03114 0.624 5.327e-01 ARCH(1) 0.06747 0.01032 6.539 7.473e-11 GARCH(1) 0.92536 0.01076 85.985 0.000e+00 spvol 0.05090 0.04340 1.173 2.410e-01 -------------------------------------------------------------AIC(6) = 11505.93, BIC(6) = 11540.91 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 5682 0 0.9555 4.861e-27 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 16.19 0.1828 12 Ljung-Box test for squared standardized residuals: --------------------------------------------------------------
54 Statistic P-value Chi^2-d.f. 4.227 0.979 12
From the output, only the ARCH and GARCH parameters are significant at the 5% level. The standardrized residuals and their squared series have no serial correlations. (c) The inclusion of S&P volatility serves as a proxy for the market volatility. However, this market volatility does not contribute signficantly to the modeling of GM stock returns. 15. Again, consider the percentage daily log returns of GM stock and S&P 500 index from 1998 to 2008 as in Exercise 3.14, (a) Fit a GARCH(1,1) model with generalized error distribution to the percentage log returns of GM stock. Store the fitted volatility by gmvol, and denote the S&P returns by sp. The fitted model is rt = −0.044 + at ,
σt2
=
at = σtg ǫt
2 0.0495 + 0.0675a2t−1 + 0.9290σt−1
(14.1) (14.2)
iid
where ǫt ∼ ged, with estimated parameter 1.269 (and standard error 0.0326.) Next, consider the S&P 500 index returns. Let ẑt be the estimated conditional standard deviation produced by the model described in (14.1)-(14.2). The fitted model is rp,t = 0.0569 − (0.063B + 0.50B 2 + 0.17B 3 + 0.18B 4 + 0.43B 5 )rp,t + at , 2 σt2 = 0.0065 + 0.0708a2t−1 + 0.9268σt−1 − 0.0021ẑt iid
at =(15.1) σts ǫt (15.2)
where ǫt ∼ ged, with estimated parameter 1.497 (and standard error 0.050.) The estimates, standard errors, and other statistics of the model are given below. > m1=garch(gm~1,~garch(1,1),cond.dist=’ged’) Conditional Distribution: ged with estimated parameter 1.268922 and standard error 0.03259006 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C -0.04422 0.037635 -1.175 2.401e-01 A 0.04953 0.015706 3.153 1.633e-03 ARCH(1) 0.06750 0.009976 6.767 1.636e-11 GARCH(1) 0.92904 0.009817 94.633 0.000e+00 -------------------------------------------------------------AIC(5) = 11505.38, BIC(5) = 11534.53 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 5336 0 0.9565 8.944e-27 Ljung-Box test for standardized residuals:
55 -------------------------------------------------------------Statistic P-value Chi^2-d.f. 16.26 0.1797 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 4.208 0.9794 12 > gmvol=m1$sigma.t > m2=garch(sp~ar(5),~garch(1,1)+gmvol,cond.dist=’ged’) > summary(m2) Conditional Distribution: ged with estimated parameter 1.496586 and standard error 0.05013375 -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C 0.056937 0.017450 3.2629 1.118e-03 AR(1) -0.062571 0.021579 -2.8997 3.768e-03 AR(2) -0.049871 0.019941 -2.5009 1.245e-02 AR(3) -0.016804 0.020077 -0.8370 4.027e-01 AR(4) -0.017964 0.019561 -0.9184 3.585e-01 AR(5) -0.043312 0.020043 -2.1609 3.080e-02 A 0.006520 0.005353 1.2181 2.233e-01 ARCH(1) 0.070847 0.010166 6.9688 4.072e-12 GARCH(1) 0.926836 0.010182 91.0301 0.000e+00 gmvol 0.000211 0.002545 0.0829 9.339e-01 -------------------------------------------------------------AIC(11) = 7398.561, BIC(11) = 7462.691 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value 310.2 0 0.9874 4.111e-14 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 11.83 0.4598 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. 13.09 0.3628 12
As before, for the mean equation, AR coefficients at lags 3 and 4 are insignificant. For the volatility equation, the constant term and the cofficient of zt are insignifcant at the 5% level. Model checking indicates that the fitted model is adequate in describing the mean and volatility of the daily S&P 500 index returns. (b) Is the volatility of GM stock returns helpful in modeling the volatility of SP index
56 returns? Why? No, the estimate of the parameter of ẑt is not significantly different from zero, with a t-value of 0.083. Hence, the volatility of the GM returns does not have explanatory power in the market volatility (in this case the S&P volatility.)
Solutions to Exercises of Chapter 4 1. Part (a). If the GJR type of TGARCH models is used, we obtain rt = 0.0186 + at , σt2
at = σt ǫt
2 = 0.016 + 0.024a2t−1 + 0.117a2t−1 I(at−1 < 0) + 0.916σt−1
where ǫt are iid N(0,1) and I(at−1 < 0) is the indicator for at−1 < 0. All estimates, except the constant 0.0186, are significant at the 5% level. This model appears to be adequate with Q(10) = 15.20(0.12) and Q∗ (10) = 10.69(0.22) for the standardized residual series and its squared series, respectively. Part(b). For the general threshold volatility model, we obtain rt = −0.0308 + at ,
σt2
at = σt ǫt
2 2 )I(at−1 < 0), + (−0.078 + 0.095a2t−1 + 0.124σt−1 = 0.0517 + 0.0291a2t−1 + 0.866σt−1
where all estimates are significant at the 5% level. The standard errors of the estimates, in the order of appearance, are 0.0022, 0.0172, 0.0107, 0.0204, 0.0349, 0.0170, and 0.0379, respectively. Part (c). The two TGARCH models are different, but close. Both models indicate an IGARCH structure when at−1 < 0. Details of the output are given below: > setwd("C:/Users/rst/Documents/backup/fts3/data") > source("tgarch.R") > da=read.table("d-jnj9808.txt",header=T) > head(da) date rtn 1 19980102 -0.012334 > jnj=log(da$rtn+1)*100 > source("garchoxfit_R.txt") > m2=garchOxFit(formula.mean=~arma(0,0),formula.var=~gjr(1,1),series=jnj) ******************** ** SPECIFICATIONS ** ******************** Dependent variable : X Mean Equation : ARMA (0, 0) model. No regressor in the mean
57
58 Variance Equation : GJR (1, 1) model. No regressor in the variance The distribution is a Gauss distribution. Strong convergence using numerical derivatives Log-likelihood = -4516.29 Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.018565 0.019808 0.9372 0.3487 Cst(V) 0.016261 0.0042753 3.803 0.0001 ARCH(Alpha1) 0.023903 0.0097419 2.454 0.0142 GARCH(Beta1) 0.916212 0.011156 82.12 0.0000 GJR(Gamma1) 0.117253 0.017551 6.681 0.0000 No. Observations : 2767 Mean (Y) : 0.02873 Skewness (Y) : -0.36739 Log Likelihood : -4516.294
No. Parameters Variance (Y) Kurtosis (Y)
: : :
5 2.23731 13.99989
*********** ** TESTS ** *********** Statistic t-Test P-Value Skewness 0.0012683 0.027250 0.97826 Excess Kurtosis 1.8796 20.200 9.7775e-091 Jarque-Bera 407.31 .NaN 3.5830e-089 --------------Information Criterium (to be minimized) Akaike 3.268011 Shibata 3.268005 Schwarz 3.278719 Hannan-Quinn 3.271879 --------------Q-Statistics on Standardized Residuals Q( 10) = 15.2013 [0.1248923] Q( 15) = 18.4736 [0.2385876] Q( 20) = 30.9087 [0.0564069] H0 : No serial correlation ==> Accept H0 when prob. is High [Q < Chisq(lag)] -------------Q-Statistics on Squared Standardized Residuals --> P-values adjusted by 2 degree(s) of freedom Q( 10) = 10.6885 [0.2199801] Q( 15) = 13.6773 [0.3969538] Q( 20) = 16.1978 [0.5787472] H0 : No serial correlation ==> Accept H0 when prob. is High [Q < Chisq(lag)] -------------ARCH 1-2 test: F(2,2760)= 0.74677 [0.4740] ARCH 1-5 test: F(5,2754)= 1.3958 [0.2226] ARCH 1-10 test: F(10,2744)= 1.1223 [0.3409] **** **** TGARCH model > m1=tgarch(jnj)
59 Est: -0.03087511 0.0516869 0.02906084 0.8659186 -0.07807859 0.0948157 0.1243352 S.E.: 0.002239322 0.01722546 0.01073037 0.02036684 0.03491024 0.0170079 0.03789302 --------------
2. The GJR model obtained is rt = 0.971 + at , σt2
at = σt ǫt
2 = 2.00 + 0.087a2t−1 + 0.045a2t−1 I(at−1 < 0) + 0.856σt−1 ,
where the standard error of the mean return is 0.20 and standard errors of the volatility parameters are 0.732, 0.025, 0.025, and 0.035, respectively, and I(at−1 < 0) is an indicator variable for at−1 < 0. The ǫt follows a GED with parameter 1.547 (0.094). The asymmetry in volatility is not significant at the 5% level. The one-sided p value is 0.099. For model checking, the Q-statistics of the standardized residuals and squared standardized residuals give Q(10) = 11.43(0.32) and Q∗ (10) = 4.87(0.77). As usual, excess kurtosis remains high for the standardized residuals. Overall, the model is adequate. > da1=read.table("m-ge2608.txt",header=T) > ge=log(da1$rtn+1)*100 > m3=garchOxFit(formula.mean=~arma(0,0),formula.var=~gjr(1,1),series=ge, cond.dist="ged") ******************** ** SPECIFICATIONS ** ******************** Dependent variable : X Mean Equation : ARMA (0, 0) model. No regressor in the mean Variance Equation : GJR (1, 1) model. No regressor in the variance The distribution is a GED distribution, with a tail coefficient of 1.54746. Strong convergence using numerical derivatives Log-likelihood = -3316.03 Maximum Likelihood Estimation (Std.Errors based on Second derivatives) Coefficient Std.Error t-value t-prob Cst(M) 0.970603 0.19519 4.973 0.0000 Cst(V) 2.002579 0.73153 2.738 0.0063 ARCH(Alpha1) 0.086856 0.024836 3.497 0.0005 GARCH(Beta1) 0.856245 0.025258 33.90 0.0000 GJR(Gamma1) 0.044649 0.034687 1.287 0.1983 G.E.D.(DF) 1.547462 0.093854 16.49 0.0000 No. Observations : 996 Mean (Y) : 0.83317 Skewness (Y) : -0.25507 Log Likelihood : -3316.034
No. Parameters Variance (Y) Kurtosis (Y)
: : :
6 58.80616 8.11262
60 *********** ** TESTS ** *********** Statistic t-Test P-Value Skewness -0.21663 2.7953 0.0051854 Excess Kurtosis 1.3324 8.6050 7.6303e-018 Jarque-Bera 81.467 .NaN 2.0397e-018 --------------Information Criterium (to be minimized) Akaike 6.670751 Shibata 6.670679 Schwarz 6.700292 Hannan-Quinn 6.681981 --------------Q-Statistics on Standardized Residuals Q( 10) = 11.4317 [0.3248907] Q( 15) = 18.1674 [0.2539658] Q( 20) = 19.8359 [0.4682375] H0 : No serial correlation ==> Accept H0 when prob. is High [Q < Chisq(lag)] -------------Q-Statistics on Squared Standardized Residuals --> P-values adjusted by 2 degree(s) of freedom Q( 10) = 4.86953 [0.7714257] Q( 15) = 11.8206 [0.5424039] Q( 20) = 15.3860 [0.6353147] H0 : No serial correlation ==> Accept H0 when prob. is High [Q < Chisq(lag)] -------------ARCH 1-2 test: F(2,989) = 0.67214 [0.5108] ARCH 1-5 test: F(5,983) = 0.57184 [0.7216] ARCH 1-10 test: F(10,973)= 0.49855 [0.8916] -------------2 (1) = 47.54, and (b) for a 3. Simple calculation shows that (a) for a996 = −5.06, σ996 888 = 5.06, 2 σ996 (1) = 47.57. 2 (1) = 0.05(0.1 × 62 + 0.93 × 50) + 4. Simple calculation shows that for P (s100 = 2) = 1, σ100 2 0.95(4.24 + 0.1 × 6 + 0.78 × 50) = 47.00. For P (s100 = 2) = 0.8, we can use the prior result 2 (1) = 0.8 × 47.00 + 0.2[0.85(0.1 × 62 + 0.93 × 50) + 0.15(4.24 + and the model to obtain σ100 2 0.1 × 6 + 0.78 × 50)] = 45.04.
5. Consider the monthly simple returns of GE stock from 1926 to 2008. Use the last three years of data for forecasting evaluation. (a) Use lagged returns rt−1 , rt−2 , rt−3 as input, build a 3-2-1 feed-forward network to forecast 1-step ahead returns. Calculate the mean squared error of forecasts. We are using 960 observations to estimate the neural network. The final 36 will be used for prediction. Let hj be the jth node in the hidden layer. We have that X hj = fj α0,j + wi,j xi , i→j
61 where fj (z) is a linear function; and xi is the value of the ith input node; for j = 1, 2, and i = 1, 2, 3. Then, a 3-2-1 skip-layer feed-forward network is X X o = fo α0,o + αi,o xi + wj,o hj (16) i→o
j→o
for j = 1, 2, 3, and i = 1, . . . , 6; where fo (z) is also linear. The estimates for this model given by Splus are
a 3-2-1 network with 14 weights options were - skip-layer connections linear output units b->h1 i1->h1 i2->h1 i3->h1 0.27 -1.37 -2.59 -0.73 b->h2 i1->h2 i2->h2 i3->h2 -0.35 3.16 4.63 0.10 b->o h1->o h2->o i1->o i2->o i3->o 13.37 -20.44 -4.30 -3.60 -8.20 -3.58
where b → hj represents the constant α0,j , for j = 1, 2; ik → hj represents the weight wk,j , for j = 1, 2, and k = 1, 2, 3. Similarly, b → o is α0,o ; hj → o is wj,o , for j = 1, 2; and ik → o corresponds to αk,o , for k = 1, 2, 3. Let Rte represent the monthly simple return of GE stock. The mean squared error of the forecasts, using the final 36 observations is given by 36
1 X e e MSE = (RN +ℓ − R̂N (ℓ))2 = 0.00492. 36 ℓ=1
(b) Again, use lagged returns rt−1 , rt−2 , rt−3 and their signs (directions) to build a 6-5-1 feedforward network to forecast the 1-step ahead direction of GE stock price movement with 1 denoting up-ward movement. Calculate the mean squared error of forecasts. Note: Let rtn denote a time series in Splus. To create a direction variable for rtn, use the command below: drtn = ifelse(rtn > 0, 1, 0) As before, the model is X X o = fo α0,o + wj,o hj αi,o xi + (17) i→o
j→o
for j = 1, . . . , 5, and i = 1, . . . , 6; where fo (z) = exp(z)/(1 + exp(z)). The estimates for this model given by Splus are a 6-5-1 network with 47 weights options were - skip-layer connections b->h1 i1->h1 i2->h1 i3->h1 i4->h1 13.30 21.33 21.57 55.75 -3.75 b->h2 i1->h2 i2->h2 i3->h2 i4->h2
i5->h1 -34.86 i5->h2
i6->h1 6.11 i6->h2
62 -11.00 73.52 -55.41 -39.57 -6.51 28.83 5.50 b->h3 i1->h3 i2->h3 i3->h3 i4->h3 i5->h3 i6->h3 -12.67 131.63 -104.47 47.56 -12.10 45.61 -44.99 b->h4 i1->h4 i2->h4 i3->h4 i4->h4 i5->h4 i6->h4 -20.23 21.07 6.84 -11.36 -2.21 26.43 55.21 b->h5 i1->h5 i2->h5 i3->h5 i4->h5 i5->h5 i6->h5 -59.43 -36.45 30.63 -151.25 66.98 12.90 20.57 b->o h1->o h2->o h3->o h4->o h5->o i1->o i2->o 114.52 -114.00 -110.95 105.37 -105.13 104.13 8.51 -0.10
i3->o i4->o i5->o i6->o 1.43 -104.80 -3.60 105.47
where b → hj represents the constant α0,j , for j = 1, . . . , 5; ik → hj represents the weight wk,j , for j = 1, . . . , 5, and k = 1, . . . , 6. Similarly, b → o is α0,o ; hj → o is wj,o , for j = 1, . . . , 3; and ik → o corresponds to αk,o , for k = 1, . . . , 6. Note that the output o represents a probability of the direction of the GE return going up. Hence, even when the “true” response variable is either 0 or 1 (go up or down), the fitted values give the likelihood of such a movement to happen. Therefore, we must set a criterion to decide whether the answer means “it goes up” or “it goes down”. Let dˆ be the forecast direction of the return. A naı̈ve criterion is simply to set dˆ = 1 if o ≥ 0.5, and zero otherwise. The mean squared error of the forecasts is N
1 X (dN +ℓ − dˆN (ℓ))2 = 0.270 MSE = 36 ℓ=1
where d is the true direction. 6. We use the package TSA to answer this question. Use the command ar to identify an AR model for the data. We have an AR(11) for st and an AR(12) for s∗t series. [This is somewhat inconsistent, but we shall not pursue further. All models are just an approximation.] Apply the threshold nonlinearity tests of Tsay and Keenan to the AR models. We also apply the likelihood ratio test. The results are highly significant and summarized in the table. (a) The st series, p = 11, d = 1 Tsay test Keenan test Statistic 4.602 8.274 p-value 0.000 0.004 ∗ (b) The st series, p = 12, d = 1 Statistic 4.937 8.25 p value 0.000 0.004
Likelihood ratio 56.65 0.000 44.65 0.0007
The threshold will be estimated similar to other parameters. st series: A 2-regime TAR(11) model is selected. The threshold is −0.33 for the threshold variable st−1 . The estimates AR coefficients are > m5$qr1
63 $coefficients intercept-st lag1-st lag2-st -0.056728461 1.219941 -0.294520
lag3-st 0.009747
lag4-st lag5-st 0.14034 -0.32219
lag6-st 0.04721
lag7-st 0.11646
> m5$qr2$coefficients intercept-st lag1-st lag2-st lag3-st lag4-st lag5-st lag6-st lag7-st 0.003769613 1.19659 -0.18235 -0.03422 0.09781 -0.10450 -0.02184 -0.00142 lag8-st lag9-st lag10-st lag11-st 0.108549636 -0.086624832 -0.031657606 0.050387857
s∗t series: A 2-regime TAR(12) model is selected. The threshold is 0.11 for the variable s∗t−1 . Again,the fitted coefficients are > m6$qr1$coefficients intercept-st1 lag1-st1 lag2-st1 lag3-st1 lag4-st1 lag5-st1 lag6-st1 -0.0001920988 0.212456 -0.021989 0.019903 0.104044 -0.060451 -0.048207 lag7-st1 lag8-st1 lag9-st1 lag10-st1 lag11-st1 lag12-st1 -0.0572318635 0.042814 0.003645 -0.057454 -0.012875 0.076054 > m6$qr2$coefficients intercept-st1 lag1-st1 -0.02876035 0.39127789
64
Solutions to Exercises of Chapter 5 1. Yes, rto is serially correlated. Based on the result of Section 5.1, the first three lags of ACF are −9.95 × 10−4 , −5.97 × 10−4 , and −3.58 × 10−4 , respectively. 2. Based on the result of Section 5.2, the lag-1 ACF is −0.01515 when the tick size is $1/8 and it is −0.003876 when the tick size is $1/16. 3. In this solution, the number in parentheses next to a Q-statistic denotes the p value and that next to a coefficient denotes its standard error. Q∗ is the Q statistic for squared standardized residuals. Also, denote the adjusted duration as xt = ψt ǫt , where ψt = E(xt |Ft−1 ) is the conditional expectation of xt . (a) For EACD models, we obtain ψt = 0.063(0.022) + 0.091(0.014)xt−1 + 0.891(0.017)ψt−1 . The model is adequate with Q(10) = 8.65(0.57) and Q∗ (10) = 11.39(0.33). (b) For WACD models, we have ψt = 0.063(0.030)+0.088(0.019)xt−1 + 0.893(0.022)ψt−1 and the α for Weibull innovation is 0.867(0.025). See equation (5.55). The model is also adequate with Q(10) = 8.56(0.57) and Q∗ (10) = 11.23(0.34). (c) For GACD models, we obtain ψt = 0.068(0.038) + 0.083(0.021)xt−1 + 0.897(0.027)ψt−1 and the parameters for the generalized Gamma innovations are α = 0.327(0.109) and κ = 6.08(3.66). See equation (5.56). The estimate of κ is significant at the 10% level, but not at the 5% level. This model is also adequate with Q(10) = 8.39(0.59) and Q∗ (10) = 10.78(0.37). (d) The three models all fit the data well. The GACD model may be preferred because it has a more flexible hazard function. 4. (a) Yes, the diurnal pattern exists. The ACF of the nt series show a periodic pattern. See Figure 16. (b) Ignoring the time intervals between trades, we simply consider the series ri = ln(Pi ) − ln(Pi−1 ), where Pi is the ith transaction price as observed. This ri series has a negative lag-1 serial correlation of −0.28, which is highly significant. Thus, there is bid-ask bounce. Alternatively, one can employ the Decomposition model of Section 5.4.2 to verify the bid-ask bounce. (c) The frequency table is as follows
Size Freq.
5 30
4 45
Negative 3 2 137 800
1 3577
0 12163
1 3574
Positive 2 3 4 776 151 52
5 41
5. There are many ways to construct intraday 5-minute returns. This problem uses the average transaction price within each 5-minute bin to compute the returns. Alternatively, one can use the last transaction price within each 5-minute bin to compute the returns. The properties of the returns will depend on how the returns are constructed. 65
66 (a) Number of trades in 5-m intervals
n(t) 0 20 40 60 80
120
•
• • • • • • • • • ••• • •••• • • •••• • • • • • • • • ••••• • •• • • • • • •• •• ••••••••• ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• •••••••• •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• ••••••••••••••••••••••••••• ••••••••••••••••••••••••••••••••••••••• ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• • • •• 0
500
1000 time sequence
1500
-0.2
ACF 0.2 0.6
1.0
Series : x
0
50
100
150
Lag
Figure 16: (a) The number of trades in 5-minute intervals for 3M stock in December 1999. (b) The sample ACF of the nt series in part (a). Use the average transaction price of 5-minute bin: (a) Yes, the series is serially correlated with ρ1 = 0.30 and Q(10) = 172, which is highly significant. (b) Based on the result of Chapter 3, we compute the daily volatility in two ways. First, we simply use the sum of squares of intraday 5-minute log returns. This is equivalent to assuming the returns are independent (an assumption which is clearly violated here). Second, we assume the 5-minute log returns have a significant lag-1 serial correlation (an assumption which appears to be more reasonable here). Figure 17 shows the two volatility series. The series in part (b) of the figure is preferred. Use the last transaction price within each 5-minute bin. In this case, the 5-minute intraday log returns do not have significant serial correlation. Specifically, we have Q(10) = 12.4 with p-value 0.26. 6. The series is the average duration of 5-minute bin of adjusted durations of 3M stock in December 1999. the adjustment is based on the average of 10-minute bin across 22 trading days as described in the problem. (a) The adjusted series does not show any periodic pattern based on its sample ACF. Let xt be the adjusted duration series and write xt = ψt ǫt , where ǫt is a white noise series with E(ǫt ) = 1 and ψt = E(xt |Ft−1 ). The usual notation as before is used. (b) The fitted EACD model is ψt = 0.159(0.108) + 0.123(0.049)xt−1 + 0.809ψt−1 . The model gives Q(10) = 9.08(0.52) and Q∗ (10) = 2.54(0.99). However, there is significant serial correlation at lag-18 for both residual series. (b) The fitted WACD model is ψt = 0.048(0.009) + 0.120(0.006)xt−1 + 0.861(0.005)ψt−1 with α = 1.929(0.024) and Q(10) = 14.15(0.17) and Q∗ (10) = 4.56(0.92). Again, lag-18 ACF of the standardized residual series is significant. (d) The fitted GACD model is ψt = 0.309(0.069) + 0.109(0.0147)xt−1 + 0.752(0.040)ψt−1 with α = 0.298(0.070) and κ = 53.58(19.52). The model gives Q(10) = 7.26(0.70) and Q∗ (10) = 1.58(0.998). Similarly to the other models, the standardized residual series has a significant
67 (a) Under independence 0.0003
• •
0.0001
vol
•
• •
•
•
•
•
•
•
•
•
•
•
• •
• •
•
•
•
10
20 day
vol 0.00010.00030.0005
(b) Assuming lag-1 dependence • •
• •
•
• •
• •
•
•
•
•
•
• •
• •
•
•
•
• 10
20 day
Figure 17: Daily volatility series of 3M stock in December 1999 based on intraday 5-minute log returns. (a) Assume the 5-minute returns are independent. (b) Assume the 5-minute returns have lag-1 serial correlation. serial correlation at lag 18. (e) Among the three models entertained, the WACD model is easy to estimate whereas the GACD model requires decent initial values to achieve convergence. 7. Let Nt be the number of transactions of the Boeing (BA) stock at time t (in the tth fiveminute interval). Figure 7(a) shows the time plot of the Nt series and Figure 7(b) shows the sample ACF of Nt . From the two plots, there is diurnal pattern in the Nt series. The ACF shows a period of 78 and the time plot shows a daily pattern. 8. Let rt be the intraday 5-minute log returns of the BA stock from December 01 to December 05, 2008. Figure 8(a) shows the time plot of the return series whereas Figure 8(b) shows the time plot of the price series. Based on the Ljung-Box statistics, there are serial correlations in the 5-minute return series at the 5% level, but not at the 1% level. Speifically, we have Q(10) = 21.81 with p value 0.016. > Box.test(rtn,lag=10,type=’Ljung’) Box-Ljung test data: rtn X-squared = 21.8129, df = 10, p-value = 0.01609
9. Now let rt be the intraday 10-minute log returns of the BA stock from December 01 to December 05, 2008. Figure 9(a) shows the time plot of the returns and Figure 9(b) shows the time plot of the price series. Based on the Ljung-Box statistics, the 10-minute return series has no serial correlations. Specifically, we have Q(10) = 7.46 with p value 0.68. > Box.test(rtn,lag=10,type=’Ljung’)
68
500 1500
counts
Time plot of number of transactions
0
100
200
300
400
Index
0.4 0.8 −0.2
ACF
Series counts
0
50
100
150
200
Lag
Figure 18: Number of transactions of BA stock in five-minute intervals from December 1st to December 5, 2008: (a) time series plot of Nt ; (b) ACF of Nt .
−0.010 0.005
returns
(a) 5−minute intraday returns
0
100
200
300
400
300
400
index
39 37
price
41
(b) price
0
100
200 index
Figure 19: Intraday 5-minute log returns of Boeing (BA) stock from December 1 to December 5, 2008: (a) time series plot of log returns; (b) price series.
69
0.01 −0.01
returns
(a) 10−minute intraday returns
0
50
100
150
index
39 37
price
41
(b) price
0
50
100
150
200
index
Figure 20: Intraday 10-minute log returns of BA stock from December 1 to December 5, 2008: (a) time series plot of log returns; (b) price series.
Box-Ljung test data: rtn X-squared = 7.4638, df = 10, p-value = 0.681
10. Let ci = Pi − Pi−1 be the price change from (i − 1)th to ith transaction within a trading day. Overnight price change is ignored. For the BA stock from December 1 to December 5, 2008, there are 224,326 transations. We tabulate the percentage of ci = 0. The result is 128013/224321= 0.57067 ≈ 57%. Note that we assume that the ordering of the transactions occurred in the same second as proper in the above calculation.
70
Solutions to Exercises of Chapter 6 1. The price is Pt = exp(pt ). Taking partial derivatives, we have ∂Pt = 0, ∂t By Ito’s lemma,
∂Pt = exp(pt ) = Pt , ∂pt
∂Pt2 = Pt . ∂p2t
1 dPt = (Pt γ + Pt σ 2 )dt + Pt σdwt . 2
That is,
σ2 )Pt dt + σPt dwt . 2
dPt = (γ + 2. Taking the partial derivatives, we have
∂Ft,T = er(T −t) , ∂Pt
∂Ft,T = −rPt er(T −t) , ∂t
∂ 2 Ft,T = 0. ∂Pt2
By Ito’s lemma, dFt,T
= (er(T −t) µPt − rPt er(T −t) )dt + σPt er(T −t) dwt
= (µ − r)Pt er(T −t) dt + σPt er(T −t) dwt = (µ − r)Ft,T dt + σFt,T dwt .
3. Use the result of Subsection 6.3.4. 0.02215 σ̂ = p = 0.352 = 35.2%, 1/252
µ̂ =
0.00131 σ̂ 2 + = 0.392 = 39.2%. 1/252 2
4. Apply the Black-Scholes pricing formula. (a) Price of a call option with strike price $125 is ct = $10.71. (b) Price of a put option with strike price $118 is pt = $9.82. (c) If the volatility is increased to 80%, then the call option becomes ct = $17.86 and the put option becomes pt = $16.75. 5. A simple approach to obtain the marginal effects is to make use of the put-call parity and the marginal effects on the call option discussed in Subsection 6.6.3.1. More specifcally, we have • Current stock price Pt : pt is negatively related to ln(Pt ). In particular, pt → K exp[−r(T − t)] as Pt → 0 and pt → 0 as Pt → ∞. 71
72 • Strike price K: pt is positively related to ln(K). In particular, pt → 0 as K → 0 and pt → ∞ as K → ∞. • Time to expiration T −t: The effect is relatively complicated. If Pt < K, then pt → K−Pt as T − t → 0. If Pt > K, then pt → 0 as T − t → 0. Also, pt → 0 as T − t → ∞. • Volatility: If ln(Pt /K) + r(T − t) < 0, then pt → K exp[−r(T − t)] − Pt as σ → 0. If ln(Pt /K) + r(T − t) > 0, then pt → 0 as σ → 0. Also, pt → K exp[−r(T − t)] as σ → ∞. • Interest rate: pt is negatively related to r. In particular, pt → 0 as r → ∞. 6. Apply the formulas in Section 6.4 E(PT ) = 60 exp[0.2 × 2] = 89.51
Var(PT ) = 3600 exp(2 × 0.2 × 2)[exp(0.16 × 2) − 1] = 3021.53. The standard error is 54.97. Therefore, the 95% confidence interval is 89.51 ± 1.96 × 54.97, which gives approximately (0,197.25). 7. Again, apply the result of Section 6.4 r ∼ N [(0.2 − The standard deviation is
√
0.16 0.16 ), ] = N (0.12, 0.08). 2 2
0.08 = 0.283.
8. Applying the pricing formula of Kou, we obtain ct = $3.39,
and pt = $6.90.
These quantities are obtained by truncating the summation at 10 terms. 9. The lower bound of the call option is $[20 − 18 exp(−0.06 × 0.5)] = $2.53, which is greater than the call price of $2.10. An arbitrageur can buy the call option and short the stock. This provides a net cash inflow of $(20-2.10) = $17.90. If investigated, this amount grows to $17.90exp(−0.06 × 0.5) = $18.45. Six months later, the option expires. If PT > $18, the arbitrageur exercises the option, closes out the short position, and makes a profit of $(18.45-18.00) = $0.45. If PT < $18, the arbitrageur buys the stock in the market to close out the short position and makes an even greater profit. For example, if the stock price is $17, then the profit is $(18.45-17) = $1.45. 10. The lower bound of the put price is $[47 exp(−0.06 × 0.5) − 44] = $1.61, which is greater than put price of $1.00. An arbitrageur can borrow $45.00 for six months to buy both the put and the stock. At the end of six months, the arbitrageur repays the loan at $45exp(0.06 × 0.5) = $46.37. If PT < $47, the arbitrageur exercises the option to sell the stock for $47, repays the loan, and makes a profit of $(47-46.37) = $0.63. If PT > $47, the arbitrageur discards the option, sells the stock to repay the loan and makes an even greater profit. For example, if PT = $48, then the profit becomes $(48-46.37) = $1.63.
Solutions to Exercises of Chapter 7 I used the package evir in R to answer most of the exercises. For non-homogeneous Poisson models and the estimation of extremal index, I used a Fortran program and a R script, respectively. For RiskMetrics, I used G@RCH of OX to estimate the β parameter of the special IGARCH(1,1) model and a R script to calculate the volatility series. These R scripts are written by myself. In the solutions, the number in parentheses next to an estimate denotes standard error, except for Q-statistic where the number is the p value. 1. The GE log return series has 2767 observations. 2 + (a) Riskmetrics: The fitted model is rt = at = σt ǫt with ǫt ∼iid N (0, 1) and σt2 = 0.96σt−1 2 2 0.04a2t−1 . Since σ2767 = 0.002551 and r2767 = 0.023736, we have σ2767 (1) = 0.002472. Therefore, 1% VaR for the log returns is 0.115654. The 1% VaR for the position is $115,654. The corresponding 15-day VaR is $447,929.
(b) We started with an AR(2)+GARCH(1,1) model, but found that the AR coefficients are insignificant at the 5% level. Therefore, an ARMA(0,0)+GARCH(1,1) model is used. The fitted model is rt = 3.93 × 10−4 + at = µ + σt ǫt ,
σt2
= 5.3 × 10
−7
ǫt ∼iid N (0, 1) 2 2 + 0.0516at−1 + 0.95σt−1 .
The constants of both equations are insignificant and the fitted volatility model is close to an IGARCH(1,1) model. Model checking shows Q(10) = 7.32(0.70) and Q∗ (10) = 8.53(0.58) for the standardized residuals and their squared process, where p values are in parentheses. The 1% VaR for log return is 0.11506 so that 1% VaR for the position is $115,060. The corresponding 15-day VaR is $444,436. (c) Student-t innovations: The fitted model is rt = 2.36 × 10−4 + at ,
at = σt ǫt
ǫt ∼iid t∗7.63
2 σt2 = 5.71 × 10−7 + 0.0495a2t−1 + 0.9513σt−1 .
Again, the constant terms of the two equations are insignificant at the 5% level and the volatility equation is close to IGARCH(1,1). Model checking shows Q(10) = 7.36(0.69) and Q∗ (10) = 9.04(0.53) for the standardized residuals and their squared series. Thus, the model is adequate. 73
74 The 1% VaR for the log returns is 0.123676. Therefore, the 1% VaR for the position is $123,676. The 1% VaR for the next 15 trading days is $478,747. (d) Using the generalized extreme value theory with block of size 21, we obtain xi = 0.327 (0.089), sigma = 0.0124(0.001), and mu = 0.0213(0.001), where the number in parenthesis denotes standard error. The 1% VaR for the log return is 0.046440. This gives 1% VaR of the position being $46,440 and the 15-day VaR being $112,469. In this particular instance, the GEV gives a substantially lower VaR. A careful study indicates that the high VaR of the GARCH modeling is due to the higher volatility in 2008 caused by the financial crisis. The GEV approach does not consider the time effect. > m2=garchFit(~arma(0,0)+garch(1,1),data=ge,trace=F) > summary(m2) Error Analysis: Estimate Std. Error t value Pr(>|t|) mu 3.930e-04 2.459e-04 1.598 0.1100 omega 5.304e-07 2.730e-07 1.943 0.0521 . alpha1 5.155e-02 7.495e-03 6.878 6.07e-12 *** beta1 9.503e-01 7.054e-03 134.706 < 2e-16 *** --Log Likelihood: 7493.64 normalized: 2.708218 Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test LM Arch Test
R R R R R R^2 R^2 R^2 R
Chi^2 W Q(10) Q(15) Q(20) Q(10) Q(15) Q(20) TR^2
Statistic p-Value 756.334 0 0.9814224 0 7.318965 0.6950284 17.24196 0.3046071 22.5779 0.3099926 8.528943 0.5773134 12.77488 0.619681 18.12964 0.5788687 11.19658 0.5121508
Information Criterion Statistics: AIC BIC SIC HQIC -5.413546 -5.404980 -5.413550 -5.410452 > m2p=predict(m2,15) > m2p meanForecast meanError standardDeviation 1 0.0003929826 0.04962843 0.04962843 2 0.0003929826 0.04967866 0.04967866 3 0.0003929826 0.04972892 0.04972892 4 0.0003929826 0.04977922 0.04977922 5 0.0003929826 0.04982956 0.04982956 6 0.0003929826 0.04987994 0.04987994
75 7 0.0003929826 0.04993036 0.04993036 8 0.0003929826 0.04998083 0.04998083 9 0.0003929826 0.05003133 0.05003133 10 0.0003929826 0.05008187 0.05008187 11 0.0003929826 0.05013246 0.05013246 12 0.0003929826 0.05018308 0.05018308 13 0.0003929826 0.05023374 0.05023374 14 0.0003929826 0.05028445 0.05028445 15 0.0003929826 0.05033519 0.05033519 > names(m2p) [1] "meanForecast" "meanError" "standardDeviation" > sd1=m2p$meanError > sum(sd1^2) [1] 0.03747252 > sqrt(sum(sd1^2)) [1] 0.1935782 > sum(m2p$meanForecast) [1] 0.005894738 > > v2=0.000393-2.326348*0.04962843 > v2 [1] -0.11506 > abs(v2)*1000000 [1] 115060 > v215=0.005894738-2.326348*0.1935782 > v215 [1] -0.4444355 > abs(v215)*1000000 [1] 444435.5 > m3=garchFit(~arma(0,0)+garch(1,1),data=ge,cond.dist="std",trace=F) > summary(m3) Error Analysis: Estimate Std. Error t value Pr(>|t|) mu 2.362e-04 2.366e-04 0.998 0.3182 omega 5.714e-07 3.311e-07 1.726 0.0844 . alpha1 4.952e-02 9.062e-03 5.465 4.64e-08 *** beta1 9.513e-01 8.733e-03 108.931 < 2e-16 *** shape 7.633e+00 9.827e-01 7.768 7.99e-15 *** --Log Likelihood: 7555.805 normalized: 2.730685 Standardised Residuals Tests: Jarque-Bera Test Shapiro-Wilk Test Ljung-Box Test Ljung-Box Test Ljung-Box Test Ljung-Box Test
R R R R R R^2
Chi^2 W Q(10) Q(15) Q(20) Q(10)
Statistic p-Value 761.861 0 0.9813362 0 7.364372 0.6906561 17.21996 0.3058864 22.56044 0.3108895 9.040041 0.5283078
76 Ljung-Box Test Ljung-Box Test LM Arch Test
R^2 R^2 R
Q(15) Q(20) TR^2
13.24171 18.64714 11.73313
0.5836343 0.5448574 0.4673435
Information Criterion Statistics: AIC BIC SIC HQIC -5.457756 -5.447048 -5.457762 -5.453888 > m3p=predict(m3,15) > m3p meanForecast meanError standardDeviation 1 0.000236182 0.04929286 0.04929286 2 0.000236182 0.04931848 0.04931848 3 0.000236182 0.04934411 0.04934411 4 0.000236182 0.04936975 0.04936975 5 0.000236182 0.04939540 0.04939540 6 0.000236182 0.04942105 0.04942105 7 0.000236182 0.04944671 0.04944671 8 0.000236182 0.04947237 0.04947237 9 0.000236182 0.04949805 0.04949805 10 0.000236182 0.04952373 0.04952373 11 0.000236182 0.04954941 0.04954941 12 0.000236182 0.04957511 0.04957511 13 0.000236182 0.04960081 0.04960081 14 0.000236182 0.04962652 0.04962652 15 0.000236182 0.04965224 0.04965224 > sum(m3p$meanForecast) [1] 0.00354273 > sqrt(sum(m3p$meanError^2)) [1] 0.1916064 > > v3=-.000236+qt(.99,7.63)/sqrt(7.65/5.63)*0.04929286 > v3 [1] 0.1236761 > v315=-0.00354273+qt(.99,7.63)/sqrt(7.63/5.63)*0.1916064 > v315 [1] 0.4787473
2. Consider the daily log returns of Cisco Systems stock from 1998 to 2008 with 2767 observations. Let rt be the log return. The model built for each approach and the 1% VaR are given below: (a) RiskMetrics: rt = σt ǫt with ǫt ∼iid N (0, 1) and
2 σt2 = (1 − 0.964)a2t−1 + 0.964σt−1 ,
where the standard error of 0.964 is 0.0051. The 1% VaR of the log return is 0.09083546 so that 1% VaR for the position is $90,835. (b) ARMA-GARCH: rt = 9.77 × 10−4 + at , where the standard error of the constant is 4.15 × 10−4 and at = σt ǫt with ǫt ∼ N (0, 1). The volatility equation is 2 σt2 = 7.99 ×−6 +0.0743a2t−1 + 0.9184σt−1 ,
77 where the standard errors of the estimates are 2.49 × 10−6 , 0.0145 and 0.0157, respectively. For model checking, we obtain Q(10) = 10.02(0.44) and Q∗ (10) = 3.73(0.96) for the standardized residuals and their squared series, respectively. The 1% VaR for the log return is 0.070335 so that VaR for the position is $70,335. (c) ARMA-GARCH with t innovations: rt = 6.788 × 10−4 + at , where the standard error of the estimate is 3.82 × 10−4 and at = σt ǫt with ǫt ∼iid t∗6.40 . The standard error of the degrees of freedom is 0.677. The volatility equation is 2 σt2 = 9.79 × 10−7 + 0.0371a2t−1 + 0.963σt−1 ,
where the standard errors of the estimates are 7.54 × 10−7 , 0.0067 and 0.0065. For model checling, we obtain Q(10) = 11.48(0.32) and Q∗ (10) = 4.58(0.92) for the standardized residuals and their squared series. The 1% VaR for the log return is VaR = 0.1205166 so that the 1% VaR of the financial position is $120,517. (d) The empirical 99% quantile of negative log returns is 0.08696. The 1% VaR for the financial position is $86,960. (e) For homogeneous model, the estimates are xi = 0.0696(0.0492) and 0.01959(0.0013). The number of exceedances is 540. The xi parameter is not singificant at the 5% level. Model cheking plots are shown in Figure 21. The 1% VaR for the negative log return is 0.084664 so that the 1% VaR of the position is $84,664. (f) Denote the three regressors by x1t , x2t , and x3t , respectively. For non-homogeneous model, we obtain βt = 2.762(0.451) + 2.053(0.138)x3t ln(αt ) = 0.400(0.112) + 0.260(0.111)x2t ξt = 0.185(0.044) + 0.097(0.051)x2t − 0.0768(0.0076)x3t where the number of exceedances is 540. The fitted model is adequate and is slightly better than the homogeneous case. Figure 22 shows the model checking plots. The 1% VaR of the percentage log return is 7.6360 so that the 1% VaR of the position is $76,360. (g) Using the same notation as Part (f), we obtain the models for 2.5% threshold. The model is βt = 2.538(0.508) + 2.173(0.155)x3t ln(αt ) = 0.488(0.135) + 0.310(0.126)x2t ξt = 0.225(0.058) + 0.119(0.059)x2t − 0.078(0.009)x3t where the number exceeding the threshold is 420. The fitted model is adequate and is slightly better than that of the 2% case. The two models, however, are close. The 1% VaR of the percentage log return is 7.80367 so that the 1% VaR of the financial position is $78,0367.
0.02
0.05
0.10
0 1 2 3 4 5
Residuals
0.0 0.2 0.4 0.6 0.8 1.0
Fu(x−u)
78
0.20
0
100
200
0.05
400
500
0.10
4
5
0 1 2 3 4 5 6 7
Exponential Quantiles
1e−01 5e−03 0.02
300
Ordering
1e−04
1−F(x) (on log scale)
x (on log scale)
0.20
0
1
2
x (on log scale)
3
Ordered Data
Figure 21: Model checking plots for homogeneous model: (a) Excess distribution, (b) Tail of the underlying distribution, (c) scatterplot of residuals and (d) QQ-plot of residuals.
prob plot 8
0.3
ACF of z stat acf −0.3 −0.1 0.1
6
•
0
2
z3 4
•
2
4
6 lag
8
10
••
•
•••• • ••••••• •••••••••••••• •••••••••• •••••••••• • • • • • • • • • •••••••••••••• ••••••••••••• •••••••••••••• ••••••••••••
0
2
4
6
exp
•
0
2
acf −0.3 −0.1 0.1
w3 4 6
8
0.3
ACF of w stat
2
4
6 lag
8
10
•• • • ••••• •••••• • • • • • • • • • •• •••••••• •••••••• •••••••••••• •••••••••••• •••••••••••••• • • • • • • • • • • • ••••• ••••••••••••
0
2
4
••
•
•
6
exp
Figure 22: Model checking plots for nonhomogeneous model with threshold 2%: (a) ACF of zi , (b) ACF of wi , (c) QQ-plot of zi and (d) QQ-plot of wi .
79
0.0999
0.0607
15
81
0.0454
0.0381
0.0330
0.0288
0.0255
0.0225
0.1 0.3 0.5
xi (CI, p =0.95)
Threshold
48
119
162
205
248
291
334
377
420
463
Order Statistics
0.0564
15
81
0.0453
0.0381
0.0327
0.0286
0.0259
0.0225
0.1 0.3 0.5
xi (CI, p =0.95)
Threshold 0.1090
48
119
162
205
248
291
334
377
420
463
Order Statistics
Figure 23: Estimate of tail index for daily log returns, in percentage, of Cisco Syatems stock. The two dashed lines indicate two standard error limit. The sample period is 1998-2008 (inclusive). Upper plot is for the left tail. 3. The Hill estimates are shown in Figure 23. The estimate is descreasing as q increases. The plot shows that the estimates are relatively stable for q around 150. In fact, estimate of the index is around 0.3 for 100 ≤ q ≤ 250. q 4. To compute the VaR of the portfolio, we use VaR = VaR21 + VaR22 + 2ρVaR1 VaR2 , where ρ is the sample correlation between the two log returns. For daily log returns of HPQ stock and S&P 500 index, the correlation is 0.561. The returns used in the analysis are in percentages. (a) The α coefficient for log returns of HPQ stock is 0.9959(0.0016) and that of SP 500 index is 0.9430(0.0058). For HPQ, the last observed log return is 0.2759 and the fitted conditional variance is 12.77. The variance prediction is 12.596. Therefore, we have VaR1 = $82,565. For the SP 500 index, the last data point is 1.406 with fitted σ 2 being 10.669. The variance prediction is 10.174. Thus, we have VaR2 = $74,202. The overall VaR is $138,554. (b) The fitted GARCH model for HPQ stock is rt = 0.0740(0.0419) + at and 2 σt2 = 0.017(0.005) + 0.0206(0.0028)a2t−1 + 0.9776(0.0030)σt−1
with Q(10) = 15.32(0.12) and Q∗ (10) = 2.39(0.99). The prediction of the mean return and volatility are 0.0740 and 3.6989, respectively. This gives 1% VaR = $85,309. For the S&P 500 index, the model is rt = 0.0259(0.0172) + at and 2 σt2 = 0.0121(0.0033) + 0.0783(0.0093)a2t−1 + 0.9157(0.0100)σt−1
with Q(10) = 14.10(0.17) and Q( 10) = 14.64(0.15). Also, from the fitted model, the prediction for the mean and volatility are 0.0259 and 2.664, respectively. The VaR is
80 $61,714. Combining the VaRs, we obtain overall VaR = $130,359. This is close to that of part (a), which is expected as the fitted models are close to an IGARCH(1,1) model for the two log return series. (c) We fitted the nonhomogeneous models with threshold 2.5%. Denote the four explanatory variables listed in the problem as xit for i = 1, 2, 3, 4. For instance, x1t is the annual time trend and x4t is the fitted volatility of the value-weighted index returns. The final model obtained is βt = 8.795(0.283) + 0.856(0.191)x2t − 0.825x3t
ln(αt ) = 1.730(0.168) − 0.834(0.282)x4t
ξt = 0.371(0.071) − 0.287(0.110)x4t .
Model checking plots indicate that the fitted model is reasonable. From the fitted model, it is seen that the tail index parameter and the scale parameter of the left tail of HPQ stock returns depend on the volatility of the value-weighted idnex return. However, the location parameter depends significantly on the S&P return volatility. Overall, market volatility is helpful in modeling the HPQ tail behavioe. The time trend has no effects on the tail behavior of the HPQ stock returns. The predicted volatility of HPQ stock, S&P index return, and value-weighted index return are 3.6989, 2.6640 and 2.5614, respectively. Therefore, the parameters of the extreme distribution are β = 9.7635, α = 0.6662 and ξ = −0.3641. The 1% VaR is $90,268 for the HPQ position. 5. Focus on the daily negative log returns of AA stock from 1998 to 2008 for 2767 observations. The returns are in percentages. The package evir of R is used. (a) There are 132 subperiods of 21 trading days. The parameter estimates (standard errors) are ξ = 0.1972(0.0684), σ = 1.4459(0.1122), µ = 3.2745(0.1420) The plots are given in Figure 24. (b) The return level is 9.61% with interval [8.2596,11.9767]. (c) The mean excess plot is given in Figure 25. (d) With threshold 3.5%, there are 186 exceedances out of 2767 data points. The parameter estimates (standard errors) are ξ = 0.2532(0.0875) and β = 1.5206(0.1713). (e) The diagnostic plots of the fitted GPD are given in Figure 26. (f) Based on the fitted model, the VaR and Expected shortfall for the percentage log returns are > riskmeasures(m2,c(.99,.999)) p quantile sfall [1,] 0.990 7.223431 10.52170 [2,] 0.999 14.922546 20.83081 6. Focus on the daily log returns, in percentages, of AA stock from 1998 to 2008. (a) There are 132 subperiods of 21 trading days. The parameter estimates (standard errors) are ξ = 0.1871(0.0636), σ = 1.5469(0.1178), µ = 3.5306(0.1505). The plots are given in Figure 27.
3 0
0
1
1
2
3 2
Residuals
4
Exponential Quantiles
4
5
5
6
81
0
20
60
100
0
Ordering
1
2
3
4
5
6
Ordered Data
15 10
Mean Excess
4 3 0
1
5
2
Exponential Quantiles
5
6
20
Figure 24: Diagnostic plots of GEV fit to daily negative log returns, in percentages, of AA stock: (a) scatterplot of residuals, (b) QQ-plot of residuals
5
10 Ordered Data
15
−20
−10
0
5
15
Threshold
Figure 25: QQ-plot of daily negative AA log returns with threshold 2.5% and the mean excess plot of the data.
3 2 0
1
Residuals
4
0.0 0.2 0.4 0.6 0.8 1.0
Fu(x−u)
82
5
10
15
20
0
50
10
15
150
0 1 2 3 4 5 6
Exponential Quantiles 5
100 Ordering
2e−04 2e−03 2e−02
1−F(x) (on log scale)
x (on log scale)
20
x (on log scale)
0
1
2
3
4
Ordered Data
Figure 26: Diagnostic plots of GPD fit to the daily negative log returns of AA stock, the threshold is 3.5%. (b) The return level is 10.17% with interval [8.795, 12.593]. (c) The mean excess plot is given in Figure 28. (d) With threshold 3.5%, there are 265 exceedances out of 2767 data points. The parameter estimates (standard errors) are ξ = 0.2094(0.0687) and β = 1.4401(0.0.1315). a heavy right tail. Other threshold value should be used. (e) The diagnostic plots of the fitted GPD for the log returns of AA stock are given in Figure 29. (f) The VaR and Expected shortfall based on the fitted GPD are > riskmeasures(m4,c(.99,.999)) p quantile sfall [1,] 0.990 7.160495 10.08360 [2,] 0.999 13.998298 18.73198 7. Focus on the daily negative log returns of S&P 500 Composite Index (SPX). The returns are in percentage and the sample span is from 1998 to 2008 for 2767 observations. (a) There are 132 subperiods of 21 trading days. The parameter estimates (standard errors) are ξ = 0.2832(0.0779), σ = 0.7524(0.0617), µ = 1.5387(0.0753). The plots are given in Figure 30. (b) The return level is 5.1758% with interval [4.3383,6.7598]. (c) The mean excess plot is given in Figure 31. (d) With threshold 2.5%, there are 84 exceedances out of 2767 data points. The parameter estimates (standard errors) are ξ = 0.3893(0.1717) and β = 0.8033(0.1598).
3 0
0
1
1
2
3 2
Residuals
4
Exponential Quantiles
4
5
5
6
83
0
20
60
100
0
1
Ordering
2
3
4
5
6
Ordered Data
6 4 2 0
Exponential Quantiles
Figure 27: Diagnostic plots of GEV fit to daily log returns, in percentages, of AA stock: (a) scatterplot of residuals, (b) QQ-plot of residuals
5
10
15
20
10 15 5
Mean Excess
Ordered Data
−15
−10
−5
0
5
10
15
Threshold
Figure 28: QQ-plot of daily AA log returns with threshold 2.5% and the mean excess plot of the data.
5
10
0 1 2 3 4 5 6
Residuals
0.0 0.2 0.4 0.6 0.8 1.0
Fu(x−u)
84
20
0
50
100
10
200
250
20
x (on log scale)
5
6
0 1 2 3 4 5 6
Exponential Quantiles
5e−02
5
150
Ordering
5e−05 1e−03
1−F(x) (on log scale)
x (on log scale)
0
1
2
3
4
Ordered Data
Figure 29: Diagnostic plots of GPD fit to the daily log returns of AA stock from 1998 to 2008. (e) The diagnostic plots of the fitted GPD are given in Figure 32. (f) The VaR and Expected shortfall based on the fitted GPD are > riskmeasures(m2,c(.99,.999)) p quantile sfall [1,] 0.990 3.615857 5.64231 [2,] 0.999 8.227753 13.19366 8. Focus on the daily log returns of GE stock from 1998 to 2008. For the positive log returns, (1) (3) (1) (3) we have θ̂b = 0.8942 and θ̂r = 0.5388 for block size k = 5, and θ̂b = 0.7757 and θ̂3 = (1) (3) 0.2864 for block size 10. For the negative log returns, we have θ̂b = 0.7918 and θ̂3 = 0.4527 (1) (3) for block size k = 5, and θ̂b = 0.6396 and θ̂r = 0.2687 for block size k = 10.
0
3 0
1
2
Exponential Quantiles
3 1
2
Residuals
4
4
5
5
85
0
20
60
100
0
Ordering
1
2
3
4
5
Ordered Data
0 1 2 3 4 5
Exponential Quantiles
Figure 30: Diagnostic plots of GEV fit to daily negative log returns, in percentages, of S%P 500 index: (a) scatterplot of residuals, (b) QQ-plot of residuals
3
4
5
6
7
8
9
2 4 6 8
Mean Excess
Ordered Data
−10
−5
0
5
Threshold
Figure 31: QQ-plot of daily negative SPX log returns with threshold 2.5% and the mean excess plot of the data.
2 0
1
Residuals
3
0.0 0.2 0.4 0.6 0.8 1.0
Fu(x−u)
86
4
6
8
10
14
0
20
40
60
80
4 3 2 0
1
2e−03
Exponential Quantiles
5
2e−02
Ordering
2e−04
1−F(x) (on log scale)
x (on log scale)
4
6
8
x (on log scale)
10
14
0
1
2
3
Ordered Data
Figure 32: Diagnostic plots of GPD fit to the daily negative log returns of S&P 500 index.The sample period is 1998 to 2008.
Solutions to Exercises of Chapter 8 1. Note that the data in the file “m-mrk2vw.txt” are simple returns. We use tick symbols to denote the log returns and denote the value-weighted index return by “VW”. (a) sample mean and sample standard deviations of the log returns, in percentages, are Company Sample mean Sample St.Err.
MRK 0.967 7.041
JNJ 1.170 6.292
GE 0.721 6.432
GM 0.124 8.533
F 0.449 9.236
VW 0.725 4.465
The sample covariance and correlation matrices are given below. Covariance mrk jnj ge gm f vw mrk 49.58 23.868 17.93 10.228 12.69 14.30 jnj 23.87 39.591 17.43 8.819 11.85 14.25 ge 17.93 17.426 41.37 23.552 25.22 20.49 gm 10.23 8.819 23.55 72.819 54.19 20.07 f 12.69 11.855 25.22 54.193 85.30 21.85 vw 14.30 14.247 20.49 20.074 21.85 19.94 Correlations mrk jnj ge gm f vw mrk 1.00 0.54 0.40 0.17 0.20 0.45 jnj 0.54 1.00 0.43 0.16 0.20 0.51 ge 0.40 0.43 1.00 0.43 0.42 0.71 gm 0.17 0.16 0.43 1.00 0.69 0.53 f 0.20 0.20 0.42 0.69 1.00 0.53 vw 0.45 0.51 0.71 0.53 0.53 1.00 (b) Apply the multivariate Q-statistics. The results are Lags m Q6 (m) D.F. p value
1 87.42 36 0.00
2 130.62 72 0.00
3 181.36 108 0.00 87
4 223.63 144 0.00
5 249.32 180 0.00
6 285.05 216 0.001
88 Therefore, one rejects the null hyphthesis of no serial or cross-sectional correlations in the data. (c) Because of the significance of serial correlations in Part(b), there is lead-lag relationship among the six return series. Compared with the case in the 2nd edition, which used data prior to 1999, the monthly log returns now have significant serial dependence. The data of the last ten years have changed the dynamic dependence of the data. 2. Consider the change series of the monthly interest rates. The AIC criterion and Tiao-Box M (i) statistic of the data are Lag M (i) AIC Lag M (i) AIC
1 139.43 −5.406 7 4.86 −5.565
2 61.19 −5.487 8 12.83 −5.574
3 17.22 −5.502 9 3.35 −5.568
4 11.91 −5.508 10 7.86 −5.568
5 8.41 −5.509 11 14.72 −5.579
6 46.92 −5.569 12 17.24 −5.594
The 1% critical value for χ24 is 13.3. It seems that a VAR(12) is identified by the AIC and the Tiao-Box M statistic. However, for M statistic and AIC also indicate a VAR(6) model as another possiblility. The latter is entertained for simplicity. For moving average models, the sample cross-correlation matrices indicate an MA(11) model. We use SCA to estimate the bivariate models. In the estimation process, we have removed some of the insignificant parameters. (a) The final model of bivariate AR(6) model is below c1t = 0.428c1,t−1 + 0.190c2,t−1 − 0.165c1,t−2 − 0.184c2,t−2 + 0.156c1,t−5 − 0.226c1,t−6 + a1t
c2t = 0.278c2,t−1 − 0.233c2,t−2 + 0.158c1,t−5 − 0.079c2,t−5 − 0.135c1,t−6 + a2t where the covariance matrix of at = (a1t , a2t )′ is 0.14391 0.07347 Σ= . 0.07347 0.06342
There is feedback between the two change series. Using Cholesky decomposition, we obtain the lower triangular matrix 1 0 −1 L = −0.51053 1
such that L−1 Σ(L′ )−1 = diag{0.14391,0.02591}, which is a diagonal matrix. Therefore, multiplying the fitted model from left by L−1 , we obtain a structural equation c2t = 0.511c1t − 0.219c1,t−1 + 0.181c2,t−1 + 0.084c1,t−2 − 0.139c2,t−2 + 0.078c1,t−5 − 0.079c2,t−5 − 0.020c1,t−6 + b2t
89 where Var(b2t ) = 0.0259. (b) The fitted model for bivariate MA(11) model is c1t = a1t + 0.371a1,t−1 + 0.274a2,t−1 − 0.066a1,t−3 − +0.290a1,t−5 − 0.157a1,t−5 − 0.163a1,t−7 + 0.118a1,t−11
c2t = a2t + 0.43a2,t−1 − 0.101a1,t−3 + 0.088a2,t−3 + 0.245a1,t−5 − 0.178a2,t−5 − 0.093a1,t−7 + 0.093a1,t−11
where the covariance matrix of at = (a1t , a2t )′ is 0.13732 0.06833 Σ= . 0.06833 0.05928 Again, there is feedback relation between the two change series. This model is not far away from the bivariate AR(6) model of Part(a). This can be seen from the residual covariance matrices of the two models and from pattern of the coefficient matrices. 3. Taking the log transformation seems to help in modeling. We also employ the differenced series. The AIC criterion and Tiao-Box M (i) statistic of the data are Lag M (i) AIC Lag M (i) AIC
1 205.65 −12.50 7 14.28 −12.59
2 46.43 −12.55 8 9.22 −12.59
3 26.69 −12.58 9 16.04 −12.60
4 1.14 −12.57 10 1.89 −12.60
5 5.21 −12.57 11 3.55 −12.59
6 13.75 −12.58 12 8.32 −12.59
The 1% critical value for χ24 is 13.3. Thus, a VAR(9) model is identified. However, examination of the residual cross-correlation matrix after the VAR(1) fits indicates the serial correlations mainly at lags 1 and 9. After some simplification, we obtain the model c1t = 0.093c1,t−1 + a1t + 0.333a1,t−1 + 0.296a2,t−1 + 0.127a1,t−9 c2t = −0.187c2,t−1 + a2t + 0.553a2,t−1 − 0.055a1,t−9 where the residual series at has a covariance matrix 0.004837 0.001920 Σ= . 0.001920 0.00149 From the fitted model, the two change series have a feedback relation. The change in 1-year rate seems to depend on the innovation of 10-year rate at lag 1. On the other hand,the change in 10-year rate seems to depend on the innovation of the 1-year rate at lag 9. 4. Using the spread st = r10,t −r1,t as the threshold variable, we found significant results in testing for threshold co-integration. The test statistic used is discussed in Tsay (1998, JASA). For instance, based on a VAR(9) model the test results are
90
Delay Test
0 425.8
1 249.7
2 293.8
3 283/6
4 287.5
Compared with χ250 , the test statistics are highly significant. In particular, the delay is 0, meaning that the threshold variable is indeed st . We used AIC to search for the threshold value assuming that there are two regimes and obtained a threshold of 0.7527. The fitted threshold model is given below. (A) Regime: 1 with
329 observations:
Model for 1-year rate: r(1,t) Ind.Var
Est
Std.Err
constant r(1,t-1) r(1,t-2) r(1,t-3) r(1,t-4) r(1,t-5) r(1,t-6) r(1,t-7) r(1,t-8) r(1,t-9) r(10,t-1) r(10,t-2) r(10,t-3) Regime:
-0.06225 0.06315 0.82850 0.09815 0.23013 0.14293 -0.18204 0.12809 -0.01912 0.09432 0.01739 0.10096 -0.05327 0.10670 -0.10715 0.10523 0.35923 0.09203 -0.22028 0.05152 0.94167 0.15295 -1.33638 0.22137 0.55441 0.15743 1 Nobs: 329
t-ratio -0.98578 8.44118 1.61002 -1.42114 -0.20275 0.17227 -0.49925 -1.01822 3.90346 -4.27534 6.15663 -6.03676 3.52156
Model for 10-year rate: r(10,t) Ind.Var constant r(1,t-1) r(1,t-2) r(1,t-3) r(10,t-1) r(10,t-2) r(10,t-3)
Est Std.Err t-ratio -0.01602 0.03927 -0.40790 -0.10786 0.06128 -1.76031 0.28821 0.08575 3.36093 -0.15272 0.05913 -2.58279 1.41939 0.09611 14.76840 -0.89139 0.13872 -6.42581 0.45118 0.09722 4.64069
(log(det)*nobs) = 2214.815975 Residual cov-mtx: 0.13964 0.06939 0.06939 0.05804
91 Regime:
2 Nobs:
341
Model for 1-year rate: est std.err t-ratio constant -0.08222 0.06179 -1.33049 -----------------------------------------r(1,t-1) 1.57857 0.08545 18.47395 r(1,t-2) -1.14138 0.13694 -8.33484 r(1,t-3) 0.71635 0.14112 5.07609 r(1,t-4) -0.54091 0.14433 -3.74764 r(1,t-5) 0.84761 0.13994 6.05674 r(1,t-6) -0.99171 0.13193 -7.51714 r(1,t-7) 0.58382 0.10861 5.37528 r(1,t-8) -0.13028 0.05431 -2.39890 -----------------------------------------r(10,t-1) 0.02112 0.10955 0.19276 r(10,t-2) 0.24719 0.17457 1.41601 r(10,t-3) -0.37677 0.18064 -2.08575 r(10,t-4) 0.36902 0.18294 2.01713 r(10,t-5) -0.47322 0.18193 -2.60110 r(10,t-6) 0.46200 0.17081 2.70477 r(10,t-7) -0.18202 0.10388 -1.75221 Model for 10-year rate: est std.Err t-ratio constant 0.07526 0.04808 1.56551 --------------------------------------------r(1,t-1) 0.11038 0.06644 1.66127 r(1,t-2) -0.18174 0.10635 -1.70882 r(1,t-3) 0.02339 0.10913 0.21430 r(1,t-4) -0.03389 0.11151 -0.30388 r(1,t-5) 0.37055 0.10824 3.42330 r(1,t-6) -0.51027 0.08704 -5.86230 r(1,t-7) 0.33423 0.06822 4.89962 r(1,t-8) -0.11112 0.04222 -2.63188 --------------------------------------------r(10,t-1) 1.32956 0.08520 15.60536 r(10,t-2) -0.52505 0.13579 -3.86672 r(10,t-3) 0.25881 0.13921 1.85923 r(10,t-4) -0.07584 0.13828 -0.54850 r(10,t-5) -0.14364 0.13463 -1.06693 r(10,t-6) 0.14135 0.08225 1.71846
92 (log(det)*nobs) =
2229.699710
Residual cov-mtx: 0.10360 0.06195 0.06195 0.06291 Thresholds: 0.752700 Overall AIC & BIC 0.45325157E+04
0.47006170E+04
Model checking shows that the fitted model has no residual serial correlations, except lag 11 of series 1. 5. (a) Taking expectation of the model, we have E(xt ) − Φ4 E(xt−4 ) = φ0 . Under stationarity, the expectation is time invariant so that (I − Φ4 )µx = φ0 , where µx = E(xt ). Therefore, µx = (I −Φ4 )−1 φ0 provided that the inverse exists. For covariance matrix, we may assume µx = φ0 = 0 and rewrite the model as xt = Φ4 xt−4 + at . Taking covariance on both sides and using the zero covariance between xt−4 and at , we obtain Γ0 = Φ4 Γ0 Φ′4 + Σ. Taking the vectorization and using property 8 of Kronecker product in the Appendix, we have vec(Γ0 ) = vec(Φ4 Γ0 Φ′4 ) + vec(Σ) = (Φ4 ⊗ Φ4 )vec(Γ0 ) + vec(Σ). Therefore, (I − Φ4 ⊗ Φ4 )vec(Γ0 ) = vec(Σ), and vec(Γ0 ) = (I − Φ4 ⊗ Φ4 )−1 vec(Σ) provided that the inverse exists. Alternatively, rewriting the model as xt − µ = Φ4 (xt−4 − µ) + at ,
(18)
and using the geometric series (1 − w)−1 = 1 + w + w2 + · · · , we have xt − µ = at + Φ4 at−4 + Φ24 at−8 + Φ34 at−12 + · · · . Taking covariance and using the independence of {at }, we obtain Var(xt ) = Σ + Φ4 ΣΦ′4 + Φ24 Σ(Φ24 )′ + Φ34 Σ(Φ34 )′ + · · · .
(19)
(b) Using the results of Part (a), the necessary and sufficient condition of weak stationarity is that the covariance matrix Var(xt ) is well-defined and positive definite. This means that the infinity series in Eq. (19) converges and, hence, Φj4 converges to zero as j → ∞. The condition is then that all eigenvalues of Φ4 are less than unity in modulus. (c) Post multiplying (xt−ℓ − µ)′ to Eq. (18) and taking expectation, we have Γℓ = Φ4 Γℓ−4 ,
ℓ > 0.
6. Post multiplying the model by x′t−ℓ and taking expectation, we have
93
Γ0 = Σ + Θ4 ΣΘ′4 Γj
= 0,
j = 1, 2, 3
Γ4 = −Θ4 Σ Γ5 = 0.
7. We use Splus to perform the analysis. (a) Use BIC criterion, we identify a VAR(3) model for the seires. The fitted model is given below: > x=cbind(r1t,r3t) > y=data.frame(x) > ord.choice=VAR(y,max.ar=8) > ord.choice$info ar(1) ar(2) ar(3) ar(4) ar(5) ar(6) BIC 40.09109 -54.47175 -73.91083 -66.2284 -46.99099 -37.22852 ar(7) ar(8) BIC -57.43615 -39.12123 > var3.fit=VAR(x~ar(3)) > summary(var3.fit) Call: VAR(formula = x ~ ar(3)) Coefficients: (Intercept) (std.err) (t.stat)
r1t 0.0586 0.0448 1.3086
r3t 0.0744 % constant -transpose 0.0376 1.9796
r1t.lag1 (std.err) (t.stat)
1.1604 0.1098 10.5652
0.0182 % Phi(1)-transpose 0.0922 %% AR coef-mtx is in ‘‘transpose’’. 0.1977
r3t.lag1 (std.err) (t.stat)
0.3573 0.1304 2.7397
1.4050 0.1094 12.8405
r1t.lag2 (std.err) (t.stat)
-0.2871 0.1627 -1.7650
0.0142 % Phi(2)-transpose 0.1365 0.1043
r3t.lag2
-0.5067
-0.7004
94 (std.err) (t.stat)
0.1937 -2.6158
0.1625 -4.3093
r1t.lag3 (std.err) (t.stat)
0.1075 0.1076 0.9998
0.0058 % Phi(3)-transpose 0.0903 0.0646
r3t.lag3 (std.err) (t.stat)
0.1577 0.1289 1.2231
0.2476 0.1082 2.2889
Regression Diagnostics: r1t r3t R-squared 0.9818 0.9859 Adj. R-squared 0.9817 0.9857 Resid. Scale 0.4071 0.3416 Information Criteria: logL AIC BIC HQ 86.4741 -144.9483 -83.1828 -120.9203
Degree of freedom:
total residual 609 602
(b) The impuse response functions are shown in Figure 33. > var3.irf=impRes(var3.fit,period=6,std.err=’asymptotic’) > var3.irf Impulse Response Function: (with responses in rows, and innovations in columns) , , lag.0 r1t r3t r1t 0.4048 0.0000 r3t 0.3156 0.1255 , , lag.1 r1t r3t r1t 0.5824 0.0448 r3t 0.4508 0.1763 , , lag.2 r1t r3t r1t 0.5608 0.0514 r3t 0.4287 0.1607
95 Orthogonal Impulse Response Function
0.02 0.04 0.06 0.08
4
5
0.45
0.10 0.12 0.14 0.16 0.18
Resp.: r3t Inno.: r3t
0.35 0.30
2 3 Resp.: r1t Inno.: r3t
0.0
0.40 0.45 0.50 0.55 0.60
1
Resp.: r3t Inno.: r1t
0.40
Impulse Response
0 Resp.: r1t Inno.: r1t
0
1
2
3
4
5
Steps
Figure 33: Impose response functions of a VAR(3) fit to the monthly U.S. interest rate series. The first series is the 1-year Treasury constant maturity rate and the second series is the 3-year Treasury constant maturity rate. Data span is from April 1953 to March 2004.
, , lag.3 r1t r3t r1t 0.5015 0.0346 r3t 0.3855 0.1349 , , lag.4 r1t r3t r1t 0.4752 0.0248 r3t 0.3736 0.1222 , , lag.5 r1t r3t r1t 0.4734 0.0251 r3t 0.3800 0.1183 (c) We use the fitted VAR(3) model to produce 1 to 12-step ahead forecasts: > var3.fst=predict(var3.fit,n.predict=12) > summary(var3.fst) Predicted Values with Standard Errors: r1t r3t 1-step-ahead 1.1492 1.9170 (std.err) 0.4071 0.3416
96 570
580
590 600 r3t
610
620
4 0
1
1
2
2
3
3
values
4
5
5
6
6
7
r1t
570
580
590
600
610
620
index
Figure 34: Forecasting plots of fitting a VAR(3) to the monthly U.S. interest rate series. The first series is the 1-year Treasury constant maturity rate and the second series is the 3-year Treasury constant maturity rate. The first origin is March 2004. 2-step-ahead 1.2100 1.9691 (std.err) 0.7148 0.5947 3-step-ahead 1.3082 2.0388 (std.err) 0.9120 0.7521 4-step-ahead 1.3857 2.0820 (std.err) 1.0428 0.8570 5-step-ahead 1.4423 2.1101 (std.err) 1.1473 0.9438 6-step-ahead 1.4954 2.1391 (std.err) 1.2425 1.0252 7-step-ahead 1.5521 2.1732 (std.err) 1.3311 1.1023 8-step-ahead 1.6107 2.2099 (std.err) 1.4127 1.1742 9-step-ahead 1.6684 2.2468 (std.err) 1.4875 1.2409 10-step-ahead 1.7247 2.2838 (std.err) 1.5565 1.3034 11-step-ahead 1.7800 2.3210 (std.err) 1.6208 1.3624 12-step-ahead 1.8346 2.3588 (std.err) 1.6810 1.4183 The forecasts are shown in Figure 34 along with 50 data points. (d) Yes, the two series are co-integrated with a restricted constant.
97 > coint.rc=coint(x,trend=’rc’,lags=2) > coint.rc Call: coint(Y = x, lags = 2, trend = "rc") Trend Specification: H1*(r): Restricted constant Trace tests sign. at the 5% level are flagged by ’ +’. Trace tests sign. at the 1% level are flagged by ’++’. Max Eigenvalue tests sign. at the 5% level are flagged by ’ *’. Max Eigenvalue tests sign. at the 1% level are flagged by ’**’. Tests for Cointegration Rank: Eigenvalue Trace Stat 95% CV 99% CV H(0)++** 0.0435 30.8268 19.9600 24.6000 H(1) 0.0061 3.7114 9.2400 12.9700 Max Stat 95% CV 99% CV 27.1153 15.6700 20.2000 3.7114 9.2400 12.9700 (e) The fitted ECM model is given below: > vecm.fit=VECM(coint.rc) > summary(vecm.fit) Call: VECM(test = coint.rc) Cointegrating Vectors: coint.1 1.0000 r3t -1.0088 (std.err) 0.0340 (t.stat) -29.6727
% w(t) = x1(t)-x2(t).
Intercept* (std.err) (t.stat)
% mean of w(t) is -0.475.
0.4750 0.2322 2.0459
VECM Coefficients: r1t r3t coint.1 -0.0276 0.0313 (std.err) 0.0330 0.0277
% Alpha-transpose
98 (t.stat) -0.8373
1.1292
r1t.lag1 (std.err) (t.stat)
0.1898 -0.0116 % Phi(1)^* -transpose 0.1076 0.0903 1.7638 -0.1285
r3t.lag1 (std.err) (t.stat)
0.3359 0.1278 2.6281
r1t.lag2 -0.0981 (std.err) 0.1076 (t.stat) -0.9122
0.4419 0.1072 4.1212 0.0020 % Phi(2)^* -transpose 0.0903 0.0219
r3t.lag2 -0.1754 -0.2623 (std.err) 0.1287 0.1080 (t.stat) -1.3628 -2.4286 Regression Diagnostics: r1t r3t R-squared 0.1921 0.1771 Adj. R-squared 0.1867 0.1716 Resid. Scale 0.4076 0.3420 Information Criteria: logL AIC BIC HQ 84.6184 -159.2369 -137.1778 -150.6554
Degree of freedom:
total residual 609 604
(f) We use the fitted ECM model to produce forecats for the interesr series. The results are given below and shown in Figure 35 > vecm.fit.level=VECM(coint.rc,levels=T) > vecm.fst.level=predict(vecm.fit.level, n.predict=12) > summary(vecm.fst.level) Predicted Values with Standard Errors: r1t r3t 1-step-ahead 1.1098 1.8843 (std.err) 0.4076 0.3420 2-step-ahead 1.1132 1.8897 (std.err) 0.7181 0.5975 3-step-ahead 1.1526 1.9123
99 570
580
590 600 r3t
610
620
4 0
1
1
2
2
3
3
values
4
5
5
6
6
7
r1t
570
580
590
600
610
620
index
Figure 35: Forecasting plots of fitting an ECM to the monthly U.S. interest rate series. The first series is the 1-year Treasury constant maturity rate and the second series is the 3-year Treasury constant maturity rate. The first origin is March 2004. (std.err) 0.9190 0.7579 4-step-ahead 1.1747 1.9110 (std.err) 1.0544 0.8667 5-step-ahead 1.1784 1.8956 (std.err) 1.1645 0.9585 6-step-ahead 1.1791 1.8811 (std.err) 1.2663 1.0459 7-step-ahead 1.1834 1.8711 (std.err) 1.3624 1.1299 8-step-ahead 1.1897 1.8633 (std.err) 1.4521 1.2093 9-step-ahead 1.1955 1.8557 (std.err) 1.5357 1.2840 10-step-ahead 1.2004 1.8480 (std.err) 1.6141 1.3551 11-step-ahead 1.2047 1.8407 (std.err) 1.6883 1.4232 12-step-ahead 1.2088 1.8339 (std.err) 1.7591 1.4888 (g) Comapred the two sets of forecasts. The VAR(3) model produces higher forecasts and slightly smaller forecast standard errors.In addition, the VAR(3) forecasts do not satisfy the co-integration constriants.
100
Solutions to Exercises of Chapter 9 1. We use S-Plus to perform the analysis. The commands should also work in R. The β̂i , σi2 and R2 of the excess returns of 13 stocks are given below: > print(opt,digits=3) beta.hat D.hat r.square AA 1.168 52.2 0.315 AXP 0.521 30.2 0.136 CAT 0.474 34.4 0.103 DE 1.050 53.4 0.266 F 0.925 55.1 0.214 FDX 0.652 30.1 0.198 HPQ 0.567 27.9 0.168 IBM 1.444 58.2 0.386 JNJ 1.333 90.1 0.257 KMB 1.502 73.6 0.350 MMM 0.839 46.5 0.210 PG 1.270 34.1 0.454 WFC 0.794 65.3 0.145 Figure 36 shows the barplots of the β̂i and the corresponding R2 . PG stock has the highest R2 whereas CAT has the lowest value. The KMB stock has the largest beta. The commands used in the analysis are given below: > da=read.table("m-fac-ex-9008.txt") > rtn=da > colnames(rtn) <- c("AA","AXP","CAT","DE","F","FDX","HPQ","IBM", "JNJ","KMB","MMM","PG","WFC","SP5") > dim(rtn) [1] 228 14 > xmtx=cbind(rep(1,228),rtn[,14]) > rtn=rtn[,1:13] > rtn=as.matrix(rtn) > dim(xmtx) [1] 228 2 > apply(rtn,2,mean) 101
102 AA AXP CAT DE F FDX HPQ 0.7463537 0.5494111 0.8959795 1.010076 0.8080172 0.9296873 0.5379612 IBM JNJ KMB MMM PG WFC 0.4197085 0.06873338 1.219805 1.232816 0.4598392 0.8072102 > sqrt(apply(rtn,2,var)) AA AXP CAT DE F FDX HPQ IBM 8.70664 5.898469 6.182932 8.510639 8.35331 6.117738 5.779174 9.713076 JNJ KMB MMM PG WFC 10.98646 10.61641 7.653282 7.882246 8.72128 > > xit.hat=solve(xmtx,rtn) > print(xit.hat,digits=2) AA AXP CAT DE F FDX HPQ IBM JNJ KMB MMM PG WFC [1,] 0.55 0.46 0.81 0.83 0.65 0.82 0.44 0.17 -0.16 0.96 1.09 0.24 0.67 [2,] 1.17 0.52 0.47 1.05 0.93 0.65 0.57 1.44 1.33 1.50 0.84 1.27 0.79 > beta.hat=xit.hat[2,] > E.hat=rtn-xmtx%*%xit.hat > D.hat=diag(crossprod(E.hat)/(228-2)) > r.square=1-(228-2)*D.hat/diag(var(rtn,SumSquares=T)) > print(D.hat,digits=3) [1] 52.2 30.2 34.4 53.4 55.1 30.1 27.9 58.2 90.1 73.6 46.5 34.1 65.3 > > ch1=colnames(rtn) > ch1 [1] "AA" "AXP" "CAT" "DE" "F" "FDX" "HPQ" "IBM" "JNJ" "KMB" "MMM" [12] "PG" "WFC" > par(mfcol=c(2,1)) > barplot(opt[,1],names=ch1) > title(main=’(a) Beta-hat’) > barplot(opt[,3],names=ch1) > title(main=’(b) R-square’) > printgraph(file=’ch9-q1-beta.eps’) > > opt=t(rbind(beta.hat,D.hat,r.square)) > print(opt,digits=3) 2. We use tick symbols to denote the log returns and denote the value-weighted return by “VW”. (a) Principal component analysis based on the sample covariance matrix is given below. > m1=princomp(x) > summary(m1) Importance of components:
103
0.0
0.5
1.0
1.5
(a) Beta−hat
AA
AXP CAT
DE
F
FDX HPQ IBM JNJ KMB MMM PG WFC
0.0 0.1 0.2 0.3 0.4
(b) R−square
AA
AXP CAT
DE
F
FDX HPQ IBM JNJ KMB MMM PG WFC
Figure 36: Barplots of beta and R-square of a single-factor Market Model for 13 monthly excess returns. Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Standard deviation 12.8657916 8.2350503 5.08098877 4.86284821 4.36974006 Proportion of Variance 0.5372989 0.2201281 0.08379911 0.07675813 0.06198037 Cumulative Proportion 0.5372989 0.7574270 0.84122613 0.91798426 0.97996463 Comp.6 Standard deviation 2.48443260 Proportion of Variance 0.02003537 Cumulative Proportion 1.00000000 > names(m1) [1] "sdev" [6] "scale"
"loadings" "n.obs"
"correlations" "scores" "call" "factor.sdev"
"center" "coef"
> print(m1$loadings,digits=3) Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 mrk 0.248 0.632 0.372 -0.475 -0.416 jnj 0.222 0.523 0.162 0.795 -0.133 ge 0.343 0.263 -0.587 0.445 -0.387 -0.348 gm 0.557 -0.337 -0.381 -0.621 0.199 f 0.626 -0.346 0.578 0.382 vw 0.265 0.157 -0.190 0.137 0.921 *** For more details, use the command ‘‘eigen’’. > v1=var(x) > mm1=eigen(v1) > mm1$values [1] 165.810585 67.931584 25.860427 23.687578 19.127157 > print(mm1$vectors,digits=3)
6.182921
104 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.248 0.632 0.3720 -0.475 -0.4157 -0.0501 [2,] 0.222 0.523 0.0405 0.162 0.7949 -0.1329 [3,] 0.343 0.263 -0.5868 0.445 -0.3873 -0.3481 [4,] 0.557 -0.337 -0.3806 -0.621 0.1987 -0.0796 [5,] 0.626 -0.346 0.5785 0.382 -0.0641 -0.0610 [6,] 0.265 0.157 -0.1902 0.137 -0.0413 0.9212
(b) Principal component analysis based on the sample correlation matrix is given below. > m2=princomp(x,cor=T) > summary(m2) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Standard deviation 1.7798965 1.1154322 0.75086785 0.67478564 0.55683257 Proportion of Variance 0.5280052 0.2073648 0.09396709 0.07588928 0.05167709 Cumulative Proportion 0.5280052 0.7353701 0.82933715 0.90522642 0.95690351 Comp.6 Standard deviation 0.50850658 Proportion of Variance 0.04309649 Cumulative Proportion 1.00000000 > print(m2$loadings,digits=3) Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 mrk 0.341 0.505 0.510 0.606 jnj 0.357 0.508 0.139 -0.751 0.159 ge 0.451 -0.671 0.231 0.535 gm 0.389 -0.509 0.254 -0.711 0.137 f 0.397 -0.474 0.334 -0.121 0.695 vw 0.495 -0.308 -0.812 ** For more details, use the command ‘‘eigen’’ > c1=cor(x) > mm2=eigen(c1) > mm2$values [1] 3.1680314 1.2441889 0.5638025 0.4553357 0.3100625 0.2585789 > print(mm2$vectors,digits=3) [,1] [,2] [,3] [,4] [,5] [,6] mrk 0.341 0.5055 0.510 0.6057 0.00506 0.0412 jnj 0.357 0.5076 0.139 -0.7514 -0.07627 0.1592 ge 0.451 0.0516 -0.671 0.2309 0.07005 0.5347 gm 0.389 -0.5090 0.254 -0.0110 -0.71148 0.1375 f 0.397 -0.4740 0.334 -0.1211 0.69495 0.0921 vw 0.495 0.0192 -0.308 0.0199 -0.01021 -0.8122
(c) Statistical factor analysis: From the results of previous two parts, there are two dominating factors, which explain about 74% of the variability of the returns. Furthermore, the remaining eigenvalues are small in magnitude. Thus, we select two common factors. The estimates of factor loading and other information are given below. Principal Component Factor Analysis of the Correlation Matrix Unrotated Factor Loadings and Communalities
105 Variable mrk jnj ge gm f vw
Factor1 -0.607 -0.635 -0.802 -0.692 -0.706 -0.881
Factor2 0.564 0.566 0.058 -0.568 -0.529 0.021
Commnlty 0.686 0.723 0.647 0.802 0.778 0.776
Variance
3.1684
1.2432
4.4116
----------------------------------------------Maximum Likelihood Factor Analysis of the Correlation Matrix Unrotated Factor Loadings and Communalities Variable mrk jnj ge gm f vw
Factor1
0.461 0.824 0.785 0.567
Factor2 0.666 0.731 0.577 0.116 0.159 0.654
Commnlty 0.452 0.541 0.546 0.692 0.642 0.749
Based on the results, the second common factor can be regarded as the market trend and the first common factor denotes the market except for the drug industry. 3. We use Splus to analyze the single-factor market model for the 10 monthly excess returns. The output is attached. > da=matrix(scan(file=’m-excess-c10sp-9003.txt’),11) > dim(da) [1] 11 168 > X.mtx=cbind(rep(1,168),da[11,]) > rtn=t(da[1:10,]) > xit.hat=solve(X.mtx,rtn) > beta.hat=t(xit.hat[2,]) > E.hat=rtn-X.mtx%*%xit.hat > D.hat=diag(crossprod(E.hat)/(168-2)) > r.square=1-(168-2)*D.hat/diag(var(rtn,SumSquares=T)) > t(rbind(beta.hat,sqrt(D.hat),r.square)) beta sigma(i) r.square ABT 0.5728 0.0570 0.1598 LLY 0.7041 0.0816 0.1233 MRK 0.7399 0.0703 0.1728 PFE 0.8513 0.0665 0.2363 F 1.2193 0.0824 0.2922 GM 1.0457 0.0813 0.2378 BP 0.5780 0.0580 0.1577
106 CVX 0.6032 0.0497 0.2174 RD 0.8009 0.0493 0.3327 XOM 0.4994 0.0381 0.2445 > par(mfcol=c(1,2)) % Obtain the plots of beats and R-squares. > barplot(beta.hat,horiz=T,main=’Beta values’) > barplot(r.square,horiz=T,main=’R-square’) > text(locator(1),’ABT’) > text(locator(1),’LLY’) > text(locator(1),’MRK’) > text(locator(1),’PFE’) > text(locator(1),’F’) > text(locator(1),’GM’) > text(locator(1),’BP’) > text(locator(1),’CVX’) > text(locator(1),’RD’) > text(locator(1),’XOM’) > printgraph(file=’ch9-ex2.ps’) > cov.model=var(da[11,])*(t(beta.hat)%*%beta.hat)+diag(D.hat) > dim(cov.model) [1] 10 10 > sd.model=sqrt(diag(cov.model)) > corr.model=cov.model/outer(sd.model,sd.model) > print(corr.model,digits=1,width=2) ABT LLY MRK PFE F GM BP CVX RD XOM ABT 1.0 0.1 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 LLY 0.1 1.0 0.1 0.2 0.2 0.2 0.1 0.2 0.2 0.2 MRK 0.2 0.1 1.0 0.2 0.2 0.2 0.2 0.2 0.2 0.2 PFE 0.2 0.2 0.2 1.0 0.3 0.2 0.2 0.2 0.3 0.2 F 0.2 0.2 0.2 0.3 1.0 0.3 0.2 0.3 0.3 0.3 GM 0.2 0.2 0.2 0.2 0.3 1.0 0.2 0.2 0.3 0.2 BP 0.2 0.1 0.2 0.2 0.2 0.2 1.0 0.2 0.2 0.2 CVX 0.2 0.2 0.2 0.2 0.3 0.2 0.2 1.0 0.3 0.2 RD 0.2 0.2 0.2 0.3 0.3 0.3 0.2 0.3 1.0 0.3 XOM 0.2 0.2 0.2 0.2 0.3 0.2 0.2 0.2 0.3 1.0 > print(cor(rtn),digits=1,width=2) ABT LLY MRK PFE F GM BP CVX RD XOM ABT 1.00 0.44 0.5 0.5 0.2 0.05 0.2 0.20 0.3 0.2 LLY 0.44 1.00 0.6 0.6 0.2 0.06 0.1 0.05 0.1 0.2 MRK 0.54 0.55 1.0 0.6 0.2 0.13 0.1 0.14 0.3 0.2 PFE 0.48 0.55 0.6 1.0 0.2 0.10 0.3 0.29 0.4 0.3 F 0.18 0.23 0.2 0.2 1.0 0.61 0.2 0.24 0.3 0.3 GM 0.05 0.06 0.1 0.1 0.6 1.00 0.1 0.19 0.2 0.2 BP 0.17 0.10 0.1 0.3 0.2 0.11 1.0 0.70 0.7 0.6 CVX 0.20 0.05 0.1 0.3 0.2 0.19 0.7 1.00 0.7 0.6
107 RD 0.31 0.14 0.3 0.4 0.3 0.18 0.7 0.74 1.0 0.6 XOM 0.17 0.15 0.2 0.3 0.3 0.22 0.6 0.64 0.6 1.0 > w.gmin.model=solve(cov.model)%*%rep(1,nrow(cov.model)) > w.gmin.model=w.gmin.model/sum(w.gmin.model) > w.gmin.model ABT 0.1404 LLY 0.0476 MRK 0.0562 PFE 0.0359 F -0.0347 GM -0.0075 BP 0.1341 CVX 0.1718 RD 0.0876 XOM 0.3685 > w.gmin.data=solve(var(rtn))%*%rep(1,nrow(cov.model)) > w.gmin.data=w.gmin.data/sum(w.gmin.data) > w.gmin.data ABT 0.2439 LLY 0.0567 MRK 0.0011 LLY 0.0131 F -0.0284 GM 0.1025 BP 0.0843 CVX 0.0993 RD -0.1228 XOM 0.5502 The betas are all positive and the R-square ranges from 12.3% to 33.3%. Figure 37 shows the beats and R-square. For GMVP comparison, the weights to CVX and RD changes substantially, but both portfolios give heavy weights to ABT and XOM stocks. 4. Again, Splus is used to analyze the industrial factor model. We create 3 indicator variables for the three industrial sectors. The details are given below: > drug=c(rep(1,4),rep(0,6)) > auto=c(rep(0,4),1,1,rep(0,4)) > oil=c(rep(0,6),rep(1,4)) > beta=cbind(drug,auto,oil) > beta drug auto oil [1,] 1 0 0 [2,] 1 0 0 [3,] 1 0 0 [4,] 1 0 0
108 Beta values
R−square ABT LLY MRK PFE F GM BP CVX RD XOM
0.0
0.2
0.4
0.6
0.8
1.0
1.2
0.0
0.1
0.2
0.3
Figure 37: Plots of beta and R-square of a single-factor Market Model for 10 monthly excess returns.
[5,] 0 1 0 [6,] 0 1 0 [7,] 0 0 1 [8,] 0 0 1 [9,] 0 0 1 [10,] 0 0 1 > rtn=t(rtn) > F.hat.o=solve(crossprod(beta))%*%t(beta)%*%rtn > E.hat.o = rtn-beta%*%F.hat.o > diagD.hat=rowVars(E.hat.o) > Dinv.hat=diag(diagD.hat^(-1)) > Hmtx = solve(t(beta)%*%Dinv.hat%*%beta)%*%t(beta)%*%Dinv.hat > F.hat=Hmtx%*%rtn > F.hat=t(F.hat) > t(Hmtx) drug auto oil [1,] 0.2505400 0.0 0.0000000 [2,] 0.1929452 0.0 0.0000000 [3,] 0.2855103 0.0 0.0000000 [4,] 0.2710045 0.0 0.0000000 [5,] 0.0000000 0.5 0.0000000 [6,] 0.0000000 0.5 0.0000000 [7,] 0.0000000 0.0 0.1979484 [8,] 0.0000000 0.0 0.3137615
109 [9,] 0.0000000 0.0 0.2642833 [10,] 0.0000000 0.0 0.2240067 > cov.model=beta%*%var(F.hat)%*%t(beta) + diag(diagD.hat) > sd.model=sqrt(diag(cov.model)) > corr.model=cov.model/outer(sd.model,sd.model) > print(corr.model,digits=1,width=2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.0 0.6 0.7 0.7 0.1 0.1 0.2 0.2 0.2 0.2 [2,] 0.6 1.0 0.6 0.6 0.1 0.1 0.2 0.2 0.2 0.2 [3,] 0.7 0.6 1.0 0.7 0.2 0.2 0.2 0.2 0.2 0.2 [4,] 0.7 0.6 0.7 1.0 0.1 0.1 0.2 0.2 0.2 0.2 [5,] 0.1 0.1 0.2 0.1 1.0 0.8 0.2 0.2 0.2 0.2 [6,] 0.1 0.1 0.2 0.1 0.8 1.0 0.2 0.2 0.2 0.2 [7,] 0.2 0.2 0.2 0.2 0.2 0.2 1.0 0.7 0.7 0.7 [8,] 0.2 0.2 0.2 0.2 0.2 0.2 0.7 1.0 0.8 0.8 [9,] 0.2 0.2 0.2 0.2 0.2 0.2 0.7 0.8 1.0 0.7 [10,] 0.2 0.2 0.2 0.2 0.2 0.2 0.7 0.8 0.7 1.0 > dim(F.hat) [1] 168 3 > par(mfcol=c(3,1)) > plot(1:168,F.hat[,1],type=’l’) > title(main=’(a) Factor realization: Big drug companies’) > plot(1:168,F.hat[,2],type=’l’) > title(main=’(b) Auto industry’) > plot(1:168,F.hat[,3],type=’l’) > title(main=’(c) Oil companies’) From the correlation matrix implied by the fitted model, we see that the BARRA industiral factor model fits the data reasonably well. The model captures the correlations better than the single-factor Market Model. Figure 38 shows the time plots of the factor realizations for the three industrial sector. 5. We use the commands princomp and mfactor in Splus to do the analysis. > dim(rtn) [1] 168 10 > pca = princomp(rtn) > pca Standard deviations: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 0.1416 0.1088 0.0891 0.0607 0.0541 0.0482 0.0449 Comp.8 Comp.9 Comp.10 0.0346 0.0291 0.0274 The number of variables is 10 and the number of observations is 168 Component names:
110
−0.10
F.hat[, 1] 0.0 0.05 0.10 0.15
(a) Factor realization: Big drug companies
0
50
100
150
100
150
1:168
F.hat[, 2] −0.2 −0.1 0.0 0.1
0.2
(b) Auto industry
0
50 1:168
−0.10
F.hat[, 3] 0.0 0.05 0.10 0.15
(c) Oil companies
0
50
100
150
1:168
Figure 38: Time plots of estimated factor realizations for the industrial factor model fitted to 10 monthly excess returns.
"sdev" "loadings" "correlations" "scores" "center" "scale" "n.obs" "call" "factor.sdev" "coef" Call: princomp(x = rtn) > summary(pca) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Standard deviation 0.1416 0.1088 0.0891 0.0607 0.0541 Proportion of Variance 0.3744 0.2210 0.1482 0.0688 0.0546 Cumulative Proportion 0.3744 0.5954 0.7435 0.8124 0.8669 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10 Standard deviation 0.0482 0.0449 0.0346 0.0291 0.02737 Proportion of Variance 0.0433 0.0376 0.0223 0.0158 0.01399 Cumulative Proportion 0.9102 0.9479 0.9702 0.9860 1.00000 > par(mfcol=c(1,1)) > screeplot(pca) > printgraph(file=’ch9-ex4-scree.ps’) > pca$loadings[,1:3] Comp.1 Comp.2 Comp.3 ABT 0.2384 -0.2355 -0.0205 LLY 0.3764 -0.4115 -0.3382 MRK 0.3526 -0.3429 -0.1542
111 0.374
0.595
0.744
0.005
Variances 0.010
0.015
0.020
pca
0.812
0.867
0.91
0.948 0.986
1
0.0
0.97
Comp.1Comp.2Comp.3Comp.4Comp.5Comp.6Comp.7Comp.8Comp.9 Comp.10
Figure 39: Scree plot of principal component analysis applied to the 10 monthly excess stock returns PFE 0.3638 -0.3305 0.0151 F 0.4926 0.4768 -0.1897 GM 0.3728 0.5651 -0.2072 BP 0.1983 0.0003 0.5329 CVX 0.1940 0.0351 0.4640 RD 0.2487 -0.0113 0.4614 XOM 0.1562 0.0169 0.2648 The Scree plot is given in Figure 39 which shows that m = 3 might be reasonable. The loadings of the first common factor are all positive. Thus, the first factor can be interpreted as a weighted average of the excess returns that represent the market behavior. The second comon factor represents the contrast between the Durg and Auto industries, and the third factor appears to represent the contrast between the oil industry and the other two sectors combined. 6. We use Splus command factanal and the LR test statistic to fit the statistical factor model. The LR test statistic confirms that there are 3 common factors at the 5% significance level. Indeed, the test statistics are LR(2) = 91.76 with p-value close to zero, and LR(3) = 18.93 with p-value 0.395. > stat.factor=factanal(rtn,factors=2,method=’mle’) > stat.factor Sums of squares of loadings: Factor1 Factor2 2.847261 2.193547 Test of the hypothesis that 2 factors are sufficient
112 versus the alternative that more are required: The chi square statistic is 91.76 on 26 degrees of freedom. The p-value is 2.89e-09 > stat.factor=factanal(rtn,factors=3,method=’mle’) > stat.factor Sums of squares of loadings: Factor1 Factor2 Factor3 2.692212 2.174868 1.432655 The number of variables is 10 and the number of observations is 168 Test of the hypothesis that 3 factors are sufficient versus the alternative that more are required: The chi square statistic is 18.95 on 18 degrees of freedom. The p-value is 0.395 > summary(stat.factor) Importance of factors: Factor1 Factor2 Factor3 SS loadings 2.692 2.175 1.433 Proportion Var 0.269 0.217 0.143 Cumulative Var 0.269 0.487 0.630 The degrees of freedom for the model is 18. Uniquenesses: ABT LLY MRK PFE F GM BP 0.574 0.487 0.362 0.403 0.569 0.0002 0.360 CVX RD XOM 0.236 0.245 0.464 Loadings: Factor1 Factor2 Factor3 ABT 0.167 0.630 LLY 0.714 MRK 0.785 0.120 PFE 0.250 0.727 F 0.196 0.182 0.599 GM 0.997 BP 0.794 CVX 0.863 0.121 RD 0.830 0.232 0.112 XOM 0.696 0.158 0.161 > plot(loadings(stat.factor)) > printgraph(file=’ch9-ex5.ps’) > stat.factor1=rotate(stat.factor,rotation=’quartimax’)
113
0.0 0.2 0.4 0.6 0.8
Factor1
CVX
RD
BP
XOM
PFE
F
ABT
RD
F
CVX
MRK
RD
0.0 0.2 0.4 0.6 0.8
Factor2
MRK
PFE
LLY
0.0 0.2 0.4 0.6 0.8 1.0
Factor3
GM
F
XOM
Figure 40: Factor loadings of fitted a statistical factor model to 10 monthly excess stock returns > loadings(stat.factor1) Factor1 Factor2 Factor3 ABT 0.170 0.630 LLY 0.715 MRK 0.788 PFE 0.255 0.728 F 0.222 0.199 0.585 GM 0.123 0.992 BP 0.796 CVX 0.867 RD 0.835 0.232 XOM 0.703 0.161 0.127 Figure 40 shows the loadings of the 3 common factors. It seems that the three common factors are essentially denoting the Oil, Drug, and Auto industry, respectively. 7. We take the first differenced series of the Federal Funds Rate and the Industrial Product Index as a bivariate time series. The differenced data have 593 observations. Using BIC, we select a VAR(2) model for the bivariate time series. We then use the residuals of the fitted VAR(2) model as the surprises to be used in macroeconomic factor model. Details of the analysis is given below: > x=matrix(scan(file=’m-fedip.txt’),4) > x=x[3:4,] > dim(x) [1] 2 594 > ts=cbind(diff(x[1,]),diff(x[2,]))
114 > dim(ts) [1] 593 2 > y=data.frame(ts) > or.var=VAR(y,max.ar=10) > or.var$info ar(1) ar(2) ar(3) ar(4) ar(5) ar(6) BIC 1560.409 1543.928 1557.862 1570.183 1593.891 1614.994 ar(7) ar(8) ar(9) ar(10) BIC 1629.317 1627.665 1642.502 1658.29 > names(or.var) [1] "R" "coef" "fitted" "residuals" "Sigma" "df.resid" [7] "rank" "call" "ar.order" "n.na" "terms" "Y0" [13] "info" > or.var$ar.order [1] 2 > var.fit=VAR(ts~ar(2)) > resi=var.fit$residuals > dim(resi) [1] 591 2 > xmtx=resi[424:591,1:2] > dim(xmtx) [1] 168 2 > dim(rtn) [1] 168 10 > X.mtx=cbind(rep(1,168),xmtx) > xit.hat=solve(X.mtx,rtn) > beta.hat=t(xit.hat[2:3,]) > E.hat=rtn-X.mtx%*%xit.hat > D.hat=diag(crossprod(E.hat)/(168-3)) > r.square=1-(168-3)*D.hat/diag(var(rtn,SumSquares=T)) > par(mfcol=c(1,3)) % Obtain beta plot > barplot(beta.hat[,1],horiz=T,main=’Beta for Fed Funds Surprise’) > barplot(beta.hat[,2],horiz=T,main=’Beta for IP Surprise’) > barplot(r.square,horiz=T,main=’R-square’) > text(locator(1),’ABT’) > text(locator(1),’LLY’) > text(locator(1),’MRK’) > text(locator(1),’PFE’) > text(locator(1),’F’) > text(locator(1),’GM’) > text(locator(1),’BP’) > text(locator(1),’CVX’) > text(locator(1),’RD’)
115 > text(locator(1),’XOM’) > cov.model=beta.hat%*%var(xmtx)%*%t(beta.hat)+diag(D.hat) > sd.model=sqrt(diag(cov.model)) > corr.model=cov.model/outer(sd.model,sd.model) > print(corr.model,digits=1,width=2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.000 0.006 0.018 0.02 0.01 0.004 0.02 0.01 0.03 0.02 [2,] 0.006 1.000 0.006 0.01 0.02 0.011 0.02 0.01 0.02 0.02 [3,] 0.018 0.006 1.000 0.03 0.01 0.002 0.02 0.01 0.04 0.03 [4,] 0.020 0.014 0.026 1.00 0.03 0.013 0.03 0.02 0.05 0.04 [5,] 0.012 0.021 0.011 0.03 1.00 0.027 0.04 0.03 0.04 0.04 [6,] 0.004 0.011 0.002 0.01 0.03 1.000 0.02 0.01 0.02 0.02 [7,] 0.017 0.018 0.020 0.03 0.04 0.021 1.00 0.02 0.04 0.04 [8,] 0.011 0.011 0.013 0.02 0.03 0.013 0.02 1.00 0.03 0.03 [9,] 0.027 0.018 0.035 0.05 0.04 0.016 0.04 0.03 1.00 0.05 [10,] 0.022 0.017 0.028 0.04 0.04 0.016 0.04 0.03 0.05 1.00 Figure 41 shows the barplots of betas and R-square of the macroeconomic factor model. The estimated betas for the Fed Funds Rate surprise are all negative. This seems reasonable. A positive surprise means that the change in the federal funds rate is larger than anticipated change. That is, a larger than expected increase in the federal funds rate, this should have a negative impact on the stock market so that the return should be negative. A similar argument applies to the negative surprises. However, the R-squares for all the stock returns are low with a maximum of about 6% (for LLY stock). THus, the fitted macroeconomic model has limited power in explaining the variability in excess stock returns. In addition, the correlation matrix implied by the fitted model is close to the identity matrix, indicating that the model fails to capture the correlations between the excess returns.
116
Beta for Fed Funds Surprise
−0.12 −0.10 −0.08 −0.06 −0.04 −0.02
Beta for IP Surprise
0.0
−0.02
−0.01
0.0
R−square
0.01
0.0
0.01
0.02
0.03
0.04
0.05
0.06
Figure 41: Betas and R-square of a macroeconomic factor model fitted to 10 monthly excess stock returns. The macroeconomic variables used are the effective Federal Funds Rate and the Industrial Production Index.
Solutions to Exercises of Chapter 10 We use Splus+Finmetrics to perform most estimations of the solution. 1. Exponential moving average model: > da=read.table("m-ibmhpqsp6208.txt",header=T) > head(da) date IBM HPQ SP 1 19620131 -0.063903 -0.077703 -0.037876 2 19620228 -0.007841 -0.025641 0.016270 3 19620330 -0.007914 0.015038 -0.005860 4 19620430 -0.147818 -0.211111 -0.061970 5 19620531 -0.133811 -0.089202 -0.085990 6 19620629 -0.135669 -0.268041 -0.081838 > ibm=log(da$IBM+1)*100 > hpq=log(da$HPQ+1)*100 > sp=log(da$SP+1)*100 > dim(da) [1] 564 4 > rtn=cbind(ibm,hpq,sp) > q1.ewma=mgarch(rtn~1,formula.var=~ewma1,trace=F) > summary(q1.ewma) mgarch(formula.mean = rtn ~ 1, formula.var = ~ ewma1, trace = F) Mean Equation: structure(.Data = rtn ~ 1, class = "formula") Conditional Variance Equation: structure(.Data=~ewma1,class="formula") Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C(1) 0.64710 0.232186 2.787 0.005499 C(2) 0.88338 0.341423 2.587 0.009921 C(3) 0.40786 0.134581 3.031 0.002553 ALPHA 0.02877 0.002815 10.219 0.000000
The estimate of λ is 1 − α̂ = 1 − 0.02877 = 0.97123 The fitted volatility series are given in Figure 42. 2. IBM and HPQ stock returns. 117
6
ibm−vol 8 10
12
118
1970
1980
1990
2000
2010
1990
2000
2010
1990
2000
2010
8
10
hpq−vol 12
14
year
1970
1980
sp−vol 3.0 3.5 4.0 4.5 5.0 5.5 6.0
year
1970
1980 year
Figure 42: Time plot of fitted volatility series for monthly log returns of the IBM and HPQ stocks and the S&P 500 index. > r1=cbind(ibm,hpq) > m2=mgarch(r1~1,formula.var=~DVEC(1,1),trace=F) > summary(m2) Call: mgarch(formula.mean = r1 ~ 1, formula.var = ~ DVEC(1, 1), trace = F) Mean Equation: structure(.Data = r1 ~ 1, class = "formula") Conditional Variance Equation: structure(.Data =~DVEC(1,1),class="formula") Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C(1) 0.70234 0.29358 2.392 1.707e-02 C(2) 1.12403 0.39345 2.857 4.438e-03 A(1, 1) 3.18613 1.28412 2.481 1.339e-02 A(2, 1) 4.53774 2.42522 1.871 6.186e-02 A(2, 2) 6.52817 2.88186 2.265 2.388e-02 ARCH(1; 1, 1) 0.06770 0.01715 3.946 8.942e-05 ARCH(1; 2, 1) 0.06914 0.02763 2.502 1.262e-02 ARCH(1; 2, 2) 0.07351 0.02447 3.004 2.782e-03 GARCH(1; 1, 1) 0.86747 0.03873 22.396 0.000e+00 GARCH(1; 2, 1) 0.79124 0.08897 8.894 0.000e+00 GARCH(1; 2, 2) 0.85709 0.04793 17.884 0.000e+00 -------------------------------------------------------------AIC(11) = 7768.977, BIC(11) = 7816.662 Normality Test: --------------------------------------------------------------
119 Jarque-Bera P-value Shapiro-Wilk P-value ibm 26.99 1.381e-06 0.9810 0.08674 hpq 16.15 3.120e-04 0.9886 0.86089 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ibm 8.037 0.7822 12 hpq 13.167 0.3570 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ibm 6.02 0.9151 12 hpq 14.61 0.2632 12 Lagrange multiplier test: -------------------------------------------------------------Lag 1 Lag 2 Lag 3 Lag 4 Lag 5 Lag 6 Lag 7 Lag 8 Lag 9 ibm 0.4571 0.08869 -0.320 1.4764 0.06146 -1.36373 0.5255 -0.2992 -0.07187 hpq 2.1231 -0.58194 -0.891 0.2919 -0.72225 0.05862 0.2869 1.8146 0.44892 Lag 10 Lag 11 Lag 12 C ibm 0.5357 0.7113 -0.18583 1.017 hpq -0.3104 0.9297 0.02159 -1.140 TR^2 P-value F-stat P-value ibm 6.347 0.8976 0.5837 0.9329 hpq 12.623 0.3970 1.1744 0.4116
Based on results of univariate checking statistics, the fitted DVEC(1,1) model appears to be adequate. Figure 43 shows the plots of cross-correlation matrics of the standardized residuals. The plots appear to be reasonable. However, The innovation distribution is not Gaussian at the 1% significance level. The estimated volatilities and time-varying correlations are shown in Figure 44. 3. S&P index and HPQ returns. > r2=cbind(sp,hpq) > m3=mgarch(r2~1,formula.var=~BEKK(1,1),trace=F) > summary(m3) Call: mgarch(formula.mean = r2 ~ 1, formula.var = ~ BEKK(1, 1), trace = F) Mean Equation: structure(.Data = r2 ~ 1, class = "formula") Conditional Variance Equation: structure(.Data=~ BEKK(1,1),class="formula") Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|)
120 Multivariate Series : m2$std.residuals ibm and hpq
0
2
4
6
8
10
−0.10
0.0
0.2
−0.05
0.0
ACF 0.4 0.6
0.8
0.05
1.0
ibm
12
0
2
4
8
10
12
8
10
12
hpq
0.0
−0.05
0.2
0.4
ACF 0.0
0.6
0.8
0.05
1.0
hpq and ibm
6
−12
−10
−8
−6 Lag
−4
−2
0
0
2
4
6 Lag
6
8
ibm−vol 10
12
Figure 43: Plots of ACF and Cross-correlations of standardized residuals of DVEC(1,1) model for log returns of the IBM and HPQ stocks.
1970
1980
1990
2000
2010
1990
2000
2010
1990
2000
2010
8
10
hpq−vol 12
14
16
year
1970
1980
rho.t 0.2 0.3 0.4 0.5 0.6 0.7
year
1970
1980 year
Figure 44: Time plots of fitted volatility series and time-varying correlations for monthly log returns of the IBM and HPQ stocks.
121 C(1) 0.54816 0.17606 3.113e+00 1.944e-03 C(2) 1.14409 0.40456 2.828e+00 4.853e-03 A(1, 1) 1.19608 0.27246 4.390e+00 1.356e-05 A(2, 1) 1.12129 0.92061 1.218e+00 2.237e-01 A(2, 2) 0.02040 51.76382 3.941e-04 9.997e-01 ARCH(1; 1, 1) 0.40361 0.05407 7.465e+00 3.226e-13 ARCH(1; 2, 1) 0.51887 0.12919 4.016e+00 6.720e-05 ARCH(1; 1, 2) -0.04778 0.02301 -2.077e+00 3.829e-02 ARCH(1; 2, 2) 0.06947 0.05844 1.189e+00 2.351e-01 GARCH(1; 1, 1) 0.85240 0.03640 2.342e+01 0.000e+00 GARCH(1; 2, 1) -0.28689 0.08166 -3.513e+00 4.789e-04 GARCH(1; 1, 2) 0.03403 0.01593 2.136e+00 3.309e-02 GARCH(1; 2, 2) 1.03039 0.03507 2.938e+01 0.000e+00 -------------------------------------------------------------AIC(13) = 7099.983, BIC(13) = 7156.339 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value sp 169.18 0.000000 0.9724 3.227e-05 hpq 11.55 0.003105 0.9833 2.604e-01 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. sp 10.71 0.5543 12 hpq 17.59 0.1287 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. sp 6.319 0.8992 12 hpq 7.149 0.8476 12 Lagrange multiplier test: -------------------------------------------------------------Lag 1 Lag 2 Lag 3 Lag 4 Lag 5 Lag 6 Lag 7 Lag 8 Lag 9 sp -0.41925 0.5873 -0.2481 -0.1930 -0.01348 -1.1427 -0.1976 1.956 0.5699 hpq -0.00176 0.5148 0.2536 0.8122 0.63737 0.1946 0.8097 0.537 -0.5341 Lag 10 Lag 11 Lag 12 C sp -0.1785 -0.2244 -0.14982 -0.6301 hpq -0.9965 0.5669 -0.01296 1.6684 TR^2 P-value F-stat P-value sp 6.787 0.8714 0.6246 0.9054 hpq 7.327 0.8353 0.6751 0.8657
3
4
5
sp−vol 6 7
8
9
122
1970
1980
1990
2000
2010
1990
2000
2010
1990
2000
2010
8
10
hpq−vol 12 14
16
year
1970
1980
rhot.t 0.4 0.5 0.6 0.7 0.8 0.9
year
1970
1980 year
Figure 45: Time plots of fitted volatility series and time-varying correlations for monthly log returns of the S&P composite index and HPQ stock, using the BEKK model. Based on the output, the fitted BEKK(1,1) model is (r1t , r2t ) = (0.548, 1.144) + (a1t , a2t ) σ11,t σ12,t 1.196 0.016 0.019 = σ21,t σ22,t 1.121 0.020 0.001 2 a1,t−1 a1,t−1 a2,t−1 0.404 −0.048 0.404 0.519 + 0.519 0.069 a1,t−1 a2,t−1 a22,t−1 −0.048 0.069 0.852 0.034 σ11,t−1 σ12,t−1 0.852 −0.287 . −0.287 1.03 σ21,t−1 σ22,t−1 0.034 1.03 Figure 45 shows the time plots of fitted volatility series and time-varying correlations, whereas Figure 46 shows the cross-correlations of the standardized residuals. 4. Again, consider the three series jointly. > m4=mgarch(rtn~1,formula.var=~ccc(1,1),trace=F) > summary(m4) Call: mgarch(formula.mean = rtn ~ 1, formula.var = ~ ccc(1, 1), trace = F) Mean Equation: structure(.Data = rtn ~ 1, class = "formula") Conditional Variance Equation: structure(.Data=~ccc(1,1),class="formula") Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|)
123
Multivariate Series : m3$std.residuals sp and hpq
0.0
−0.05
0.2
0.0
ACF 0.4 0.6
0.8
0.05
1.0
sp
0
2
4
6
8
10
12
0
2
4
8
10
12
8
10
12
hpq
0.2 0.0
−0.10
−0.05
0.4
ACF 0.0
0.6
0.8
0.05
1.0
hpq and sp
6
−12
−10
−8
−6 Lag
−4
−2
0
0
2
4
6 Lag
Figure 46: Cross-correlation matrices of the standardized residuals of the fitted BEKK(1,1) model for log returns of the S&P composite index and HPQ stock C(1) 0.81064 C(2) 1.27953 C(3) 0.54434 A(1, 1) 1.91077 A(2, 2) 4.51206 A(3, 3) 1.37084 ARCH(1; 1, 1) 0.06661 ARCH(1; 2, 2) 0.06168 ARCH(1; 3, 3) 0.05847 GARCH(1; 1, 1) 0.89615 GARCH(1; 2, 2) 0.88948 GARCH(1; 3, 3) 0.86841
0.29327 0.39942 0.18360 0.72288 2.25125 0.57222 0.01246 0.02077 0.01965 0.02206 0.04005 0.04028
2.764 5.896e-03 3.203 1.435e-03 2.965 3.158e-03 2.643 8.441e-03 2.004 4.553e-02 2.396 1.692e-02 5.347 1.304e-07 2.969 3.117e-03 2.976 3.042e-03 40.621 0.000e+00 22.208 0.000e+00 21.557 0.000e+00
Estimated Conditional Constant Correlation Matrix: -------------------------------------------------------------ibm hpq sp ibm 1.0000 0.4895 0.5997 hpq 0.4895 1.0000 0.6220 sp 0.5997 0.6220 1.0000 Standard Errors: ibm hpq sp ibm NA 0.03243 0.02422 hpq 0.03243 NA 0.02412 sp 0.02422 0.02412 NA -------------------------------------------------------------AIC(12) = 10606.31, BIC(12) = 10658.33 Normality Test:
124 -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value ibm 27.70 9.653e-07 0.9802 0.05161 hpq 13.59 1.118e-03 0.9864 0.64527 sp 27.56 1.038e-06 0.9924 0.99080 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ibm 8.135 0.7745 12 hpq 11.727 0.4678 12 sp 14.861 0.2491 12 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ibm 5.28 0.9479 12 hpq 13.12 0.3603 12 sp 11.43 0.4924 12 Lagrange multiplier test: -------------------------------------------------------------Lag 1 Lag 2 Lag 3 Lag 4 Lag 5 Lag 6 Lag 7 Lag 8 Lag 9 ibm 0.4992 -0.01253 -0.3425 1.2042 -0.2871 -1.373651 0.4041 -0.4888 -0.2275 hpq 2.2823 -0.39539 -0.3326 0.5047 -0.2425 -0.006306 0.3253 1.8518 0.7567 sp -0.3490 1.09220 0.5281 2.3621 -0.7693 -0.833383 -0.1176 1.4461 -0.5941 Lag 10 Lag 11 Lag 12 C ibm 0.43826 0.5936 -0.20886 0.9581 hpq -0.28281 0.9174 -0.00635 -0.8221 sp -0.04531 -0.1769 0.17301 0.1244 TR^2 P-value F-stat P-value ibm 5.521 0.9383 0.507 0.9710 hpq 11.743 0.4666 1.091 0.4764 sp 11.138 0.5172 1.033 0.5252
Based on the model checking statistics of the output, the model is adequate at the 5% significance level. Figure 47 shows the cross-correlation matrices of the standardized residuals. The fitted model is (r1t , r2t , r3t ) = (0.811, 1.280, 0.544) + (a1t , a2t , a3t ) 2 2 σ1t = 1.91 + 0.067a21,t−1 + 0.896σ1,t−1 2 2 σ2t = 4.51 + 0.062a22,t−1 + 0.889σ2,t−1 2 2 σ3t = 1.37 + 0.058a23,t−1 + 0.868σ3,t−1 .
The correlation matrix is
1.0 0.49 0.60 0.49 1.0 0.62 . 0.60 0.62 1.0
125 ibm and hpq
ibm and sp
0
2
4
6
8
10
12
−0.10
0.0
0.05 −0.05
0.2
−0.05
0.0
0.0
0.4ACF 0.6
0.8
0.05
1.0
ibm
0
2
4
6
8
10
12
0
2
4
hpq
8
10
12
8
10
12
8
10
12
0.10 −0.05
0.0
−0.05
0.2
0.0
0.4
ACF 0.0
0.6
0.05
0.8
0.05
6
hpq and sp
1.0
hpq and ibm
−12
−10
−8
−6
−4
−2
0
0
2
4
6
8
10
12
0
2
4
sp and hpq
6
sp
0.8 0.0
−0.05
−0.05
0.2
0.4
ACF 0.0
0.0
0.6
0.05
0.05
1.0
0.10
sp and ibm
−12
−10
−8
−6 Lag
−4
−2
0
−12
−10
−8
−6 Lag
−4
−2
0
0
2
4
6 Lag
Figure 47: Cross-correlation matrices of the standardized residuals of the fitted CCC(1,1) model for log returns of IBM, HPQ and the S&P composite index 5. Figure 48 shows the time plot of the log returns. In this solution, the number in parentheses next to an estimate denotes its standard error. Let r1t and r2t are the returns of GE stock and S&P 500 index, respectively. The bivariate constant-correlation GARCH model is r1t = 1.159(0.207) + a1t ,
r2t = 0.652(0.141) + a2t ,
2 2 = 3.604(0.909) + 0.092(0.018)a21,t−1 + 0.835(0.030)σ1,t−1 σ1t 2 2 , = 1.406(0.207) + 0.093(0.015)a22,t−1 + 0.847(0.015)σ2,t−1 σ2t
where the correlation between a1t and a2t is 0.776(0.011). The univariate Q statistics of the standardized residuals suggest that the fitted model is adequate. The model shows that there is no dynamic relationship in the volatility, even though the concurrent correlation is strong. Figure 49 shows the cross-correlation matrices of the standardized residuals. The one-step ahead forecast of covariance matrix is 111.30 58.40 Σ996 (1) = , 58.40 50.89 where the covariance is obtained from the estimated correlation. > da=read.table("m-geibmsp2608.txt",header=T) > head(da) Date GE IBM SP 1 19260130 0.042945 -0.010381 0.022472 > ge=log(da$GE+1)*100
ge −40 −20 0 20 40
126
1940
1960
1980
2000
1980
2000
−20
sp 0
20
year
1940
1960 year
Figure 48: Time plot of log returns, in percentages, GE and the S&P composite index from 1926 to 2008.
Multivariate Series : m5$std.residuals ge and sp5
0.0
−0.05
0.2
0.0
ACF 0.4 0.6
0.05
0.8
1.0
ge
0
2
4
6
8
10
12
0
2
4
8
10
12
8
10
12
sp5
0.0
0.2
0.4
0.6
0.8
ACF −0.06 −0.04 −0.02 0.0 0.02 0.04 0.06 0.08
1.0
sp5 and ge
6
−12
−10
−8
−6 Lag
−4
−2
0
0
2
4
6 Lag
Figure 49: Cross-correlation matrices of the standardized residuals of the fitted CCC(1,1) model for log returns of GE and the S&P composite index
127 > sp5=log(da$SP+1)*100 > rt=cbind(ge,sp5) > par(mfcol=c(2,1)) > dim(da) [1] 996 4 > m5=mgarch(rt~1,formula.var=~ccc(1,1),trace=F) > summary(m5) Call: mgarch(formula.mean = rt ~ 1, formula.var = ~ ccc(1, 1), trace = F) Mean Equation: structure(.Data = rt ~ 1, class = "formula") Conditional Variance Equation: structure(.Data=~ccc(1,1),class="formula") Conditional Distribution: gaussian -------------------------------------------------------------Estimated Coefficients: -------------------------------------------------------------Value Std.Error t value Pr(>|t|) C(1) 1.15946 0.20719 5.596 2.835e-08 C(2) 0.65190 0.14090 4.627 4.208e-06 A(1, 1) 3.60404 0.90854 3.967 7.807e-05 A(2, 2) 1.40590 0.20729 6.782 2.031e-11 ARCH(1; 1, 1) 0.09245 0.01786 5.177 2.735e-07 ARCH(1; 2, 2) 0.09340 0.01465 6.375 2.798e-10 GARCH(1; 1, 1) 0.83510 0.02988 27.951 0.000e+00 GARCH(1; 2, 2) 0.84720 0.01469 57.687 0.000e+00 Estimated Conditional Constant Correlation Matrix: -------------------------------------------------------------ge sp5 ge 1.0000 0.7758 sp5 0.7758 1.0000 Standard Errors: ge sp5 ge NA 0.01098 sp5 0.01098 NA -------------------------------------------------------------AIC(8) = 11673.25, BIC(8) = 11712.48 Normality Test: -------------------------------------------------------------Jarque-Bera P-value Shapiro-Wilk P-value ge 120.7 0 0.9819 0.01413 sp5 100.3 0 0.9849 0.21155 Ljung-Box test for standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ge 18.17 0.1106 12 sp5 15.73 0.2038 12
128 Ljung-Box test for squared standardized residuals: -------------------------------------------------------------Statistic P-value Chi^2-d.f. ge 17.69 0.1255 12 sp5 11.90 0.4539 12 > predict(m5,6) $series.pred: ge sp5 [1,] 1.159463 0.6518967 $sigma.pred: ge sp5 [1,] 10.547603 7.133806 [2,] 10.334154 7.019561 $R.pred: ge sp5 [1,] 1 0.775791
6. We solved this exercise using some simple R scripts, dccm.R and dcc.R. For the volatility, we fitted individual Gaussian GARCH(1,1) series to the log returns, in percentages, of the three return series. [This part is done via fGarch package of R.] The volatility series are then used to obtain standardized return series, which are then used in DCC model estimation. The univariate GARCH(1,1) models for GE, IBM, and SP returns are r1t = 1.10 + at ,
2 σt2 = 1.477 + 0.111a2t−1 + 0.867σt−1
r2t = 1.22 + at ,
2 σt2 = 3.399 + 0.112a2t−1 + 0.819σt−1
r3t = 0.63 + at ,
2 σt2 = 0.569 + 0.135a2t−1 + 0.855σt−1
For simplicity, we use m = 6 and start the estimation at t = 10. The initial correlations are assumed to be the sample correlations of the standardized return series. The estimated correlation equation is Rt = (1 − 0.046 − 0.914)R + 0.046Ψt−1 + 0.914Rt−1 , where R is the sample correlation matrix of the standardized return series and t starts with 10 and R9 = R. The standard errors of the two estimates are 0.0071 and 0.0148, respectively. Figure 50 shows the fitted time-varying correlations between the three return series. 7. The fitted model is r1t = 0.693(0.150) + a1t ,
r2t = 1.213(0.218) + a2t ,
129 corr
0.2 0.4 0.6
GE vs IBM
1940
1960
1980
2000
1980
2000
1980
2000
year
0.7 0.5
corr
GE vs SP
1940
1960 year
0.6 0.4
corr
IBM vs SP
1940
1960 year
Figure 50: Time-varying correlations obtained via DCC model for monthly log returns, in percentages, of GE, IBM and S&P 500 index. The time span is from 1926 to 2008.
σ11,t σ22,t
0.092 0 0.203 a21,t−1 (0.681) (0.017) + = 0.060 a22,t−1 2.536 0.073 (0.022) (0.019) (1.008) 0.755 0.072 (0.043) (0.033) σ11,t−1 , + −0.164 0.934 σ22,t−1 (0.072) (0.063)
ρt =
exp(qt ) , 1 + exp(qt )
with
qt = −2.667(0.297) + 4.984(0.402)ρt−1 + 0.085(0.034) √
a1,t−1 a2,t−1 . σ11,t−1 σ22,t−1
Based on the individual standardized residual series, the model is adequate. For 1-step ahead covariance forecast, we use a1,888 = 4.93, a2,888 = 16.383, σ11,888 = 19.278, σ22,888 = 45.313, and ρ888 = 0.780 and the above equations to obtain Σ888 (1) =
20.26 28.15 28.15 59.58
,
where the forecast of q888 (1) is 1.453 and ρ888 (1) = 0.81. 8. The fitted mean equation is r1t = 0.884(0.139) + a1t ,
r2t = 1.528(0.187) + a2t .
130 The fitted means seem to be slightly higher than those of the previous two models. For the volatility model, we use the same notation as in the text and obtain g11,t = 0.683(0.181) + 0.115(0.017)a21,t−1 + 0.865(0.015)g11,t−1 bt = a2,t − q21,t a1,t
q21,t = 0.9990(0.0005)q21,t−1 − 0.0025(0.0004)a2,t−1
g22,t = 0.608(0.213) + 0.090(0.018)b2t−1 + 0.881(0.022)g22,t−1 . Again, the individual standardized residuals fail to indicate model inadequacy. The regression coefficient q21,t seems to follow essentially a random walk model. But the shock a2,t−1 significantly reduces the correlation. To produce forecast, we use a1,888 = 4.739, b888 = 11.799, g11,888 = 20.247, g22,888 = 26.572, and q21,888 = 0.901. The forecasts are g11,888 (1) = 20.779, q21,888 (1) = 0.86 and g22,888 (1) = 36.547. Consequently, we have 20.78 17.89 Σ888 (1) = . 17.89 51.91 Compared with forecasts of the previous two models, the forecast of σ11 seems stable, but that of σ22 varies substantially. 9. The mean equation is r1t = 1.073(0.137) + a1t ,
r3t = 1.883(0.180) + a3t ,
r2t = 1.676(0.207) + 0.057(0.024)r2,t−1 + a2t , where r1t , r2t and r3t denote the return series of S&P 500 index and IBM and GE stock, respectively. The IBM return has a marginally significant serial correlation at lag 2. Using the notation of the text, we have the volatility model g11,t = 0.719(0.182) + 0.115(0.018)a21,t−1 + 0.864(0.016)g11,t−1 b2t = a2t − q21,t a1,t
q21,t = 1.0012(0.0006)q21,t−1 + 0.0018(0.0006)a2,t−1 g22,t = 0.197(0.136) + 0.026(0.006)b22,t−1 + 0.968(0.010)g22,t−1 b3t = a3t − q31,t a1,t − q32,t b2t
q31,t = 0.9972(0.0006)q31,t−1 − 0.0037(0.0004)a3,t−1 q32,t = 0
g33,t = 0.620(0.222) + 0.095(0.017)b23,t−1 + 0.877(0.022)g33,t−1 . The Q-statistics of standardized residuals and their squared series fail to indicate model inadequacy. Based on the model, we observe (i) the diagonal models seem appropriate for the volatility of the transformed innovation. The time-varying correlations follows approximately a random walk, except for q32,t which is zero. Thus, conditional on the effect of S&P 500 index returns, the returns of IBM and GE stocks are uncorrelated. For forecasts, we use a1,888 = 4.55, b2,888 = −0.849, b3,888 = 12.348, g11,888 = 20.076, g22,888 = 62.006, g32,888 = 27.493, q21,888 = 0.760,and q31,888 = 0.739. Omitting the time index, the forecasts are g11 =
131 20.445, g22 = 60.238 and g33 = 39.22, q21 = 0.766, q31 = 0.679 and q32 = 0. Consequently, the forecast of covariance matrix is 20.45 15.66 13.88 Σ888 (1) = 15.66 72.23 10.63 . 13.88 10.63 48.65
10. The answer to each quation is below:
(a) Univariate models: The model for Cisco Systems stock returns is rt = 0.0035(0.0005) + 0.0427(0.0229)rt−1 − 0.0614(0.0218)rt−2 + at , 2 σt2 = 0.0001(0.00001) + 0.1619(0.0139)a2t−1 + 0.7144(0.0196)σt−1 .
With a2494 = 0.0058, r2494 = 0.0088, r2493 = 0.00059, and σ2494 = 0.000432, the 1-step 2 ahead forecast is r2494 (1) = 0.00384 and σ2494 (1) = 0.000425. The 5% VaR of $1 million is VaR1 = $30,072. The model for Dell stock return is rt = 0.0035(0.0007) + at 2 . σt2 = 0.0002(0.00003) + 0.1327(0.0121)a2t−1 + 0.7034(0.0285)σt−1 2 (1) With a2494 = −0.0242 and σ2494 = 0.0009, the forecast is r2494 (1) = 0.0035 and σ2494 = 0.000933. The 5% VaR of $0.5 million is VaR2 = $23,373. The correlation between the two stock returns is 0.367. Therefore, the overall VaR is VaR = $44,346. (b) Constant correlation model: Let r1t an dr2t be the daily log returns of Dell and Cisco stock, respectively. The model built is
r1t = 0.0040(0.0007) + a1t r2t = 0.0036(0.0005) + 0.0234(0.020)r2,t−1 − 0.0504(0.020)r2,t−2 + a2t
σ11,t = 0.00009(0.00002) + 0.083(0.0067)a21,t−1 + 0.853(0.015)σ11,t−1 σ22,t = 0.00004(0.00001)0 .096(0.011)a22,t−1 + 0.853(0.015)σ22,t−1 ρ = 0.370(0.015).
The standardized residuals and their squared series fail to show model inadequacy in the first two moments. To forecast, we have a1,2494 = −0.02465, a2,2492 = 0.005564, σ11,2494 = 0.000916 and σ22,2494 = 0.000443. The forecasts are r 2494 (1) = (0.00403, 0.00378)′ , σ11,2494 (1) = 0.000922 and σ22,2494 (1) = 0.000421. Based on the forecasts, VaR1 = $229,61, VaR2 = $299,70, and the overall VaR is $439,88. (c) Time-varying correlation model: The fitted model is r1t = 0.0031(0.0006) + a1t r2t = 0.0025(0.0003) + 0.0162(0.0175)r2,t−1 − 0.0488(0.0186)r2,t−2 + a2t
g11,t = 0.00009(0.00002) + 0.0817a21,t−1 + 0.8499(0.0186)g11,t−1 bt = a2t − q21,t a1t
q21,t = 1.0002(0.0003)q21,t−1 − 0.3745(0.0312)a2,t−1
g22,t = 0.000024(0.000004) + 0.0725(0.0097)b2t−1 + 0.8933(0.0128)g22,t−1 .
132 The model is also adequate based on the standardized residuals and their squared series. To obtain forecasts, we use (omitting the time index 2494) g11 = 0.000924, a1 = −0.0237, r2 = 0.00879, r2,−1 = 0.00059, q21 = 0.3637, a2 = 0.00676, b = 0.01538 and g22 = 0.000385. The forecasts are g11 (1) = 0.000921, q21 (1) = 0.361, g22 (1) = 0.000385, r1 (1) = 0.0031 and r2 (1) = 0.00261. Therefore, the forecast of the covariance matrix shows σ11 (1) = 0.000921, σ12 (1) = 0.000333, and σ22 (1) = 0.000505. The predicted correlation is 0.488, which is higher than that of the prior two models. Finally, 5% VaRs for the position are VaR1 = $234,13, VaR2 = $343,63, and the overall VaR = $501,38. Among the three approaches to VaR calculation, the univariate models and the constantcorrelation bivariate GARCH(1,1) model produce similar results. This is understood because the bivariate model used in a diagonal GARCH(1,1) model. The result for the time-varying correlation model is slightly higher. This is in part due to the higher predicted correlation between the two stock returns.
Solutions to Exercises of Chapter 11 1. Follwing the procedure mentioned in the text, the Akaike’s approach leads to the model yt+1 yt 0 1 1 = + at+1 , yt+2|t−1 yt+1|t 0 0.8 1.2 yt = [1, 0]st . For the Harvey’s approach, we have 0.8 1 yt+1 1 yt = + at+1 , 0.4at+1 0 0 0.4at 0.4 yt = [1, 0]st . 1 at . Then, yt = For the Aoki’s approach, there are two representations. Let zt = 1−0.8B (1 + 0.4B)zt and zt = 0.8zt−1 + at . The first representation is zt 0 1 zt−1 0 = + at+1 zt+1 0 0.8 zt 1 yt = [0.4, 1]st .
The 2nd representation is 0 1 zt 1 zt−1 = + at zt+1 − at+1 0 0.8 zt − at 0.8 yt = [0.4, 1]st + at . In all three approaches, the dimension of the state vector is 2 = max(p, q + 1). 2. Let yt = ln(x)t , where xt is the daily realized volatility of the Alcoa stock returns constructed using 20-minute intradaily log returns. (a) The fitted ARIMA(0,1,1) model is (1 − B)yt = (1 − 0.870B)at−1 ,
σ̂a = 0.603,
where the standard error of the MA(1) coefficient is 0.028. This model appears to be adquate with Q(12) = 13.8 and Q(24) = 27.9 for the residuals. These two Ljung-Box statistics have high p-values. 133
0.0
0.5
value 1.0 1.5
2.0
2.5
134
0
100
200
300
day
Figure 51: Time plot of filtered state vector for the log realized volatility of daily log returns of Alcoa stock. The sample period is from January 2, 2003 to May 7, 2004. The realized volatility is based on 20-minute intradaily log returns. Dotted lines show 95% pointwise confidence intervals. (b) Consider the local trend model yt = µt + et , µt+1 = µt + ηt ,
et ∼ N (0, σe2 )
ηt ∼ N (0, ση2 ),
where et and ηt are independent. The fitted model gives σ̂e = 0.564 and σ̂η = 0.075. The time plots of filtered and smoothed state vectors are given in Figures 51 and 52, respectively. They are close to those shown in the text that uses 10 minutes intradaily log returns. 3. Let rt and rM,t be the monthly excess returns of the Pfizer stock and S&P 500 Compisite Index, respectively. (a) The constant-coefficient CAPM is rt = 0.0122 + 0.8513rM,t + et ,
σ̂e = 0.0665.
The adjusted R2 of the regression is 23.17%. (b) For the time-varying CAPM, the estimates of the standard errors of the innovations to αt and βt are 1.49 × 10−6 and 0.0682, respectively. The standard error of the measurement error is 0.0642. Thus, αt is approximately a constant, but βt evolves over time. Figure 53 shows the smoothed estimate of αt and βt ; part (c) and part (d). The plot of βt shows a decreasing trend toward the value of 0.6. 4. There are many ways to convert the model into a State-Space form. We give one form as follows.
0.5
value 1.0
1.5
135
0
100
200
300
day
Figure 52: Time plot of smoothed state vector for the log realized volatility of daily log returns of Alcoa stock. The sample period is from January 2, 2003 to May 7, 2004. The realized volatility is based on 20-minute intradaily log returns. Dotted lines show 95% pointwise confidence interval.
(c) Alpha(t)
0
50
100
150
value 0.01064 0.01064 0.01064
excess return −0.1 0.0 0.1 0.2
(a) Monthly simple excess returns
0
100
150
(d) Beta(t)
rtn −0.10 0.0 0.10
value 0.6 0.8 1.0 1.2 1.4
(b) Expected returns
50
0
50
100
150
0
50
100
150
Figure 53: Time plots of statistics for fitting a time-varying CAPM to the monthly simple excess returns of Pfizer stock from January 1990 to December 2003. S&P Composite Index returns are used as the market returns. Part (a) is time plot of Pfizer returns, (b) is the expected returns, (c) and (d) are smoothed estimates of αt and βt , respectively.
136 (a) The transition and observation equations are 1 xt φ1 φ2 φ3 xt+1 xt = 0 1 0 xt−1 + 0 at+1 0 xt−2 0 0 1 xt−1 yt = [1, 0, 0]st + et , where st = (xt , xt−1 , xt−2 )′ . (b) Let e∗t = et − c, then e∗t ∼ N (0, σe2 ). The corresponding State-Space form is 1 xt φ1 φ2 φ3 xt+1 xt = 0 1 0 xt−1 + 0 at+1 xt−2 0 xt−1 0 0 1 ∗ yt = c + [1, 0, 0]st + et . 5. Let zt be the growth rate of U.S. PPI and yt be the mean-corrected series of zt . (a) The fitted AR(3) model is (1 − 0.293B − 0.122B 2 + 0.089B 3 )yt = at ,
σ̂a = 0.0001,
where the standard errors of the coefficients are 0.036, 0.038, and 0.036, respectively. (b) For the State-Space form, the estimates of AR(3) coefficients are 0.2934, 0.1218, and 0.0893, respectively, and the estimated standard errors of the innovations are 0.00777 and 0.000329 for σa and σe , respectively. Figure 54 shows the growth rate series of PPI, that is the zt series. Figure 55 shows the one-step ahead forecast errors (Kalman filter) and the smoothed state variable.
−0.04
−0.02
growth rate 0.0 0.02
0.04
0.06
137
1950
1960
1970
1980 year
1990
2000
2010
Figure 54: Time plots of the growth rate series of U.S. monthly PPI from 1947 to 2009
−0.04
value 0.0 0.04
(a) One−step ahead forecast errors
1950
1960
1970
1980 year
1990
2000
2010
value −0.06 −0.02 0.02
(b) Smoothed estimate of the state
1950
1960
1970
1980 year
1990
2000
2010
Figure 55: Time plots of the one-step ahead forecast errors and the smoothed state variables for the growth rates of U.S. PPI from 1947 to 2009.
138
Solutions to Exercises of Chapter 12 1. Based on Result 1 with n = 1 and x̄ = x, the posterior distribution of µ given x is normal with mean 25x/29 and variance 4 × 25/(4 + 45) = 100/29. 2. One may follow exactly the steps of Section 10.5 with the modification y0,t = yt − φ1 yt−2 − · · · − φp yt−p ,
xo,t = xt − φ1 xt−1 − · · · − φp xt−p
for t = p + 1, · · · , n. The posterior distribution of β given φ = (φ1 , · · · , φp )′ and σ 2 is the same as that of Eq. (10.9) except that the summation is summing from t = p + 1 to n. For φ, we have zt = yt − β ′ xt and the model zt = φ′ z t−1 + at ,
t = p + 1, · · · , n,
where z t−1 = (zt−1 , · · · , zt−p )′ . Then the least squares estimate of φ is
φ̂ =
n X
t=p+1
−1
z t−1 z ′t−1
n X
t=p+1
z t−1 zt ,
P which is normally distributed with mean φ and covariance σ 2 ( nt=p+1 z t−1 z t−2 )−1 . The posterior distribution of φ given β and σ 2 can be obtained by Result 1a. Specifically, the posterior mean φ∗ and covariance matrix Σ∗ are given by ! Pn Pn ′ ′ z z z z t−1 t−1 t−1 t−1 t=p+1 t=p+1 Σ−1 + Σ−1 φ∗ = Σ∗ φ̂ + Σ−1 ∗ = o φo . 0 , σ2 σ2 Finally, at = zt − φ1 zt−1 − · · · − φp zt−p and distribution of σ 2 given β and φ is an inverted chi-squared distribution, i.e. P vλ + nt=p+1 a2t ∼ χ2v+n−p . σ2 3. One may use linear regression techniques to solve this problem. The missing values xh and xh+1 are related to the data points {xh − p, xh−p+1 , · · · , xh−1 ; xh+2 , · · · , xh+p+1 }. Thus, the key is to cast the problem in a multiple linear regression framework. Let β = (xh+1 , xh )′ . With t = h, the model is xh = φ1 xh−1 + · · · + φp xh−p + ah . Define yh = φ1 xh−1 + · · · + φp xh−p , bh = −ah , and xh = (0, 1)′ . Then we have yh = x′h β + bh . 139
140 For t = h + 1, the model is xh+1 = φ1 xh + φ2 xh−1 + · · · + φp xh+1−p + ah+1 . Define yh+1 = φ2 xh−1 + · · · + φp xh+1−p , bh+1 = −ah+1 , and xh+1 = (1, −φ1 )′ . Then we have yh+1 = x′h+1 β + bh+1 . For t = h + 2, the model is xh+2 = φ1 xh+1 + φ2 xh + φ3 xh−1 + · · · + φp xh+2−p + ah+2 . Now define yh+2 = xh+2 − φ3 xh−1 − · · · − φp xh+2−p , bh+2 = ah+2 and xh+2 = (φ1 , φ2 )′ . Then we have yh+2 = x′h+2 β + bh+2 . For t = h + 3, define yh+3 = xh+3 − φ1 xh+2 − φ4 xh−1 − · · · − φp xh+3−p , bh+3 = ah+3 and xh+3 = (φ2 , φ3 )′ to obtain yh+3 = x′h+3 β + bh+3 . Pj−2 P Continuing the process, we can define yh+j = xh+j − i=1 φi xh−i − pi=j+1 φj xh+j−i , xh+j = (φj−1 , φj )′ , and bh+j = ah+j for j = 4, · · · , p. Finally, for t = h + p + 1, the model is xh+p+1 = φ1 xh+p + · · · + φp−1 xh+2 + φp xh+1 + ah+p+1 . Define yh+p+1 = xh+p+1 − φ1 xh+p − · · · − φp−1 xh+2 , xh+p+1 = (φp , 0)′ and bh+p+1 = ah+p+1 . Then yh+p+1 = x′h+p+1 β + bh+p+1 . Consequently, we have a multiple linear regression yh+j = x′h+j β + bh+j ,
j = 0, 1, · · · , p + 1.
The least squares estimate of β is
β̂ =
p+1 X j=0
−1
xh+j x′h+j
p+1 X j=0
xh+j yh+j .
The posterior distribution of the missing values can then be obtained by using Result 1a. 4. Consider the monthly log returns, in percentages, of Ford stock from 1965 to 2008. The fitted GARCH model, via fGarch package of R, is rt = 0.882(0.338) + at ,
at = σt ǫt
2 σt2 = 3.005(1.556) + 0.143(0.033)a2t−1 + 0.838(0.039)σt−1 ,
where the number is parentheses denotes standard error. This model is adequate based on the Ljung-Box statistics for the standardized residuals and their squared series. For the stochastic volatility model,we use the result of GARCH(1,1) model as the initial volatility estimate and the default prior similar to that in the text. With iterations (1000,3000), we have rt = 0.639(0.138) + at ,
at = σt ǫt ,
2 ln(σt2 ) = 0.785(0.125) + 0.806(0.031) ln(σt−1 ) + ηt ,
ση2 = 0.128(0.011),
141 15 25 35 5
vol
(a) GARCH(1,1) model
1970
1980
1990
2000
2010
2000
2010
year
15 5
vol
25
(b) SV model
1970
1980
1990 year
Figure 56: Volatility series for monthly log returns of Ford stock from 1965 to 2008 (returns are in percentage). Part (a) is based on a GARCH(1,1) model and part(b) on a simple stochastic volatility model, which is estimated via Gibbs sampler with 1000+3000 iterations. where the estimates are posterior means and the number in parentheses is the corresponding posterior standard error based on a Gibbs sampler of the last 3000 iterations. Finally, Figure 56 shows the fitted volatility series with (a) for the GARCH model and (b) the stochatic volatility model. The two volatility series exhibit similar pattern, but the magnitude of the GARCH volatility seems to be larger that those of the SV model. 5. Consider the daily log returns, in percentages, of CSCO stock from 2001 to 2008. If a GARCH(1,1) model is fitted,the result is rt = 0.050(0.045) + at ,
at = σt ǫt ,
ǫt ∼iid N (0, 1),
2 σt2 = 0.087(029(+0.075(0.017)a2t−1 + 0.914(0.019)σt−1 .
We use the fitted volatility as initial volatility in SV model estimation. Based on Gibbs sampler with 1000 + 2000 iterations, we obtain the model rt = 0.016(0.018) + at ,
at = σt ǫt ,
2 ln(σt2 ) = 0.125(0.016) + 0.915(0.010) ln(σt−1 ) + ηt ,
ση2 = 0.121(0.006),
where the coefficients are posterior means and the numbers in parentheses are posterior standard errors. Figure 57 shows the time plot of the stochastic volatility with part (a) for GARCH(1,1) model and part (b) for the SV model. To obtain the VaR, we compute 1% quantile of the prediction for each Gibbs iteration and use the posterior mean of the quantiles to compute VaR. It turns out that the 1% VaR is $62611.8 for the long position of 1 million.
142
5 1
3
vol
7
(a) GARCH(1,1) model
2002
2004
2006
2008
year
1
3
vol
5
7
(b) SV model
2002
2004
2006
2008
year
Figure 57: Fitted stochastic volatility for daily log returns of Cisco stock from 2001 to 2008: (a) GARCH(1,1) model and (b) SV model using a Gibbs sampler with 1000+2000 iterations.
0
5
10
15
vol
20
25
30
35
Volatility of Ford stock returns
1970
1980
1990
2000
2010
year
Figure 58: Estimated volatility of monthly log returns for Ford stock from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model.
143 6. Let r1t and r2t be the monthly log returns, in percentages, of the Ford stock and S&P 500 index from 1965 to 2008 for 528 observations. Let r t = (r1t , r2t )′ . Employing a BEKK(1,1) model and using finmetrics of S-Plus, we obtain the mean equation, r t = (0.894, 0.490)′ + at , where the standard errors of the two constant terms are 0.352 and 0.199, respectively. The volatility equation is Σt = A0 A′0 + A1 at−1 a′t−1 A′1 + B 1 Σt−1 B ′1 , where Ao =
1.702 0 0.738 1.049
,
A1 =
0.375 −0.166 0.011 0.247
,
B1 =
0.924 0.024 0.004 0.919
.
As usual, several estimates are significant at the 5% level. We use the estimated volatility as initial values in our MCMC estimation of a bivariate stochastic volatility model. We apply the Gibbs procedure discussed in the text to the bivariate series r t = (r1t , r2t )′ . The results are based on 1000+2000 iterations with the first 1000 iterations as burn-in. The results reported below are the posterior means and standard errors of the last 3000 iterations. The time-varying covariance matrix is parameterized using the Cholesky decomposition. Thus, the mean equations entertained are r1t = 0.643(0.314) + a1t r2t = 0.516(0.194) + a2t . For volatility, we have ln(g1t ) = 0.888(0.129) + 0.781(0.032) ln(g1,t−1 ) + v1t ln(g2t ) = 1.259(0.135) + 0.528(0.050) ln(g2,t−1 ) + v2t q21t = 0.258(0.029) + 0.007(0.064)q21,t−1 + ut where the variances of the innovations are Var(v1t ) = 0.118(0.011), Var(v2t ) = 0.091(0.008), and Var(ut ) = 0.049(0.009). Thus, q21,t has no serial dependence. Based on the fitted series of g1t , g2t and q21t , which are the posterior means of the Gibbs draws, we compute the conditional covariance matrices of the two returns. The conditional covariance matrices are then used (r1t ,r2t ) to obtain the time-varying β as βt = Cov Var(r2t ) . Figures 58 and 59 show the time-plot of the volatility series for Ford stock and the S&P 500 index. Figure 60 shows the time-varying coefficients. From those series, time-varying beta can be obtained. The result is shown in Figure 61. The SV model produces a few points at which the beat is negative. Again, this might be due to the fact that we use posterior means in the calcualtion. 7. Consider the monthly log returns, in percentages, of Procter & Gamble stock (r1t ) and the value-weighted index (r2t ) from January 1965 to December 2008 for 528 observations. Let r t = (r1t , r2t )′ and at = (a1t , a2t )′ with the latter being the residuals of the returns. Using S-Plus package, we obtain a fitted BEKK model below. The mean equation is r t = (0.914, 0.784)′ + at ,
144
5 2
3
4
vol
6
7
8
Volatility of S&P index returns
1970
1980
1990
2000
2010
year
Figure 59: Estimated volatility of monthly log returns for S&P 500 index from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model.
0.2 0.6 −0.4
corr
(a) BEKK model
1970
1980
1990
2000
2010
2000
2010
year
0.2 0.6 −0.4
corr
(b) SV model
1970
1980
1990 year
Figure 60: Time-varying correlation between monthly log returns of Ford stock and S&P 500 index from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model.
145
1.5 0.0
beta
3.0
(a) BEKK model
1970
1980
1990
2000
2010
2000
2010
year
−1 0 1 2
beta
(b) SV model
1970
1980
1990 year
Figure 61: Time-varying beta between monthly log returns of Ford stock and S&P 500 index from 1965 to 2008. The estimate is based on a SV model. where the standard errors of the two constant terms are 0.231 and 0.196, respectively. The volatility equation is Σt = A0 A′0 + A1 at−1 a′t−1 A′1 + B 1 Σt−1 B ′1 , where Ao =
2.276 0 −0.189 0.013
,
A1 =
0.292 0.044 −0.160 0.380
,
B1 =
0.864 −0.000 0.120 0.870
.
Again, several estimates are no significant at the 5% level. Model checking of the individual series fails to reject the adequacy of the model. We use the volatility estimates of the BEKK model as the initial estimates in MCMC estimation of a bivariate stochastic volatility model stated in the text. Based on 1000 + 2000 iterations, we obtain the model r1t = 0.934(0.208) + a1t r2t = 0.755(0.192) + a2t . For volatility, we have ln(g1t ) = 1.560(0.155) + 0.508(0.048) ln(g1,t−1 ) + v1t ln(g2t ) = 0.769(0.101) + 0.719(0.037) ln(g2,t−1 ) + v2t q21t = 0.372(0.038) + ut where the variances of the innovations are Var(v1t ) = 0.098(0.008), Var(v2t ) = 0.113(0.010), and Var(ut ) = 0.094(0.021). From on the fitted series of g1t , g2t and q21t , which are the
146
0
5
vol
10
15
Volatility of PG stock returns
1970
1980
1990
2000
2010
year
Figure 62: Estimated volatility of monthly log returns for PG stock from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model. posterior means of the Gibbs draws, we compute the conditional covariance matrices of the two returns. Figures 62 and 63 compare the volatility of BEKK model and the SV model. For the PG stock returns, the BEKK model provides higher volatility. Figure 64 compares the time-varying correlations between PG stock and VW index. It seems that the SV model provides a more stable correlations. This might be due to the fact that we compute the correlations using the posterior means of g1t , g2t and q21t . 8. Let yt and xt be the monthly mortgage rate and the 3-m Treasury bill rate, respectively. A direct regression shows yt = 4.34(0.12) + 0.825(0.019)xt + et . However, the residuals êt has high serial correlations with Q(10) = 2601.3, which is highly significant. We consider the differenced series mt = yt − yt−1 and rt = xt − xt−1 . The fitted model is mt = 0.281(0.024)rt + ǫt . PACF of the residuals ǫ̂t suggests that an AR(2) model for the residuals. See Figure 65. We then employ a regression model with time series error. The fitted model is (1 − 0.455B + 0.274B 2 )(mt − 0.219rt ) = vt , where the standard errors of the AR coefficients are 0.047 and 0.045, respectively, the standard error of the coefficient of rt is 0.025, and the variance of vt is 0.0575. Model checking shown in Figure 66 fails to indicate any model inadequacy. Thus, the model is adequate. Next, we apply MCMC method to estimate the regression model with time series errors. Using default, non-informative, priors, and 500 + 1000 iterations, we obtain the model (1 − 0.454B + 0.273B 2 )(mt − 0.220rt ) = vt ,
0
2
4
vol
6
8
10
147
1970
1980
1990
2000
2010
year
Figure 63: Estimated volatility of monthly log returns for VW index from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model.
0.2 0.6 −0.4
corr
(a) BEKK model
1970
1980
1990
2000
2010
2000
2010
year
0.2 0.6 −0.4
corr
(b) SV model
1970
1980
1990 year
Figure 64: Time-varying correlation between monthly log returns of PG stock and VW index from 1965 to 2008. The solid line is from a BEKK model whereas the dashed line is from SV model.
148 0.0 0.4 0.8
ACF
Series m2$residuals
0
5
10
15
20
25
20
25
Lag
−0.2 0.0 0.2
Partial ACF
Series m2$residuals
0
5
10
15 Lag
Figure 65: Partical autocorrelation function for the linear regression model of differenced data. where the standard errors of the AR coefficients are 0.046 and 0.046, respectively, the standard error of the coefficient of rt is 0.025 and the variance of vt is 0.059 with standard error 0.004. Consequently, the two estimation methods provide essentially the same results.
149
−4
0
4
Standardized Residuals
0
100
200
300
400
Time
ACF
0.0 0.4 0.8
ACF of Residuals
0
5
10
15
20
25
Lag
0.4 0.0
p value
0.8
p values for Ljung−Box statistic
2
4
6
8
10
lag
Figure 66: Model checking for a linear regression model with AR(2) errors.