Appendix: Some RATS Programs for Estimating Volatility Models

The data file used in the illustration is sp500.txt, which contains the monthly excess returns of the S&P 500 index with 792 observations. Comments in a RATS program start with *.

A Gaussian GARCH(1,1) Model with a Constant Mean Equation

all 0  792:1

open data sp500.txt

data(org=obs) / rt

*** initialize the conditional variance function

set h = 0.0

*** specify the parameters of the model

nonlin mu a0 a1 b1

*** specify the mean equation

frml at = rt(t)-mu

*** specify the volatility equation

frml gvar = a0+a1*at(t-1)**2+b1*h(t-1)

*** specify the log likelihood function

frml garchln = -0.5*log(h(t)=gvar(t))-0.5*at(t)**2/h(t)

*** sample period used in estimation

smpl 2 792

*** initial estimates

compute a0 = 0.01, a1 = 0.1, b1 = 0.5, mu = 0.1

maximize(method=bhhh,recursive,iterations=150) garchln

set fv = gvar(t)

set resid = at(t)/sqrt(fv(t))

set residsq = resid(t)*resid(t)

*** Checking standardized residuals

cor(qstats,number=20,span=10) resid

*** Checking squared standardized residuals

cor(qstats,number=20,span=10) residsq

A GARCH(1,1) Model with Student-t Innovation

all 0  792:1

open data sp500.txt

data(org=obs) / rt

set h = 0.0

nonlin mu a0 a1 b1 v

frml at = rt(t)-mu

frml gvar = a0+a1*at(t-1)**2+b1*h(t-1)

frml tt = at(t)**2/(h(t)=gvar(t))  

frml tln = %LNGAMMA((v+1)/2.)-%LNGAMMA(v/2.)-0.5*log(v-2.)

frml gln = tln-((v+1)/2.)*log(1.0+tt(t)/(v-2.0))-0.5*log(h(t))

smpl  2 792

compute a0 = 0.01, a1 = 0.1, b1 = 0.5, mu = 0.1, v = 10

maximize(method=bhhh,recursive,iterations=150) gln

set fv = gvar(t)                                

set resid = at(t)/sqrt(fv(t))

set residsq = resid(t)*resid(t)

cor(qstats,number=20,span=10) resid

cor(qstats,number=20,span=10) residsq

An AR(1)−EGARCH(1,1) Model for Monthly Log Returns of IBM Stock

all 0  864:1

open data m-ibm.txt

data(org=obs) / rt

set h = 0.0

nonlin c0 p1 th ga a0 a1                                                

frml at = rt(t)-c0-p1*rt(t-1)

frml epsi = at(t)/(sqrt(exp(h(t))))                                  

frml g = th*epsi(t)+ga*(abs(epsi(t))-sqrt(2./% PI))                   

frml gvar = a1*h(t-1)+(1-a1)*a0+g(t-1)

frml garchln = -0.5*(h(t)=gvar(t))-0.5*epsi(t)**2

smpl 3  864

compute c0 = 0.01, p1 = 0.01, th = 0.1, ga = 0.1

compute a0 = 0.01, a1 = 0.5

maximize(method=bhhh,recursive,iterations=150) garchln

set fv = gvar(t)                                                     

set resid = epsi(t)

set residsq = resid(t)*resid(t)

cor(qstats,number=20,span=10) resid

cor(qstats,number=20,span=10) residsq

Exercises

3.1 Derive multistep-ahead forecasts for a GARCH(1,2) model at the forecast origin h.

3.2 Derive multistep-ahead forecasts for a GARCH(2,1) model at the forecast origin h.

3.3 Suppose that r1, … , rn are observations of a return series that follows the AR(1)-GARCH(1,1) model

Inline

where ϵt is a standard Gaussian white noise series. Derive the conditional log-likelihood function of the data.

3.4 In the equation in Exercise 3.1, assume that ϵt follows a standardized Student-t distribution with v degrees of freedom. Derive the conditional log-likelihood function of the data.

3.5 Consider the monthly simple returns of Intel stock from January 1973 to December 2008 in m-intc7308.txt. Transform the returns into log returns. Build a GARCH model for the transformed series and compute 1-step- to 5-step-ahead volatility forecasts at the forecast origin December 2008.

3.6 The file m-mrk4608.txt contains monthly simple returns of Merck stock from June 1946 to December 2008. The file has two columns denoting date and simple return. Transform the simple returns to log returns.

a. Is there any evidence of serial correlations in the log returns? Use autocorrelations and 5% significance level to answer the question. If yes, remove the serial correlations.

b. Is there any evidence of ARCH effects in the log returns? Use the residual series if there are serial correlations in part (a). Use Ljung–Box statistics for the squared returns (or residuals) with 6 and 12 lags of autocorrelations and 5% significance level to answer the question.

c. Identify an ARCH model for the data and fit the identified model. Write down the fitted model.

3.7 The file m-3m4608.txt contains two columns. They are date and the monthly simple return for 3M stock. Transform the returns to log returns.

a. Is there any evidence of ARCH effects in the log returns? Use Ljung–Box statistics with 6 and 12 lags of autocorrelations and 5% significance level to answer the question.

b. Use the PACF of the squared returns to identify an ARCH model. What is the fitted model?

c. There are 755 data points. Refit the model using the first 750 observations and use the fitted model to predict the volatilities for t from 751 to 755 (the forecast origin is 750).

d. Build an ARCH-M model for the log return series of 3M stock. Test the hypothesis that the risk premium is zero at the 5% significance level. Draw your conclusion.

e. Build an EGARCH model for the log return series of 3M stock using the first 750 observations. Use the fitted model to compute 1-step- to 5-step-ahead volatility forecasts at the forecast origin h = 750.

3.8 The file m-gmsp5008.txt contains the dates and monthly simple returns of General Motors stock and the S&P 500 index from 1950 to 2008.

a. Build a GARCH model with Gaussian innovations for the log returns of GM stock. Check the model and write down the fitted model.

b. Build a GARCH-M model with Gaussian innovations for the log returns of GM stock. What is the fitted model?

c. Build a GARCH model with Student-t distribution for the log returns of GM stock, including estimation of the degrees of freedom. Write down the fitted model. Let v be the degrees of freedom of the Student-t distribution. Test the hypothesis H0:v = 6 versus Ha:v ≠ 6, using the 5% significance level.

d. Build an EGARCH model for the log returns of GM stock. What is the fitted model?

e. Obtain 1-step- to 6-step-ahead volatility forecasts for all the models obtained. Compare the forecasts.

3.9 Consider the monthly log returns of GM stock in m-gmsp5008.txt. Build an adequate TGARCH model for the series. Write down the fitted model and test for the significance of the leverage effect. Obtain 1-step- to 6-steps-ahead volatility forecasts.

3.10 Again, consider the returns in m-gmsp5008.txt.

a. Build a Gaussian GARCH model for the monthly log returns of the S&P 500 index. Check the model carefully.

b. Is there a summer effect on the volatility of the index return? Use the GARCH model built in part (a) to answer this question.

c. Are lagged returns of GM stock useful in modeling the index volatility? Again, use the GARCH model of part (a) as a baseline model for comparison.

3.11 The file d-gmsp9908.txt contains the daily simple returns of GM stock and the S&P composite index from 1999 to 2008. It has three columns denoting date, GM return, and S&P return.

a. Compute the daily log returns of GM stock. Is there any evidence of ARCH effects in the log returns? You may use 10 lags of the squared returns and 5% significance level to perform the test.

b. Compute the PACF of the squared log returns (10 lags).

c. Specify a GARCH model for the GM log return using a normal distribution for the innovations. Perform model checking and write down the fitted model.

d. Find an adequate GARCH model for the series but using the generalized error distribution for the innovations. Write down the fitted model.

3.12 Consider the daily simple returns of the S&P composite index in the file d-gmsp9908.txt.

a. Is there any ARCH effect in the simple return series? Use 10 lags of the squared returns and 5% significance level to perform the test.

b. Build an adequate GARCH model for the simple return series.

c. Compute 1-step- to 4-step-ahead forecasts of the simple return and its volatility based on the fitted model.

3.13 Again, consider the daily simple returns of GM stock in the file d-gmsp9908.txt.

a. Find an adequate GARCH-M model for the series. Write down the fitted model.

b. Find an adequate EGARCH model for the series. Is the “leverage” effect significant at the 5% level?

3.14 Revisit the file d-gmsp9908.txt. However, we shall investigate the value of using market volatility in modeling volatility of individual stocks. Convert the two simple return series into percentage log return series.

a. Build an AR(5)–GARCH(1,1) model with generalized error distribution for the log S&P returns. The AR(5) contains only lags 3 and 5. Denote the fitted volatility series by spvol.

b. Estimate a GARCH(1,1) model with spvol as an exogenous variable to the log GM return series. Check the adequacy of the model, and write down the fitted model. In S-Plus, the command is

fit = garch(gm ∼ 1, ∼garch(1,1)+spvol, cond.dist=‘ged’)

c. Discuss the implication of the fitted model.

3.15 Again, consider the percentage daily log returns of GM stock and the S&P 500 index from 1999 to 2008 as before, but we shall investigate whether the volatility of GM stock has any contribution in modeling the S&P index volatility. Follow the steps below to perform the analysis.

a. Fit a GARCH(1,1) model with generalized error distribution to the percentage log returns of GM stock. Denote the fitted volatility by gmvol. Build an adequate GARCH model plus gmvol as the exogenous variable for the log S&P return series. Write down the fitted model.

b. Is the volatility of GM stock returns helpful in modeling the volatility of the S&P index returns? Why?

References

Alizadeh, S., Brandt, M., and Diebold, F. X. (2002). Range-based estimation of stochastic volatility models. Journal of Finance 57: 1047–1092.

Andersen, T. G. and Bollerslev, T. (1998). Answering the skeptics: Yes, standard volatility models do provide accurate forecasts. International Economic Review 39: 885–905.

