Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ECON 3371 FINANCIAL ECONOMETRICS
INDICATIVE SOLUTIONS: PRACTICAL 3
Part I: Testing for ARCH effects First, we need to prepare our data for analysis in EViews. The data contained in the file
“SPDDailyreturns.xls” are daily log returns from the S&P 500 index. It is good practice to understand the properties
of your data through visualization and inspecting sample summary statistics, so this is what we will be doing.
'Change working directory - adjust this to the directory where your data file is stored
cd J:\teaching\p3
' Import data
import SPDailyreturns.xls range="data" @rename DLs_p500 sp500
sp500.displayname Daily S&P 500 Returns
'Inspect data
sp500.line
-.12
-.08
-.04
.00
.04
.08
.12
250 500 750 1000 1250 1500 1750 2000 2250
Daily S&P 500 Returns
We can see periods of high and low volatility. These “volatility clusters”
are indicative of ARCH effects can be captured by ARCH/GARCH models.
sp500.hist
0
100
200
300
400
500
600
700
800
900
-0.10 -0.05 0.00 0.05 0.10
Series: SP500
Sample 1 2262
Observations 2262
Mean -0.000211
Median 0.000413
Maximum 0.109572
Minimum -0.094695
Std. Dev. 0.013607
Skewness -0.127892
Kurtosis 11.90835
Jarque-Bera 7485.717
Probability 0.000000
The Jarque-Bera statistic indicates that our return series does not follow a normal distribution,
rejecting the null hypothesis of a normal distribution at 1% significance.
Question 1 i) We run the OLS regression as specified and save the estimation results:
' Run OLS regression
equation est_ols.ls sp500 c sp500(-1) sp500(-2)
show est_ols
Dependent Variable: SP500
Method: Least Squares
Sample (adjusted): 3 2262
Included observations: 2260 after adjustments
Variable Coefficient Std. Error t-Statistic Prob.
C -0.000238 0.000283 -0.841010 0.4004
SP500(-1) -0.092581 0.020927 -4.424025 0.0000
SP500(-2) -0.110442 0.020904 -5.283339 0.0000
R-squared 0.019063 Mean dependent var -0.000195
Adjusted R-squared 0.018193 S.D. dependent var 0.013588
S.E. of regression 0.013464 Akaike info criterion -5.776256
Sum squared resid 0.409152 Schwarz criterion -5.768659
Log likelihood 6530.169 Hannan-Quinn criter. -5.773484
F-statistic 21.93011 Durbin-Watson stat 1.990220
Prob(F-statistic) 0.000000
ii) First, we save the residuals of the model, square them and inspect their properties visually
'Create residuals
est_ols.makeresid resid_ols
series resid_ols_sq = resid_ols^2
' Visually inspect residual series
est_ols.resids(s)
-8
-6
-4
-2
0
2
4
6
8
250 500 750 1000 1250 1500 1750 2000 2250
Standardized ResidualsThe residuals appear not like a white noise series – the volatility clusters are still visible.
These clusters are also visible in the squared residual series:
resid_ols_sq.line
.000
.002
.004
.006
.008
.010
.012
250 500 750 1000 1250 1500 1750 2000 2250
RESID_OLS_SQ
Second, we regress the squared residual series on their own lags; q indicates the order of the lags to include in the regression.
' Regress residuals on two lags of itself and show results
equation est_resid.ls resid_ols_sq c resid_ols_sq(-1) resid_ols_sq(-2)
show est_resid
Dependent Variable: RESID_OLS_SQ
Method: Least Squares
Sample (adjusted): 5 2262
Included observations: 2258 after adjustments
Variable Coefficient Std. Error t-Statistic Prob.
C 8.41E-05 1.15E-05 7.293471 0.0000
RESID_OLS_SQ(-1) 0.122616 0.019177 6.393975 0.0000
RESID_OLS_SQ(-2) 0.412616 0.019179 21.51427 0.0000
R-squared 0.206431 Mean dependent var 0.000181
Adjusted R-squared 0.205727 S.D. dependent var 0.000569
S.E. of regression 0.000507 Akaike info criterion -12.33552
Sum squared resid 0.000579 Schwarz criterion -12.32791
Log likelihood 13929.80 Hannan-Quinn criter. -12.33274
F-statistic 293.2965 Durbin-Watson stat 2.061663
Prob(F-statistic) 0.000000
The auxiliary model is a linear model (because it is linear in parameters) but it is a nonlinear equation.
Given that it is linear in model, we can use OLS to estimate it.
iii) We can compute the test statistic and the associated p-value manually:
' Obtain R-squared and number of observation from regression results
scalar r2 = est_resid.@r2
scalar T = est_resid.@regobs
' Compute test statistic and associated p-value
scalar Tr2 = T*r2 ' test statistic (= 466.1213)
scalar Tr2_p = @chisq(Tr2, 2) ' p-value (= 0.0000) In actual practice, we use pre-written
commands to do this for us. In our case, this is EViews test for ARCH effects:
est_ols.hettest(type=ARCH, lags=2)
Heteroskedasticity Test: ARCH
F-statistic 293.2965 Prob. F(2,2255) 0.0000
Obs*R-squared 466.1213 Prob. Chi-Square(2) 0.0000
You can see that it yields the same result as our manual computation. Alternatively,
we could have used the routine est_ols.archtest(2) to get the equivalent result.
iv) The null of no arch effects is rejected at the 1% significance level.
v) Determine the number of lags of the squared residual that should appear in the model.
This could bedone using a likelihood ratio test that would compare an unrestricted version
of the squared residual model with, say, four or five variables, and a restricted version with fewer variables.
Specify the nature of the AR model to be used for the estimation process of the model
for the returns. It may be that more lags are required than was the case in the OLS model
estimated above. In both cases for deriving the variance and mean equations,
a general-to-specific modelling approach for the models can be adopted in which the initial model is
estimated with a large number of variables that are then tested for restrictions.
PART II: Modelling conditional mean and conditional variance
1) We estimate the ARMA(5, 0) model with ARCH(1) variance process:
smpl @all ' not required but useful for contrasting with next step
equation est_ar5arch1.arch(1, 0) sp500 c AR(1 to 5)
show est_ar5arch1
Dependent Variable: SP500
Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Sample (adjusted): 6 2262
Included observations: 2257 after adjustments
Convergence achieved after 36 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(7) + C(8)*RESID(-1)^2
Variable Coefficient Std. Error z-Statistic Prob.
C -0.000141 0.000178 -0.795535 0.4263
AR(1) -0.226978 0.011772 -19.28175 0.0000
AR(2) -0.109372 0.012877 -8.493355 0.0000
AR(3) 0.023995 0.008865 2.706577 0.0068
AR(4) -0.022661 0.008414 -2.693187 0.0071
AR(5) 0.057594 0.010497 5.486941 0.0000
Variance Equation
C 0.000108 2.62E-06 41.19644 0.0000
RESID(-1)^2 0.439309 0.030829 14.24981 0.0000
R-squared -0.004349 Mean dependent var -0.000212
Adjusted R-squared -0.006580 S.D. dependent var 0.013583
S.E. of regression 0.013628 Akaike info criterion -5.936011
Sum squared resid 0.418058 Schwarz criterion -5.915730
Log likelihood 6706.789 Hannan-Quinn criter. -5.928610
Durbin-Watson stat 1.730620
Inverted AR Roots .49 .12+.54i .12-.54i -.48-.40i
-.48+.40i
The mean equation is appears well-specified with significant coefficients on the AR term.
The variance equation is also appears well-specified with values on the coefficients
that meet the restrictions placed on them by the ARCH model.
2) Next, we estimate the ARMA(2, 0) model with ARCH(1) variance process, which
can be viewed as arestricted version of the previous model.
smpl @first+5 @last ' adjust sample period to make models comparable
equation est_ar2arch1.arch(1, 0) sp500 c AR(1 to 2)
smpl @all
show est_ar2arch1
Dependent Variable: SP500
Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Sample: 6 2262
Included observations: 2257
Convergence achieved after 20 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(4) + C(5)*RESID(-1)^2
Variable Coefficient Std. Error z-Statistic Prob.
C -0.000138 0.000163 -0.844887 0.3982
AR(1) -0.241872 0.010140 -23.85300 0.0000
AR(2) -0.110732 0.011905 -9.301113 0.0000
Variance Equation
C 0.000108 2.71E-06 39.91425 0.0000
RESID(-1)^2 0.451482 0.029376 15.36930 0.0000
R-squared -0.002721 Mean dependent var -0.000212
Adjusted R-squared -0.003610 S.D. dependent var 0.013583
S.E. of regression 0.013608 Akaike info criterion -5.933075
Sum squared resid 0.417381 Schwarz criterion -5.920399
Log likelihood 6700.475 Hannan-Quinn criter. -5.928449
Durbin-Watson stat 1.702477
Inverted AR Roots -.12+.31i -.12-.31i
We manually compute the Likelihood Ratio test and contrast it with the EViews routines.
' Compute lrtest and associated p-value
scalar lrtest = -2 * (est_ar2arch1.@logl - est_ar5arch1.@logl) ' test statistic
scalar lrtest_p = @chisq(lrtest, 3) ' p-value
There are two ways of computing the same Likelihood Ratio test, depending on whether you test
adding or dropping terms from the respective model:
' Again, in practice, we would use a pre-programmed routine
est_ar5arch1.testdrop AR(3 to 5)
est_ar2arch1.testadd AR(3 to 5)
All of these computations give us the same answer: there is significant evidence against the
restricted ARMA(2, 0) model. Therefore, our preferred model is the ARMA(5, 0) one:
3) First, we compute our model residuals and visualize the standardized residuals. From the graph,
it is clear that the volatility clusters are still present in the residual series; however, they also appear
less pronounced.
' generate standardized residuals
est_ar5arch1.makeresids(s) resids_ar5arch1
' Autocorrelation test
resids_ar5arch1.correl(12)
There appears to be serial dependence in the residuals, indicative of unmodelled influences (like
omitted variables). The Q-statistic indicates, at all lags, rejection of the null that the residuals
follow a white noise process.
' normality test
resids_ar5arch1.hist
The Jarque-Bera statistic indicates that the null of the residuals following a normal distribution is
rejected at the 1% significance level.
' ARCH test
est_ar5arch1.archtest(5)
The test for ARCH effects rejects the null hypothesis of no ARCH effects in the residual series:
4) First, we estimate the ARMA(5, 0) mean model with the ARCH(3) variance process:
equation est_ar5arch3.arch(3, 0) sp500 c AR(1 to 5)
show est_ar5arch3
The coefficients in both the mean and variance equation appear appropriate in magnitude and
Heteroskedasticity Test: ARCH
F-statistic 38.50401 Prob. F(5,2246) 0.0000
Obs*R-squared 177.7944 Prob. Chi-Square(5) 0.0000
Test Equation:
Dependent Variable: WGT_RESID^2
Method: Least Squares
Sample (adjusted): 11 2262
Included observations: 2252 after adjustments
Variable Coefficient Std. Error t-Statistic Prob.
C 0.574736 0.063846 9.001945 0.0000
WGT_RESID^2(-1) -0.089438 0.020950 -4.269167 0.0000
WGT_RESID^2(-2) 0.143249 0.020917 6.848346 0.0000
WGT_RESID^2(-3) 0.140747 0.020923 6.726793 0.0000
WGT_RESID^2(-4) 0.113029 0.020916 5.403938 0.0000
WGT_RESID^2(-5) 0.119448 0.020969 5.696555 0.0000
R-squared 0.078950 Mean dependent var 1.001150
Adjusted R-squared 0.076899 S.D. dependent var 2.467253
S.E. of regression 2.370491 Akaike info criterion 4.566732
Sum squared resid 12620.79 Schwarz criterion 4.581971
Log likelihood -5136.140 Hannan-Quinn criter. 4.572294
F-statistic 38.50401 Durbin-Watson stat 2.017424
Prob(F-statistic) 0.000000
Dependent Variable: SP500
Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Sample (adjusted): 6 2262
Included observations: 2257 after adjustments
Convergence achieved after 52 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(7) + C(8)*RESID(-1)^2 + C(9)*RESID(-2)^2 + C(10)*RESID(
-3)^2
Variable Coefficient Std. Error z-Statistic Prob.
C 0.000188 0.000158 1.190416 0.2339
AR(1) -0.084313 0.020163 -4.181618 0.0000
AR(2) -0.086865 0.018701 -4.644999 0.0000
AR(3) -0.028070 0.015027 -1.868011 0.0618
AR(4) 0.035926 0.014127 2.543090 0.0110
AR(5) -0.075986 0.014675 -5.178003 0.0000
Variance Equation
C 5.48E-05 2.67E-06 20.56119 0.0000
RESID(-1)^2 0.117557 0.017352 6.774857 0.0000
RESID(-2)^2 0.349902 0.027200 12.86393 0.0000
RESID(-3)^2 0.239821 0.027562 8.701097 0.0000
R-squared 0.008994 Mean dependent var -0.000212
Adjusted R-squared 0.006793 S.D. dependent var 0.013583
S.E. of regression 0.013537 Akaike info criterion -6.135706
Sum squared resid 0.412504 Schwarz criterion -6.110355
Log likelihood 6934.144 Hannan-Quinn criter. -6.126454
Durbin-Watson stat 2.023685
Inverted AR Roots .43-.34i .43+.34i -.15+.61i -.15-.61i
-.63
highly significant. Next, we generate the standardized residuals and visually inspect them
generate standardized residuals
est_ar5arch3.makeresids(s) resids_ar5arch3
' Visually inspect residuals
est_ar5arch3.resids(s)
' autocorrelation and omitted variables
resids_ar5arch3.correl(12)
' normality test
resids_ar5arch3.hist
' ARCH test
est_ar5arch3.archtest(5)