【发布时间】:2022-01-09 18:56:24
【问题描述】:
我正在阅读《预测原理与实践》一书。具体来说,我正在研究有用的预测器部分,这里是:https://otexts.com/fpp3/useful-predictors.html。
文本中提到了干预变量,但我无法让尖峰或阶跃变量运行。我检查了*,并在网上查看,但没有找到示例。无论我使用尖峰还是阶跃,下面的代码都会返回一个 NULL 模型,任何帮助让干预变量运行都将不胜感激。
library(tidyverse)
library(fpp3)
fit_consBest <- us_change %>%
model(
lm = TSLM(Consumption ~ Income + Savings + Unemployment + trend() + season()),
step = TSLM(formula = Consumption ~ Income + step(object = lm, scope = Income + Savings + Unemployment))
)
# All of the reporting methods below return NULL models or errors:
report(fit_consBest)
fit_consBest %>%
select(step)
glance(fit_consBest)
【问题讨论】:
标签: r time-series forecasting fable-r