我想在Forecast
预测模型中使用在fable
包中实现的theta模型。这是我想做的。
library(forecast)
library(tidyverse)
library(fable)
library(tsibble)
library(fabletools)
tourism_aus <- tourism %>%
summarise(Trips = sum(Trips))
tourism_aus
fit <- tourism_aus %>%
model(
ets = ETS(Trips),
arima = ARIMA(Trips),
theta = forecast::thetaf(Trips)
) %>%
mutate(
average = (ets + arima + theta) / 3
)
fit
fit %>%
forecast(h = "2 years") %>%
autoplot(tourism_aus, level = 95, alpha = 0.5)
我收到此错误消息,
Failure in thetaf(Trips) : Objekt 'Trips' not found
有什么方法可以在fable
中使用theta方法?
答案 0 :(得分:1)
预测包中的模型使用不同的接口,因此与寓言使用的model()
函数不兼容。 Theta模型将在下一个版本中添加到寓言中。
您可以使用forecast::thetaf()
的预测输出来自己确定寓言,以找出适当的分布。这对于绘图,准确性评估和对帐很有用,但是集成要求模型使用寓言界面。
更新:
THETA()
模型现已添加到寓言中。