Professional Documents
Culture Documents
FIN 5309 Homework 9 Solution Fall 2018: Instructions
FIN 5309 Homework 9 Solution Fall 2018: Instructions
Fall 2018
Instructions
• All tests use the 5% significance level for type-I error.
• For daily series, use ten (10) lags in all ACF or ARCH-effect tests. For monthly series,
use twelve (12) lags.
• The purpose of this assignment is to analyze the volatility series of daily and monthly
asset returns. All models include both the mean and volatility equations. You should
always perform model checking to confirm the adequacy of a fitted model.
Solution:
This is essentially a “which disadvantages of ARCH are overcome by GARCH” question.
The disadvantages of ARCH(q) are:
- How do we decide on q?
- The required value of q might be very large
- Non-negativity constraints might be violated.
When we estimate an ARCH model, we require
2. (a) Suppose that Suppose that 𝐸(𝑢𝑡 |𝑢𝑡−1 , 𝑢𝑡−2 , . . . ) = 0, that var(𝑢𝑡 |𝑢𝑡−1 , 𝑢𝑡−2 , . . . )
2
follows the ARCH(1) model 𝜎𝑡2 = 𝛼0 + 𝛼1 𝑢𝑡−1 , and that the process for 𝑢𝑡 is stationary.
𝛼0
Show that 𝑣𝑎𝑟(𝑢𝑡 ) = 1−𝛼 . (Hint: Use the law of iterated expectations 𝐸(𝑢𝑡2 ) =
1
𝐸[𝐸(𝑢𝑡2 |𝑢𝑡−1 )].)
(b) Extend the result in (a) to the ARCH(p) model.
(c) Show that ∑𝑝𝑖=1 𝛼𝑖 < 1 for a stationary ARCH(p) model.
(d) Extend the result in (a) to the GARCH(1,1) model.
(e) Show that 𝛼1 + 𝛽 < 1 for a stationary GARCH(1,1) model.
Solution:
(a) From the law of iterated expectations
𝐸(𝑢𝑡2 ) = 𝐸[𝐸(𝑢𝑡2 |𝑢𝑡−1 )]
= 𝐸(𝜎𝑡2 )
2 )
= 𝐸(𝛼0 + 𝛼1 𝑢𝑡−1
2 )
= 𝛼0 + 𝛼1 𝐸( 𝑢𝑡−1
= 𝛼0 + 𝛼1 𝐸(𝑢𝑡2 )
where the last line uses stationarity of 𝑢. Solving for 𝐸(𝑢𝑡2 ) gives the required result.
(b) As in (a)
𝐸(𝑢𝑡2 ) = 𝐸(𝜎𝑡2 )
2 2 2
= 𝐸(𝛼0 + 𝛼1 𝑢𝑡−1 + 𝛼2 𝑢𝑡−2 + ⋯ + 𝛼𝑝 𝑢𝑡−𝑝 )
2 ) 2 ) 2 )
= 𝛼0 + 𝛼1 𝐸(𝑢𝑡−1 + 𝛼2 𝐸(𝑢𝑡−2 + ⋯ + 𝛼𝑃 𝐸(𝑢𝑡−𝑃
= 𝛼0 + 𝛼1 𝐸(𝑢𝑡2 ) + 𝛼2 𝐸(𝑢𝑡2 ) + ⋯ + 𝛼𝑃 𝐸(𝑢𝑡2 )
𝛼
So that 𝐸(𝑢𝑡2 ) = 1−∑𝑝0
𝑖=1
𝛼𝑖
(c) This follows from (b) and the restriction that 𝐸(𝑢𝑡2 ) > 0.
(e) This follows from (d) and the restriction that 𝐸( 𝑢𝑡2 ) > 0
Solution:
In fact, it is possible to produce volatility (conditional variance) forecasts in exactly the
same way as forecasts are generated from an ARMA model by iterating through the
equations with the conditional expectations operator.
We know all information including that available up to time T. What we want to generate
𝑇 , … , 𝜎𝑇+𝑠 |𝛺𝑇 where T denotes all information
2 2 |𝛺 2
are forecasts of 𝜎𝑇+1 |𝛺𝑇 , 𝜎𝑇+2
available up to and including observation T. Adding 1 then 2 then 3 to each of the time
subscripts, we have the conditional variance equations for times T+1, T+2, and T+3:
2
𝜎𝑇+1 = 𝛼0 + 𝛼1 𝑢2𝑇 + 𝛽𝜎𝑇2 (1)
2
𝜎𝑇+2 = 𝛼0 + 𝛼1 𝑢2𝑇+1 + 𝛽𝜎𝑇+1
2
(2)
2
𝜎𝑇+3 = 𝛼0 + 𝛼1 𝑢2𝑇+2 + 𝛽𝜎𝑇+2
2
(3)
2
𝑓
Let 𝜎1, 𝑇 be the one step ahead forecast for h made at time T. This is easy to calculate
since, at time T, we know the values of all the terms on the right hand side (RHS).
𝑓2
𝜎1, 𝑇 = 𝛼0 + 𝛼1 𝑢2𝑇 + 𝛽𝜎𝑇2
𝑓2
𝜎1, 𝑇 = 0.0172 + 0.1251𝑢2𝑇 + 0.0023𝜎𝑇2
2
𝑓 𝑓2
Given 𝜎1, 𝑇 , how do we calculate 𝜎2, 𝑇 , that is the 2-step ahead forecast for 𝜎 2 made at
time T?
From (2), we can write
𝑓2 𝑓2
𝜎2, 𝑇 = 𝛼0 + 𝛼1 𝐸(𝑢2𝑇+1 |𝛺𝑇 ) + 𝛽𝜎1,𝑇 (4)
where 𝐸(𝑢2𝑇+1 |𝛺𝑇 ) is the expectation, made at time T, of 𝑢2𝑇+1 , which is the squared
disturbance term. The model assumes that the series 𝑢𝑡 has zero mean, so we can now
write
Var(ut) = E[(ut -E(ut))2]= E[(ut)2].
2 𝑓2
but we do not know 𝜎𝑇+1 , so we replace it with 𝜎1, 𝑇 , so that (4) becomes
𝑓2 𝑓2 𝑓2
𝜎2, 𝑇 = 𝛼0 + 𝛼1 𝜎1,𝑇 + 𝛽𝜎1, 𝑇
𝑓2
= 𝛼0 + (𝛼1 + 𝛽)𝜎1,𝑇
𝑓2
= 0.0172 + (0.1251 + 0.0023)𝜎1,𝑇
𝑓2
= 0.0172 + 0.1274𝜎1,𝑇
𝑓2
= 𝛼0 + (𝛼1 + 𝛽)𝜎2,𝑇
𝑓2
= 𝛼0 + (𝛼1 + 𝛽) [𝛼0 + (𝛼1 + 𝛽)𝜎1, 𝑇 ]
𝑓2
= 𝛼0 + 𝛼0 (𝛼1 + 𝛽) + (𝛼1 + 𝛽)2 𝜎1,𝑇
𝑓2
= 0.0172 + 0.0172(0.1251 + 0.0023) + (0.1251 + 0.0023)2 𝜎1,𝑇
𝑓2
= 0.0172 + 0.0172(0.1251 + 0.0023) + (0.1251 + 0.0023)2 𝜎1,𝑇
𝑓2
= 0.0194 + 0.0162𝜎1,𝑇
And so on. This is the method we could use to forecast the conditional variance of yt. If yt
were, say, daily returns on the FTSE, we could use these volatility forecasts as an input in
the Black Scholes equation to help determine the appropriate price of FTSE index options.
4. (R application) Consider the daily returns of Amazon (amzn) stock from January 2, 2009
to December 31, 2014. The simple returns are available from CRSP and in the file d-
amzn3dx0914.txt (the column with heading amzn). Transform the simple returns to log
returns. Multiple the log returns by 100 to obtain the percentage returns. Let 𝑟𝑡 be the
percentage log returns.
(a) Is the expected value of 𝑟𝑡 zero? Why? Are there any serial correlations in 𝑟𝑡 ? Why?
(b) Fit a Gaussian ARMA-GARCH model to the 𝑟𝑡 series. Obtain the normal QQplot of
the standardized residuals, and write down the fitted model. Is the model adequate? Why?
(c) Build an ARMA-GARCH model with Student-t innovations for the log return series.
Perform model checking and write down the fitted model.
(d) Obtain 1-step to 5-step ahead mean and volatility forecasts using the fitted ARMA-
GARCH model with Student-t innovations.
Solution:
(a) The one sample t test shows t = 2.03 with p-value 0.043 so that the mean is different from
zero. The Ljung-Box statistic shows Q(10) = 10.97 with p-value 0.36. Therefore, there
are no serial correlations.
> install.packages("timeDate")
> install.packages("timeSeries")
> install.packages("fBasics")
> install.packages("fGarch")
> library("timeDate")
> library("timeSeries")
> library("fBasics")
> library("fGarch")
> setwd("…/Homework/HW9")
> require(fGarch)
> da<-read.table("d-amzn3dx0914.txt",header=T)
> head(da)
PERMNO date amzn vwretd ewretd sprtrn
1 84788 20090102 0.060062 0.030501 0.038274 0.031608
2 84788 20090105 -0.005519 -0.000579 0.016764 -0.004668
3 84788 20090106 0.061043 0.011298 0.033647 0.007817
4 84788 20090107 -0.020223 -0.030489 -0.022271 -0.030010
5 84788 20090108 0.017082 0.006284 0.011896 0.003397
6 84788 20090109 -0.028866 -0.022409 -0.018748 -0.021303
> rt<-log(da$amzn+1)*100
> t.test(rt)
data: rt
t = 2.0296, df = 1509, p-value = 0.04257
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.003999691 0.234462533
sample estimates:
mean of x
0.1192311
> Box.test(rt,lag=10,type='Ljung')
Box-Ljung test
data: rt
X-squared = 10.974, df = 10, p-value = 0.3595
Figure 1 Normal QQ-plot for the standardized residuals of Gaussian GARCH(1,1) model fitted to the daily log returns of Amazon
stock
> m1<-garchFit(~garch(1,1),data=rt,trace=F)
> summary(m1)
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 1), data = rt, trace = F)
Conditional Distribution:
norm
Coefficient(s):
mu omega alpha1 beta1
0.1093730 0.0230236 0.0072675 0.9876790
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.109373 0.056680 1.930 0.053648 .
omega 0.023024 0.006821 3.375 0.000737 ***
alpha1 0.007267 0.001542 4.713 2.45e-06 ***
beta1 0.987679 0.001801 548.413 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Log Likelihood:
-3365.207 normalized: -2.228614
> plot(m1)
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 13
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 0
(c) Model checking indicates that the model is reasonable. The QQ-plot is in Figure 2. The
fitted model is
∗
𝑟𝑡 = 0.087 + 𝑢𝑡 , 𝑢𝑡 = 𝜎𝑡 𝑣𝑡 , 𝑣𝑡 ~𝑡4.31
2 2
𝜎𝑡2 = 0.061 + 0.017𝑢𝑡−1 + 0.968𝜎𝑡−1
Figure 2 QQ-plot for the standardized residuals of Gaussian GARCH(1,1) model with Student-t innovations fitted to the daily log
returns of Amazon stock
> m2<-garchFit(~garch(1,1),data=rt,trace=F,cond.dist="std")
> summary(m2)
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 1), data = rt, cond.dist = "std",
trace = F)
Conditional Distribution:
std
Coefficient(s):
mu omega alpha1 beta1 shape
0.087043 0.060536 0.017110 0.968295 4.305239
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.087043 0.046114 1.888 0.05909 .
omega 0.060536 0.028628 2.115 0.03447 *
alpha1 0.017110 0.005579 3.067 0.00216 **
beta1 0.968295 0.010104 95.832 < 2e-16 ***
shape 4.305239 0.425976 10.107 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Log Likelihood:
-3195.863 normalized: -2.116465
> plot(m2)
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 13
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 0
> predict(m2,5)
meanForecast meanError standardDeviation
1 0.08704318 1.874345 1.874345
2 0.08704318 1.876814 1.876814
3 0.08704318 1.879244 1.879244
4 0.08704318 1.881636 1.881636
5 0.08704318 1.883989 1.883989
5. (R application) Consider the daily log returns of Caterpillar stock (CAT) from January 3,
2006 to April 15, 2017. You may download the data using quantmod. Let 𝑟𝑡 be the log
returns, which can be obtained via
require(quantmod)
getSymbols("CAT",from="2006-01-03",to="2017-04-15")
head(CAT)
rtn <- diff(log(as.numeric(CAT[,6])))
(a) Are there any serial correlations in the log return series 𝑟𝑡 ? Why?
(b) Are there any ARCH effects in the log return series 𝑟𝑡 ? Why?
(c) Fit a Gaussian ARMA-GARCH model to the 𝑟𝑡 series. Perform model checking,
including showing the normal QQ-plot of the standardized residuals. Is the model
adequate? Write down the fitted model.
(d) Build a GARCH model with standardized Student-t innovations for the 𝑟𝑡 series.
Perform model checking, including the QQ-plot. Is the model adequate? Why?
(e) Write down the fitted model.
(f) Obtain 1-step to 5-step ahead mean and volatility forecasts using the fitted ARMA-
GARCH model with standardized Student-t innovations.
Solution:
(a) No, the Ljung-Box statistics give Q(10) = 16.05 with p-value 0.098.
> require(quantmod)
> getSymbols("CAT",from="2006-01-03",to="2017-04-15")
> head(CAT)
> tail(CAT)
> ts.plot(rtn)
> Box.test(rtn,lag=10,type="Ljung")
Box-Ljung test
data: rtn
X-squared = 16.045, df = 10, p-value = 0.09836
(b) Yes, the Ljung-Box statistics of squared returns give Q(10) = 917.6 with p-value
close to zero.
> Box.test(rtn^2,lag=10,type="Ljung")
Box-Ljung test
data: rtn^2
X-squared = 917.33, df = 10, p-value < 2.2e-16
(c) The QQ-plot is in Figure 3. The model is not adequate as the normality assumption is
rejected. The fitted model is
𝑟𝑡 = 4.93 × 10−4 + 𝑢𝑡 ,
𝑢𝑡 = 𝜎𝑡 𝑣𝑡 , 𝑣𝑡 ~𝑖𝑖𝑑𝑁(0,1)
2 −6 2 2
𝜎𝑡 = 4.42 × 10 + 0.049𝑢𝑡−1 + 0.939𝜎𝑡−1
Figure 3 QQ-plot of standardized residuals
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 1), data = rtn, trace = F)
Conditional Distribution:
norm
Coefficient(s):
mu omega alpha1 beta1
4.9750e-04 4.4050e-06 4.9288e-02 9.3927e-01
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 4.975e-04 3.075e-04 1.618 0.105728
omega 4.405e-06 1.254e-06 3.513 0.000443 ***
alpha1 4.929e-02 8.065e-03 6.112 9.87e-10 ***
beta1 9.393e-01 1.012e-02 92.774 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Log Likelihood:
7380.075 normalized: 2.599533
Description:
Sat Dec 01 12:09:06 2018 by user: YuGao
> plot(m3)
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 13
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 0
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 1), data = rtn, cond.dist = "std",
trace = F)
Conditional Distribution:
std
Coefficient(s):
mu omega alpha1 beta1 shape
5.9821e-04 4.1699e-06 7.2016e-02 9.2078e-01 5.0886e+00
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 5.982e-04 2.702e-04 2.214 0.02681 *
omega 4.170e-06 1.569e-06 2.658 0.00785 **
alpha1 7.202e-02 1.372e-02 5.248 1.54e-07 ***
beta1 9.208e-01 1.471e-02 62.585 < 2e-16 ***
shape 5.089e+00 4.817e-01 10.565 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Log Likelihood:
7509.96 normalized: 2.645284
> plot(m4)
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 13
1: Time Series
2: Conditional SD
3: Series with 2 Conditional SD Superimposed
4: ACF of Observations
5: ACF of Squared Observations
6: Cross Correlation
7: Residuals
8: Conditional SDs
9: Standardized Residuals
10: ACF of Standardized Residuals
11: ACF of Squared Standardized Residuals
12: Cross Correlation between r^2 and r
13: QQ-Plot of Standardized Residuals
Selection: 0
>