| 所在主题: | |
| 文件名: data.txt | |
| 资料下载链接地址: https://bbs.pinggu.org/a-1393584.html | |
| 附件大小: | |
|
> library(tsDyn)
> A <- read.table("data.txt",col.names=c("date","t","price1","price2","price3","price4","price5","price6","price7","price8","price9","price10","price11")) > mod.lstar <- lstar(A$price4,m=1,control=list(maxit=3000)) Using maximum autoregressive order for low regime: mL = 1 Using maximum autoregressive order for high regime: mH = 1 Using default threshold variable: thDelay=0 Performing grid search for starting values... Starting values fixed: gamma =3.538462 , th =9.236948 ; SSE =21060.39 Optimization algorithm converged Optimized values fixed for regime 2: gamma =37.7138 , th =12.17005 ; SSE =20357.32 > summary(mod.lstar) Non linear autoregressive model LSTAR model Coefficients: Low regime: const1 phi1.1 0.2974328 0.3633679 High regime: const2 phi2.1 37.751052 -2.509213 Smoothing parameter: gamma = 37.71 Threshold Variable: Z(t) = + (1) X(t) Value: 12.17 Residuals: Min 1Q Median 3Q Max -21.36528-3.90579-0.26034 4.0200922.78858 Fit: residuals variance = 40.55,AIC = 1871, MAPE = 120.7% Coefficient(s): EstimateStd. Error t valuePr(>|z|) const10.297432820.29347916 1.0135 0.3108 phi1.10.363367880.04858111 7.4796 7.461e-14 *** const2 37.751051886.41464076 5.8851 3.977e-09 *** phi2.1 -2.509213010.39707585 -6.3192 2.629e-10 *** gamma37.71380290 NA NA NA th 12.170050930.00097296 12508.2756 < 2.2e-16 *** --- Signif. codes:0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Non-linearity test of full-order LSTAR model against full-order AR model F = 11.015 ; p-value = 0.00097013 Threshold Variable: Z(t) = + (1) X(t) Warning messages: 1: In vcov.lstar(object) : Hessian negative-semi definite 2: In sqrt(diag(vc)) : NaNs produced 此次运行结果是重启了R,再运行的代码。 之前对lstar.R进行过修改,并运行过,但我把它放在另一个包了。 为什么会出现这个警告信息呢?怎么修改呢?(在其他电脑上运行,没有这个警告信息,可能是修改的文件影响了结果?) |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明