我只是尝试使用 arima() 函数构建 arima 模型,并希望使用 summary() 函数获取一些摘要统计数据,例如 AIC 和 RMSE。但是当我在笔记本电脑上的 RStudio (R 4.3.1) 中运行摘要函数时,它给了我一些奇怪的输出。
这是我在系统上运行的代码:
library(datasets)
library(tseries)
data("presidents")
m_111 <- arima(presidents, order = c(1,1,1))
summary(m_111)
这是我得到的输出:
> summary(m_111)
Length Class Mode
coef 2 -none- numeric
sigma2 1 -none- numeric
var.coef 4 -none- numeric
mask 2 -none- logical
loglik 1 -none- numeric
aic 1 -none- numeric
arma 7 -none- numeric
residuals 120 ts numeric
call 3 -none- call
series 1 -none- character
code 1 -none- numeric
n.cond 1 -none- numeric
nobs 1 -none- numeric
model 10 -none- list
我期望的输出是这样的:
我不明白为什么我没有得到所需的输出。
summary.arima()
包中没有stats
方法。该图显示了 forecast
包中的汇总方法的输出。所以使用library(forecast)
。