《第7章、ARCH模型和GARCH模型.doc》由会员分享,可在线阅读,更多相关《第7章、ARCH模型和GARCH模型.doc(52页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、第7章、ARCH模型和GARCH模型研究内容:研究随时间而变化的风险。(回忆:Markowitz均值方差投资组合选择模型怎样度量资产的风险)本章模型与以前所学的异方差的不同之处:随机扰动项的无条件方差虽然是常数,但是条件方差是按规律变动的量。波动率的聚类性(volatility clustering):一段时间内,随机扰动项的波动的幅度较大,而另外一定时间内,波动的幅度较小。如图,1、ARCH模型1、条件方差多元线性回归模型:条件方差或者波动率(Condition variance,volatility)定义为其中是信息集。2、ARCH模型的定义Engle(1982)提出ARCH模型(auto
2、regressive conditional heteroskedasticity,自回归条件异方差)。ARCH(q)模型: (1)的无条件方差是常数,但是其条件分布为 (2)其中是信息集。方程(1)是均值方程(mean equation) :条件方差,含义是基于过去信息的一期预测方差方程(2)是条件方差方程(conditional variance equation),由二项组成 常数 ARCH项:滞后的残差平方习题: 方程(2)给出了的条件方差,请计算的无条件方差。证明:利用方差分解公式:Var(X) = VarYE(X|Y) + EYVar(X|Y)由于,所以条件均值为0,条件方差为。那
3、么,推出,说明3、ARCH模型的平稳性条件在ARCH(1)模型中,观察参数的含义:当时,当时,退化为传统情形,ARCH模型的平稳性条件:(这样才得到有限的方差)4、ARCH效应检验ARCH LM Test:拉格朗日乘数检验建立辅助回归方程此处是回归残差。原假设:H0:序列不存在ARCH效应即H0:可以证明:若H0为真,则此处,m为辅助回归方程的样本个数。R2为辅助回归方程的确定系数。Eviews操作:先实施多元线性回归view/residual/Tests/ARCH LM Test2、GARCH模型的实证分析从收盘价,得到收益率数据序列。series r=log(p)-log(p(-1)点击序
4、列p,然后view/line graph1、检验是否有ARCH现象。首先回归。取2000到2254的样本。输入ls r c,得到Dependent Variable: RMethod: Least SquaresDate: 10/21/04 Time: 21:26Sample: 2000 2254Included observations: 255VariableCoefficientStd. Errort-StatisticProb. C0.0004320.0010870.3971300.6916R-squared0.000000 Mean dependent var0.000432Adju
5、sted R-squared0.000000 S.D. dependent var0.017364S.E. of regression0.017364 Akaike info criterion-5.264978Sum squared resid0.076579 Schwarz criterion-5.251091Log likelihood672.2847 Durbin-Watson stat2.049819问题:这样进行回归的含义是什么?其次,view/residual tests/ARCH LM test,得到ARCH Test:F-statistic5.220573 Probabili
6、ty0.000001Obs*R-squared44.68954 Probability0.000002Test Equation:Dependent Variable: RESID2Method: Least SquaresDate: 10/21/04 Time: 21:27Sample(adjusted): 2010 2254Included observations: 245 after adjusting endpointsVariableCoefficientStd. Errort-StatisticProb. C0.0001105.34E-052.0601380.0405RESID2
7、(-1)0.1415490.0652372.1697760.0310RESID2(-2)0.0550130.0658230.8357660.4041RESID2(-3)0.3377880.0655685.1516970.0000RESID2(-4)0.0261430.0691800.3778930.7059RESID2(-5)-0.0411040.069052-0.5952600.5522RESID2(-6)-0.0693880.069053-1.0048540.3160RESID2(-7)0.0056170.0691780.0811930.9354RESID2(-8)0.1022380.06
8、55451.5598060.1202RESID2(-9)0.0112240.0657850.1706190.8647RESID2(-10)0.0644150.0651570.9886130.3239R-squared0.182406 Mean dependent var0.000305Adjusted R-squared0.147466 S.D. dependent var0.000679S.E. of regression0.000627 Akaike info criterion-11.86836Sum squared resid9.19E-05 Schwarz criterion-11.
9、71116Log likelihood1464.875 F-statistic5.220573Durbin-Watson stat2.004802 Prob(F-statistic)0.000001得到什么结论?2、模型定阶:如何确定q实施ARCH LM test时,取较大的q,观察滞后残差平方的t统计量的pvalue即可。此处选取q3。因此,可以对残差建立ARCH(3)模型。3、ARCH模型的参数估计参数估计采用最大似然估计。具体方法在GARCH一节中讲解。如何实施ARCH过程:由于存在ARCH效应,所以点击estimate,在method中选取ARCH得到如下结果Dependent Var
10、iable: RMethod: ML - ARCHDate: 10/21/04 Time: 21:48Sample: 2000 2254Included observations: 255Convergence achieved after 13 iterationsCoefficientStd. Errorz-StatisticProb. C-0.0006400.000750-0.8528880.3937 Variance EquationC9.24E-051.66E-055.5693370.0000ARCH(1)0.2447930.0826402.9621420.0031ARCH(2)0.
11、0814250.0774281.0516240.2930ARCH(3)0.4578830.1096984.1740430.0000R-squared-0.003823 Mean dependent var0.000432Adjusted R-squared-0.019884 S.D. dependent var0.017364S.E. of regression0.017535 Akaike info criterion-5.495982Sum squared resid0.076872 Schwarz criterion-5.426545Log likelihood705.7377 Durb
12、in-Watson stat2.042013为了比较,观察将q放大对系数估计的影响Dependent Variable: RMethod: ML - ARCHDate: 10/21/04 Time: 21:54Sample: 2000 2254Included observations: 255Convergence achieved after 16 iterationsCoefficientStd. Errorz-StatisticProb. C-0.0006010.000751-0.7999090.4238 Variance EquationC9.38E-051.60E-055.8807
13、410.0000ARCH(1)0.2620090.0902562.9029590.0037ARCH(2)0.0419300.0705180.5945960.5521ARCH(3)0.4521870.1084884.1680760.0000ARCH(4)-0.0219200.050982-0.4299560.6672ARCH(5)0.0376200.0443940.8474080.3968R-squared-0.003550 Mean dependent var0.000432Adjusted R-squared-0.027830 S.D. dependent var0.017364S.E. o
14、f regression0.017603 Akaike info criterion-5.483292Sum squared resid0.076851 Schwarz criterion-5.386081Log likelihood706.1198 Durbin-Watson stat2.042568观察:说明q选取为3确实比较恰当。4、ARCH模型是对的吗?如果ARCH模型选取正确,即回归残差的条件方差是按规律变化的,那么标准化残差就会服从标准正态分布,即不会有ARCH效应了。为什么?请思考。对q为3的ARCH模型做LM test,发现没有了ARCH效应。注意,虽然是同一个检验名称,但是A
15、RCH过程后是对标准化残差进行检验。注意观察被解释变量或者依赖变量是什么?ARCH Test:F-statistic0.238360 Probability0.992099Obs*R-squared2.470480 Probability0.991299Test Equation:Dependent Variable: STD_RESID2Method: Least SquaresDate: 10/21/04 Time: 21:56Sample(adjusted): 2010 2254Included observations: 245 after adjusting endpointsVar
16、iableCoefficientStd. Errort-StatisticProb. C1.1023710.2649904.1600430.0000STD_RESID2(-1)-0.0385450.065360-0.5897410.5559STD_RESID2(-2)-0.0038040.065308-0.0582520.9536STD_RESID2(-3)-0.0573130.065303-0.8776490.3810STD_RESID2(-4)-0.0103250.065277-0.1581690.8745STD_RESID2(-5)0.0035370.0652800.0541850.95
17、68STD_RESID2(-6)-0.0074200.065274-0.1136700.9096STD_RESID2(-7)0.0633170.0652640.9701650.3330STD_RESID2(-8)-0.0121670.065293-0.1863400.8523STD_RESID2(-9)-0.0106530.065278-0.1631940.8705STD_RESID2(-10)-0.0202110.065228-0.3098450.7570R-squared0.010084 Mean dependent var1.007544Adjusted R-squared-0.0322
18、21 S.D. dependent var2.112747S.E. of regression2.146514 Akaike info criterion4.409426Sum squared resid1078.160 Schwarz criterion4.566625Log likelihood-529.1546 F-statistic0.238360Durbin-Watson stat2.000071 Prob(F-statistic)0.992099方程整体是不显著的。还可以观察标准化残差ARCH建模以后,procs/make residual series/可以产生残差和标准化残差,
19、以分别下是残差和标准化残差。可以看出没有了集群现象。还可以观察波动率(条件方差)的图形。对比r和残差的图形,发现条件方差的起伏与波动率的大小一致。ARCH建模以后,procs/make garch variance series/ 得到结论:ARCH模型确实很好描述了股票市场收益率的波动性。可以观察系数之和小于1,满足平稳性条件。3、GARCH模型当q较大时,采用Bollerslov(1986)提出的GARCH模型(Generalized ARCH)1、模型定义条件方差方程 均值 :过去的条件方差(也即预测方差,forecast variance)注意:均值方程中若没有解释变量(即只有常数,如
20、R C),则R2没有直观定义了,因此可为负)2、GARCH(p, q) 模型的稳定性条件计算扰动项的无条件方差:GARCH是协方差稳定的,因此是经典回归。3、GARCH模型的参数估计采用极大似然估计GARCH模型的参数。下面以GARCH(1, 1)为例。由GARCH(1, 1)模型可以得到yt的分布为由正态分布的定义公式,得到yt的pdf为第t个观察样本的对数似然函数值为其中注意yi和yj之间不相关,因而是独立的。似然函数为取对数就得到了所有样本的对数似然函数。其中条件方差项以非线性方式进入似然函数,所以不得不使用迭代算法求解。4、模型的选择两条原则:1) 若ARCH(q)中q太大,比如q大于
21、7时,则选择GARCH(p, q)2) 使用AIC和SC准则,选择最优的GARCH模型3) 对于金融时间序列,一般选择GARCH(1, 1)就够了。回顾AIC和SC定义:1)AIC准则(Akaike information criterion)AIC越小越好,结合如下两者:K(自变量个数)减少,模型简洁LnL增加,模型精确2)SC准则(Schwaz criterion)习题1:通货膨胀率有ARCH效应吗?Greene P572点击数据文件usinf_greene_p572。进行回归ls inflation c inflation(-1)Dependent Variable: INFLATION
22、Method: Least SquaresDate: 11/19/04 Time: 10:37Sample(adjusted): 1941 1985Included observations: 45 after adjusting endpointsVariableCoefficientStd. Errort-StatisticProb. C2.4328590.8163452.9801840.0047INFLATION(-1)0.4932130.1311573.7604660.0005R-squared0.247477 Mean dependent var4.740000Adjusted R-
23、squared0.229976 S.D. dependent var4.116784S.E. of regression3.612519 Akaike info criterion5.450114Sum squared resid561.1625 Schwarz criterion5.530410Log likelihood-120.6276 F-statistic14.14110Durbin-Watson stat1.612442 Prob(F-statistic)0.000507检验ARCH效应ARCH Test:F-statistic0.215950 Probability0.95330
24、8Obs*R-squared1.231192 Probability0.941850Test Equation:Dependent Variable: RESID2Method: Least SquaresDate: 11/19/04 Time: 10:46Sample(adjusted): 1946 1985Included observations: 40 after adjusting endpointsVariableCoefficientStd. Errort-StatisticProb. C9.2705227.4255671.2484600.2204RESID2(-1)-0.031
25、1620.170116-0.1831840.8557RESID2(-2)-0.0068860.170151-0.0404690.9680RESID2(-3)0.1162610.1695050.6858880.4974RESID2(-4)0.0185450.1706200.1086940.9141RESID2(-5)0.1279060.1686430.7584390.4534R-squared0.030780 Mean dependent var12.28323Adjusted R-squared-0.111753 S.D. dependent var34.15088S.E. of regres
26、sion36.00858 Akaike info criterion10.14287Sum squared resid44085.00 Schwarz criterion10.39620Log likelihood-196.8574 F-statistic0.215950Durbin-Watson stat1.034796 Prob(F-statistic)0.953308习题2:通货膨胀率有ARCH效应吗?Lin的数据集 点击usinf文件series dp=100*D(log(p)ls dp c dp(-1) dp(-2) dp(-3)Dependent Variable: DPMetho
27、d: Least SquaresDate: 11/19/04 Time: 10:10Sample(adjusted): 1951:1 1983:4Included observations: 132 after adjusting endpointsVariableCoefficientStd. Errort-StatisticProb. C0.1099070.0634051.7334100.0854DP(-1)0.3935830.0844324.6615360.0000DP(-2)0.2030930.0894522.2704050.0249DP(-3)0.3020730.0841853.58
28、82140.0005R-squared0.696825 Mean dependent var1.021373Adjusted R-squared0.689719 S.D. dependent var0.711412S.E. of regression0.396277 Akaike info criterion1.016428Sum squared resid20.10054 Schwarz criterion1.103785Log likelihood-63.08423 F-statistic98.06599Durbin-Watson stat1.970959 Prob(F-statistic
29、)0.000000ARCH Test:F-statistic0.969524 Probability0.439318Obs*R-squared4.892009 Probability0.429201Test Equation:Dependent Variable: RESID2Method: Least SquaresDate: 11/19/04 Time: 10:13Sample(adjusted): 1952:2 1983:4Included observations: 127 after adjusting endpointsVariableCoefficientStd. Errort-
30、StatisticProb. C0.1081900.0353023.0646480.0027RESID2(-1)-0.0808320.090353-0.8946190.3728RESID2(-2)0.1079060.0884931.2193650.2251RESID2(-3)0.0811910.0888310.9139960.3625RESID2(-4)0.1107450.0884331.2522990.2129RESID2(-5)0.0312480.0887380.3521340.7254R-squared0.038520 Mean dependent var0.147634Adjusted
31、 R-squared-0.001211 S.D. dependent var0.236307S.E. of regression0.236450 Akaike info criterion-7.13E-05Sum squared resid6.764921 Schwarz criterion0.134300Log likelihood6.004525 F-statistic0.969524Durbin-Watson stat1.990016 Prob(F-statistic)0.439318Dependent Variable: DPMethod: ML - ARCHDate: 11/19/0
32、4 Time: 10:16Sample(adjusted): 1951:1 1983:4Included observations: 132 after adjusting endpointsConvergence achieved after 25 iterationsCoefficientStd. Errorz-StatisticProb. C0.1113020.0645121.7252820.0845DP(-1)0.3783170.0961983.9326910.0001DP(-2)0.1883850.0862412.1844010.0289DP(-3)0.3237310.0983453
33、.2917880.0010 Variance EquationC0.2924650.0491875.9459390.0000ARCH(1)-0.0297610.047805-0.6225630.5336GARCH(1)-0.8733240.267371-3.2663330.0011R-squared0.696453 Mean dependent var1.021373Adjusted R-squared0.681883 S.D. dependent var0.711412S.E. of regression0.401250 Akaike info criterion1.051145Sum sq
34、uared resid20.12519 Schwarz criterion1.204021Log likelihood-62.37558 F-statistic47.79960Durbin-Watson stat1.938286 Prob(F-statistic)0.000000附录:Matlab的GARCH工具箱ARMAX(R,M,Nx)/GARCH(P,Q)模型: / 1.=资产的收益率序列 =冲击过程 =的条件方差:2. GARCH(0,Q)ARCH(Q)3.is the forecast of the next periods variance, given the past sequ
35、ence of variance forecastsand past realizations of the variance itself. The Default Model: / 对金融收益率时序,(1)带漂移的随机游走足够了(2)GARCH(1,1),GARCH(2,1), GARCH(1,2)足够了结构接口Spec = garchset(Parameter1, Value1, Parameter2, Value2, .) 创建Spec = garchset(OldSpec, Parameter1, Value1, .) 修正OldSpec例:spec=garchset; spec=g
36、archset(spec, C, 0, AR, 0.6 0.2, MA, 0.4);GARCH建模1. 收益率时序的ARMAX/GARCH参数估计Coeff,Errors,LLF,Innovations,Sigma,Summary=garchfit(Spec, Series)/(Spec, Series, X) Series-收益率序列y, 最后为最新数据 Spec-结构描述, garchsetX-多种资产的收益率回归矩阵,每列为一回归解释变量,最后一行为最新数据Coeff-估计系数, Errors-系数的标准差, LLF-log-likelihood函数值,Innovations-, Sig
37、ma-2. SigmaForecast,MeanForecast,SigmaTotal,MeanRMSE=garchpred(Spec,Series,NumPeriods)NumPeriods-预测步数. *SigmaForecast-的预测值. *MeanForecast-的预测值.SigmaTotal-对为 MeanRMSE-预测的标准误差.3. GARCH过程模拟 Innovations,Sigma,Series=garchsim(Spec)/(Spec,NS,NP,Seed,X)NS-样本个数default 100. NP-样本路径的个数default 1. Seed-随机数种子def
38、ault 0 Innovations-NS*NP冲击矩阵. Sigma- Series-NS*NP收益率矩阵, 每列为单独的实现y.例co,er,L,in,si=garchfit(xyz); e,s,y=garchsim(co,800); garchplot(e,s,y)GARCH冲击推断从推断与:Innovations,Sigma,LogLikelihood=garchinfer(Spec,Series)/(Spec,Series,X)例eInferred, sInferred = garchinfer(coeff, y); Statistics and Tests1. Akaike Bay
39、esian信息准则AIC,BIC=aicbic(LogLikelihood,NumParams,NumObs)NumParams-参数个数 NumObs-收益率时序长度AIC=-2*LogLikelihood+2*NumParams BIC=-2*LogLikelihood+NumParams*Log(NumObs)例n21=garchcount(coeff21); n11=garchcount(coeff11)=4; %参数个数AIC,BIC=aicbic(LLF21,n21,2000);AIC,BIC=aicbic(LLF11,n11,2000);%AIC, BIC没有显著增加, 说明GA
40、RCH(1,1)足够了6. Likelihood ratio hypothesis test.H, pValue, Ratio, CriticalValue=lratiotest(BaseLLF, NullLLF, DoF, Alpha)例spec11=garchset(P,1,Q,1);co11,er11,LLF11,in11,si11,su11=garchfit(spec11,xyz);spec21=garchset(P,2,Q,1);co21,er21,LLF21,in21,si21,su21=garchfit(spec21,xyz);%LLF21越大越好H,p,St,CV=lratio
41、test(LLF21,LLF11, 1, 0.05); %H=0说明GARCH(1,1)足够了*此不对,要对spec11给初值。2. H, pValue, ARCHstat, CriticalValue = archtest(Residuals)/(Residuals, Lags, Alpha)H0: 样本余差时序为i.i.d.正态冲击(i.e.无ARCH/GARCH效应).Residuals比如来自回归的余差 Lags-default is 1即ARCH(1). H=0 接受H0 如residuals=randn(100,1);H,P,Stat,CV=archtest(residuals,1 2 4,0.10)Create synthetic residuals, 检验1 2 4阶ARCH效应. %注意GARCH(P,Q)基本相当于ARCH(P+Q)7. 偏自相关PartialACF, Lags, Bounds=parcorr(Series)/(Series , nLags , R , nSTDs)Series最后一数据为最新 nLags偏ACF的个数,默认为mini
限制150内