Andersen, T. G., Bollerslev, T., Diebold, F. X., and Labys, P. (2001a). The distribution of realized exchange rate volatility. Journal of the American Statistical Association 96: 42–55.

Andersen, T. G., Bollerslev, T., Diebold, F. X., and Labys, P. (2001b). The distribution of realized stock return volatility. Journal of Financial Economics 61: 43–76.

Bai, X., Russell, J. R., and Tiao, G. C. (2003). Kurtosis of GARCH and stochastic volatility models with non-normal innovations. Journal of Econometrics 114: 349–360.

Bai, X., Russell, J. R., and Tiao, G. C. (2004). Effects of non-normality and dependence on the precision of variance estimates using high-frequency financial data. Revised working paper, Graduate School of Business, University of Chicago.

Barndorff-Nielsen, O. E. and Shephard, N. (2004). Power and bi-power variations with stochastic volatility and jumps (with discussion). Journal of Financial Econometrics 2: 1–48.

Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics 31: 307–327.

Bollerslev, T. and Jubinski, D. (1999). Equality trading volume and volatility: Latent information arrivals and common long-run dependencies. Journal of Business & Economic Statistics 17: 9–21.

Bollerslev, T., Chou, R. Y., and Kroner, K. F. (1992). ARCH modeling in finance. Journal of Econometrics 52: 5–59.

Bollerslev, T., Engle, R. F., and Nelson, D. B. (1994). ARCH model. In R. F. Engle and D. C. McFadden (eds.). Handbook of Econometrics IV, pp. 2959–3038. Elsevier Science, Amsterdam.

Breidt, F. J., Crato, N., and de Lima, P. (1998). On the detection and estimation of long memory in stochastic volatility. Journal of Econometrics 83: 325–348.

Cao, C. and Tsay, R. S. (1992). Nonlinear time series analysis of stock volatilities. Journal of Applied Econometrics 7: s165–s185.

Ding, Z., Granger, C. W. J., and Engle, R. F. (1993). A long memory property of stock returns and a new model. Journal of Empirical Finance 1: 83–106.

Engle, R. F. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflations. Econometrica 50: 987–1007.

Fernández, C. and Steel, M. F. J. (1998). On Bayesian modelling of fat tails and skewness. Journal of the American Statistical Association 93: 359–371. Journal of Financial Economics 19:3–29.

Garman, M. B. and Klass, M. J. (1980). On the estimation of security price volatilities from historical data. Journal of Business 53: 67–78.

Glosten, L. R., Jagannathan, R., and Runkle, D. E. (1993). On the relation between the expected value and the volatility of nominal excess return on stocks. Journal of Finance 48: 1779–1801.

Harvey, A. C., Ruiz, E., and Shephard, N. (1994). Multivariate stochastic variance models. Review of Economic Studies 61: 247–264.

Jacquier, E., Polson, N. G., and Rossi, P. (1994). Bayesian analysis of stochastic volatility models (with discussion). Journal of Business & Economic Statistics 12: 371–417.

Lambert, P. and Laurent, S. (2001). Modelling financial time series using GARCH-type models and a skewed Student density. Working paper, Université de Liège.

McLeod, A. I. and Li, W. K. (1983). Diagnostic checking ARMA time series models using squared-residual autocorrelations. Journal of Time Series Analysis 4: 269–273.

Melino, A. and Turnbull, S. M. (1990). Pricing foreign currency options with stochastic volatility. Journal of Econometrics 45: 239–265.

Nelson, D. B. (1990). Stationarity and persistence in the GARCH(1,1) model. Econometric Theory 6: 318–334.

Nelson, D. B. (1991). Conditional heteroskedasticity in asset returns: A new approach. Econometrica 59: 347–370.

Nicholls, D. F. and Quinn, B. G. (1982). Random Coefficient Autoregressive Models: An Introduction, Lecture Notes in Statistics, 11. Springer, New York.

Parkinson, M. (1980). The extreme value method for estimating the variance of the rate of return. Journal of Business 53: 61–65.

Ray, B. K. and Tsay, R. S. (2000). Long-range dependence in daily stock volatilities. Journal of Business & Economic Statistics 18: 254–262.

Rogers, L. C. G. and Satchell, S. E. (1991). Estimating variance from high, low and closing prices. Annals of Applied Probability 1: 504–512.

Taylor, S. J. (1994). Modeling stochastic volatility: A review and comparative study. Mathematical Finance 4: 183–204.

Tong, H. (1978). On a threshold model. In C. H. Chen (Ed.). Pattern Recognition and Signal Processing. Sijhoff & Noordhoff, Amsterdam.

Tong, H. (1990). Non-Linear Time Series: A Dynamical System Approach. Oxford University Press, Oxford, UK.

Tsay, R. S. (1987). Conditional heteroscedastic time series models. Journal of the American Statistical Association, 82: 590–604.

Yang, D. and Zhang, Q. (2000). Drift-independent volatility estimation based on high, low, open, and close prices. Journal of Business 73: 477–491.

Zakoian, J. M. (1994). Threshold heteroscedastic models. Journal of Economic Dynamics and Control 18: 931–955.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.103.5