在fable
'sARIMA
函数中,我们可以选择查看使用该trace = TRUE
选项评估的所有模型。(下面的示例。)此输出仅打印到控制台。
是否有任何地方可以保存此模型评估历史记录,或者有什么方法可以保存打印的控制台输出?
library(dplyr)
library(fable)
library(tsibble)
library(tsibbledata)
df <- aus_livestock |>
filter(Animal == 'Pigs', State == 'Queensland')
fcst <- df |>
model(arima = ARIMA(Count, trace = TRUE))
# Prints all models tried, but only saves final selected model:
# Model specification Selection metric
# ARIMA(2,1,2)(1,0,1)[12]+c Inf
# ARIMA(0,1,0)(0,0,0)[12]+c 21811.280078
# ARIMA(1,1,0)(1,0,0)[12]+c 21524.227259
# ARIMA(0,1,1)(0,0,1)[12]+c 21470.955343
# Search iteration complete: Current best fit is 0 1 1 0 0 1 1
# ARIMA(0,1,1)(0,0,0)[12]+c 21562.904816
# ARIMA(0,1,0)(0,0,1)[12]+c 21710.467789
# ARIMA(0,1,1)(0,0,1)[12] 21469.103988
# Search iteration complete: Current best fit is 0 1 1 0 0 1 0
# ...
# ...
# ...