ARCH模型和GARCH模型

金融计量 专栏收录该内容
9 篇文章 1 订阅

基于ARCH(1)模型模拟生成收益序列,残差序列和波动率序列

library(fGarch)
set.seed(1234)
#模型的设定
spec_1<-garchSpec(model=list(omega=.01,alpha=.85,beta=0))
#模型的模拟
simdata_1<-garchSim(spec_1,n=200,extended=T)
plot(simdata_1)

par(mfrow=c(1,3))
acf(simdata_1$eps,main="resid series",xlab="lags")
acf(simdata_1$garch,main="simulations data",xlab="lags")
acf(simdata_1$garch^2,main="squared sim data",xlab="lags")

ARCH模型和GARCH模型

library(FinTS)

ArchTest(simdata_1$garch,lags=12)

        ARCH LM-test; Null hypothesis: no ARCH effects

data:  simdata_1$garch
Chi-squared = 93.981, df = 12, p-value = 8.327e-15

ArchTest(simdata_1$eps,lags=12)

        ARCH LM-test; Null hypothesis: no ARCH effects

data:  simdata_1$eps
Chi-squared = 10.863, df = 12, p-value = 0.5407


GARCH(1,1)模型的模拟


spec_2<-garchSpec(model=list(omega=.01,alpha=.85,beta=.1))
simdata_2<-garchSim(spec_2,n=200,extended=T)
class(simdata_2)
[1] "timeSeries"
attr(,"package")
[1] "timeSeries"
par(mfrow=c(1,3))
plot(simdata_2)
ARCH模型和GARCH模型
plot(simdata_2$eps,type="l",xlab="D",)
plot(simdata_2$garch,type="l",xlab="D")
plot(simdata_2$sigma,type="l",xlab="D")
ARCH模型和GARCH模型
acf(simdata_2$eps,xlag="lags")
acf(simdata_2$garch,xlab="lag")
acf(simdata_2$garch^2,xlab="lag")

ArchTest(simdata_2$garch,lags=12)

        ARCH LM-test; Null hypothesis: no ARCH effects

data:  simdata_2$garch
Chi-squared = 32.738, df = 12, p-value = 0.001063

ArchTest(simdata_2$eps,lags=12)

        ARCH LM-test; Null hypothesis: no ARCH effects

data:  simdata_2$eps
Chi-squared = 12.762, df = 12, p-value = 0.3866



  • 6
    点赞
  • 0
    评论
  • 17
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值