添加带有寓言预测估计的theta模型

时间:2020-05-07 09:07:15

标签: r forecast fable-r

我想在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方法?

1 个答案:

答案 0 :(得分:1)

预测包中的模型使用不同的接口,因此与寓言使用的model()函数不兼容。 Theta模型将在下一个版本中添加到寓言中。

您可以使用forecast::thetaf()的预测输出来自己确定寓言,以找出适当的分布。这对于绘图,准确性评估和对帐很有用,但是集成要求模型使用寓言界面。

更新: THETA()模型现已添加到寓言中。