楼主: cylqd
3072 2

[问答] sp500数据拟合问题,求救! [推广有奖]

  • 0关注
  • 1粉丝

讲师

33%

还不是VIP/贵宾

-

威望
0
论坛币
4216 个
通用积分
1.7126
学术水平
2 点
热心指数
3 点
信用等级
2 点
经验
12134 点
帖子
121
精华
0
在线时间
865 小时
注册时间
2011-8-9
最后登录
2018-12-3

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
程序如下,数据和doc文件在附件中 sp500.rar (42 KB)

sp500=read.table("sp500.txt")
sp500.returns=diff(log(sp500$V1))*100
auto.arima(sp500.returns) #要加载forecast包
m1=auto.arima(sp500.returns)
res1=residuals(m1)
Box.test(res1) #为白噪声
ArchTest(res1) #要加载FinTS包 有异方差
ArchTest(res1^2) #居然没有了异方差,很奇怪

以下用GARCH(1,1)-M模型拟合,要用到rugarch包
variance.model=list(model="fGARCH",garchOrder=c(1,1), submodel="GARCH") #方差模型
mean.model=list(armaOrder=c(0,2),include.mean=TRUE,garchInMean=TRUE,inMeanType=2,arfima=FALSE) #均值模型
spec=ugarchspec(variance.model=variance.model,mean.model=mean.model, distribution.model="std") #两个模型结合
fit=ugarchfit(data=sp500.returns,spec=spec,out.sample=0,solver="solnp")
fit
这段GARCH(1,1)-M模型拟合的返回结果放在了doc文件中

以下单独对fit残差
ArchTest(residuals(fit))
McLeod.Li.test(residuals(fit)) #要加载TSA包
都显示有方差异性,我认为和doc文件中的红色加深部分矛盾

ArchTest(residuals(fit)^2)
McLeod.Li.test(y=residuals(fit)^2) #奇了怪了,残差平方后,就方差齐性了

McLeod.Li.test(y=residuals(fit)^2.1) #但这又方差异性了

Box.test(residuals(fit)) #原来ma2模型残差已是白噪声,但ma2+GARCH(1,1)-M 模型的残差反而不是白噪声了,很奇怪

GARCH(1,1)-M模型拟合返回结果

*---------------------------------*

*         GARCH Model Fit        *

*---------------------------------*


Conditional Variance Dynamics   

-----------------------------------

GARCH Model     : fGARCH(1,1)

fGARCH Sub-Model        : GARCH

Mean Model      : ARFIMA(0,0,2)

Distribution    : std


Optimal Parameters

------------------------------------

       Estimate  Std. Error  t value Pr(>|t|)

mu     0.054826    0.005660   9.6858 0.0e+00

ma1    0.098061    0.008087  12.1255 0.0e+00

ma2   -0.028445    0.007261  -3.9177 8.9e-05

omega  0.005980    0.000932   6.4160 0.0e+00

alpha1 0.075629    0.005047  14.9856 0.0e+00

beta1  0.919790    0.005039 182.5500  0.0e+00

shape  6.834882    0.354538  19.2783 0.0e+00


Robust Standard Errors:

       Estimate  Std. Error  t value Pr(>|t|)

mu      0.054826    0.005960  9.1991    0e+00

ma1     0.098061   0.009211  10.6464    0e+00

ma2    -0.028445   0.006324  -4.4981    7e-06

omega   0.005980   0.001138   5.2542    0e+00

alpha1  0.075629   0.006830  11.0737    0e+00

beta1   0.919790   0.006785 135.5722    0e+00

shape   6.834882   0.437600  15.6190    0e+00


LogLikelihood : -18376.05


Information Criteria

------------------------------------


Akaike      2.3434

Bayes       2.3468

Shibata     2.3434

Hannan-Quinn 2.3446


Q-Statistics on Standardized Residuals

------------------------------------

     statistic p-value

Lag10    17.79 0.02289

Lag15    22.12 0.05351

Lag20    27.49 0.07017


H0 : No serial correlation


Q-Statistics on Standardized SquaredResiduals

------------------------------------1

     statistic p-value

Lag10    17.53 0.02502

Lag15    20.28 0.08847

Lag20    24.12 0.15100


ARCH LM Tests

------------------------------------

             StatisticDoF  P-Value

ARCH Lag[2]     12.80   2 0.001666

ARCH Lag[5]      12.97  5 0.023657

ARCH Lag[10]    17.31  10 0.067792


Nyblom stability test

------------------------------------

Joint Statistic:  22.4136

Individual Statistics:              

mu     0.2276

ma1   16.6716

ma2    0.6400

omega  2.0735

alpha1 1.9789

beta1  2.6989

shape  1.4570


Asymptotic Critical Values (10% 5% 1%)

Joint Statistic:         1.69 1.9 2.35

Individual Statistic:    0.35 0.47 0.75


Sign Bias Test

------------------------------------

                   t-value      prob sig

Sign Bias          0.5886 5.561e-01   

Negative Sign Bias  4.0662 4.802e-05 ***

Positive Sign Bias  2.5898 9.611e-03 ***

Joint Effect       48.4371 1.719e-10 ***



Adjusted Pearson Goodness-of-Fit Test:

------------------------------------

group statistic p-value(g-1)

1   20     65.28    5.493e-07

2   30     88.29    6.657e-08

3   40     85.56    2.458e-05

4   50    113.59    4.827e-07



Elapsed time : 10.82462



望各位高手赐教,谢谢!


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:数据拟合 Q-statistics distribution Standardized standardize 程序 模型

沙发
823317513 发表于 2012-5-27 01:17:22 |只看作者 |坛友微信交流群
there are a lot of standard method in using arch and garch for sp500. use that.  there are a lot of delicate issues. Do not trust r, r is only a program, we need to set up a standard analysis procedure using the ARCH and GARCH model before using r.

使用道具

藤椅
cylqd 发表于 2012-5-28 23:42:50 |只看作者 |坛友微信交流群
谢谢823317513的回答,若能更详细就更好了

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-6-19 01:25