R帮助如下:
Generalized Portmanteau Tests for GARCH ModelsDescriptionPerform a goodness-of-fit test for the GARCH model by checking whether the standardized residuals are iid based on the ACF of the absolute residuals or squared residuals.
UsagegBox(model, lags = 1:20, x, method = c("squared", "absolute")[1], plot = TRUE)Arguments
| model | fitted model from the garch function of the tseries library |
| lags | a vector of maximum ACF lags to be used in the test |
| x | time series data to which the GARCH model is fitted |
| method | "squared": test is based on squared residuals; "absolute": test is based on absolute residuals |
| plot | logical variable, if TRUE, the p-values of the tests are plotted |
| lags | lags in the input |
| pvalue | a vector of p-values of the tests |
| method | method used |
| x | x |
References"Time Series Analysis, with Applications in R" by J.D. Cryer and K.S. Chan
Exampleslibrary(tseries)data(CREF)r.cref=diff(log(CREF))*100m1=garch(x=r.cref,order=c(1,1))summary(m1)#gBox(m1,x=r.cref,method='squared')############################################
我的这段程序如下gBox(g09,x=DEC09_R1,method='squared')但是运行过后老是出错如:“错误于filter(M, filter = beta, method = "recursive", sides = 1, init = rep(sigma2,:dims [product 2]与对象长度[1]不匹配”查看residuals(g09)残差序列时,发现前几个值是NA,于是我用例子里面的garch(1,1)模型又做了一遍,还是这样,这个和空值有关么???为什么会有这样的错误提示啊??求解!!!
如果不用广义混合检验,只用ACF行不行丫?总感觉不完善……
还有模型拟合以后,在之后20多阶的时候出现一个相关性是不是能说明有异常值的存在?


雷达卡




京公网安备 11010802022788号







