當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R predict.Arima ARIMA 的預測適合

R語言 predict.Arima 位於 stats 包(package)。

說明

根據 arima 擬合的模型進行預測。

用法

## S3 method for class 'Arima'
predict(object, n.ahead = 1, newxreg = NULL,
        se.fit = TRUE, ...)

參數

object

arima 擬合的結果。

n.ahead

需要預測的前方步數。

newxreg

用於預測的 xreg 的新值。必須至少有 n.ahead 行。

se.fit

邏輯:是否應該返回預測的標準誤差?

...

傳遞給其他方法或從其他方法傳遞的參數。

細節

通過 KalmanForecast 使用 Finite-history 預測。僅當擬合的 MA 部分可逆時,這才在統計上有效,因此 predict.Arima 將為不可逆 MA 模型發出警告。

預測的標準誤差排除了 ARMA 模型和回歸係數估計的不確定性。根據 Harvey(1993,第 58-9 頁)的說法,影響很小。

預測的時間序列,或者如果 se.fit = TRUE ,則包含組件 pred 的列表(預測)和 se 估計的標準誤差。兩個組成部分都是時間序列。

例子

od <- options(digits = 5) # avoid too much spurious accuracy
predict(arima(lh, order = c(3,0,0)), n.ahead = 12)

(fit <- arima(USAccDeaths, order = c(0,1,1),
              seasonal = list(order = c(0,1,1))))
predict(fit, n.ahead = 6)
options(od)

參考

Durbin, J. and Koopman, S. J. (2001). Time Series Analysis by State Space Methods. Oxford University Press.

Harvey, A. C. and McKenzie, C. R. (1982). Algorithm AS 182: An algorithm for finite sample prediction from ARIMA processes. Applied Statistics, 31, 180-187. doi:10.2307/2347987.

Harvey, A. C. (1993). Time Series Models, 2nd Edition. Harvester Wheatsheaf. Sections 3.3 and 4.4.

也可以看看

arima

相關用法


注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Forecast from ARIMA fits。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。