R语言FitAR包 LjungBoxTest函数使用说明 |
您所在的位置:网站首页 › max函数用法 › R语言FitAR包 LjungBoxTest函数使用说明 |
返回R语言FitAR包函数列表 功能\作用概述:实现了ARIMA模型拟合优度的Ljung-Box-Portmanteau检验。 语法\用法:LjungBoxTest(res, k=0, lag.max=30, StartLag=1, SquaredQ=FALSE) 参数说明:res : 残差 k : ARMA参数个数,默认k=0 lag.max : 最大滞后,默认最大滞后=30 StartLag : 对lags m进行测试=STARTAG:最大滞后,默认值为1 SquaredQ : 如果为TRUE,则使用平方残差进行ARCH测试,默认平方=FALSE 示例\实例:#test goodness-of-fit of AR(2) model fit to log(lynx)data(lynx)z< - log(lynx)ans< - FitAR(z, 1:2)#notice that the test is also available as a component of the output of FitAR ans$LjungBox#a plot of the test is producedplot(ans)#doing the test manuallyres< - resid(ans)LjungBoxTest(res, k=2, lag.max=20, StartLag=5) #test for subset casez< - log(lynx)pvec< - SelectModel(z, ARModel="ARz", Criterion="BIC", lag.max=10, Best=1)ans< - FitAR(z, pvec)plot(ans)res< - resid(ans)LjungBoxTest(res, k=length(pvec), lag.max=20, StartLag=11)#test for ARCH effect,LjungBoxTest(res,SquaredQ=TRUE) |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |