r - 添加带有寓言预测估计的 theta 模型
问题描述
我想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
有什么办法可以在里面使用theta方法fable
吗?
解决方案
预测包中的模型使用不同的接口,因此与model()
fable 使用的函数不兼容。theta 模型将在下一个版本中添加到 fable 中。
您可以自己创建寓言,使用 的预测输出forecast::thetaf()
来确定适当的分布。这对于绘图、准确性评估和协调很有用,但是集成需要模型使用 fable 接口。
更新:该THETA()
模型现已添加到寓言中。
推荐阅读
- flutter - 如何在 Flutter 中为模块创建单独的路由?
- html - 出于某种原因,我在 div 中的图像没有显示出来,它只是空的。我可以在浏览器的 F12 中看到它的假定图像的轮廓
- python - 如何在我的 python 程序中重写文件中的某些内容
- javascript - 使用钩子从数组中设置多个值
- javascript - 如何创建一个与 include() 方法作用相同的函数
- python - 为什么 git fetch 并不总是更新本地分支以显示它何时与远程不同步
- swift - 在 SwiftUI 中点击时,从函数返回的按钮不起作用
- php - PHP 8,函数别名兼容性`getdir()`
- json - 用golang解析Json文件,遇到问题“cannot unmarshal object into Go value of type”
- python - 3 x 1D 坐标数组到 1 个 3D 数组