我刚刚从包arma()
tseries
估算了一个MA模型,其中包含第5个第9个和第14个成分:
Coefficient(s): ma5 ma9 ma14 intercept -0.0384602 -0.0543772 0.0973954 0.0002656
但现在不要提前30天预测。
答案 0 :(得分:0)
您可以使用ma
参数进行设置。
这是一个最小的,完整的,可验证的例子:
require(tseries)
data(nino)
s <- nino3.4
summary(s.arma
<- arma(s, lag=list(ar=c(1,3,7,10,12,13,16,17,19),ma=30)))
Call: arma(x = s, lag = list(ar = c(1, 3, 7, 10, 12, 13, 16, 17, 19), ma = 30)) Model: ARMA(19,30) Residuals: Min 1Q Median 3Q Max -1.374330 -0.225439 0.003465 0.220010 1.087211 Coefficient(s): Estimate Std. Error t value Pr(>|t|) ar1 1.08886 0.02627 41.447 < 2e-16 *** ar3 -0.18211 0.03013 -6.044 1.50e-09 *** ar7 -0.13282 0.02269 -5.854 4.79e-09 *** ar10 0.17785 0.02934 6.062 1.35e-09 *** ar12 0.16529 0.04882 3.386 0.00071 *** ar13 -0.26895 0.04282 -6.281 3.37e-10 *** ar16 -0.22409 0.04418 -5.073 3.92e-07 *** ar17 0.25495 0.04731 5.389 7.07e-08 *** ar19 -0.04727 0.02619 -1.805 0.07110 . ma30 0.04283 0.04141 1.034 0.30095 intercept 4.53718 0.76437 5.936 2.92e-09 ***
有用的资源:
https://cran.r-project.org/web/views/TimeSeries.html
http://a-little-book-of-r-for-time-series.readthedocs.io/en/latest/