[程式] R軟體的ADF模型的指令問題

看板Statistics作者 (土土)時間15年前 (2010/12/06 09:38), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
[軟體程式類別]:R [程式問題]:ADF迴歸模型 [軟體熟悉度]: 中(3個月到1年) [問題敘述]: 現在在處理一個時間序列,是希望可以跑出他的落後期數和迴歸結果,我下載了 R軟體裡面的urca套件,用的是ur.df的指令,跑出結果應該怎麼看模型依AIC選 擇的落後期數呢?還是,可以有別的指令來完成這樣的要求呢? 指令是這樣的: ur.df(y, type = c("none", "drift", "trend"), lags = 1, selectlags = c("Fixed", "AIC", "BIC")) 另外還有個問題就是,為什麼要選擇最大的lag數呢?設不設有什麼差別嗎? 下面是我試著跑一次的結果(沒有設定最大lag數) Test regression drift Call: lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag) Residuals: Min 1Q Median 3Q Max -0.21839 -0.03233 -0.01852 0.01463 0.39522 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.1503 0.3745 -3.071 0.00482 ** z.lag.1 -0.2788 0.0887 -3.143 0.00403 ** z.diff.lag -0.1287 0.1632 -0.788 0.43740 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.1134 on 27 degrees of freedom Multiple R-squared: 0.2826, Adjusted R-squared: 0.2295 F-statistic: 5.319 on 2 and 27 DF, p-value: 0.01128 Value of test-statistic is: -3.1434 5.6527 Critical values for test statistics: 1pct 5pct 10pct tau2 -3.58 -2.93 -2.60 phi1 7.06 4.86 3.94 麻煩大家幫我解惑了,謝謝:) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.204.193

02/01 19:31, , 1F
現在回好像有點晚...我也在研究這個package老半天終於得
02/01 19:31, 1F
文章代碼(AID): #1C_3wZyJ (Statistics)
文章代碼(AID): #1C_3wZyJ (Statistics)