0

我正在使用来自 tsibbledata 的澳大利亚零售数据集的过去 10 年数据,并且仅使用一个系列(州 ==“新南威尔士州”,行业 ==“外卖食品服务”)。数据没有缺失值。然后,我使用前 7 年作为训练集从包 fable 中拟合了一个自动化 ETS 模型,当我将模型重新拟合到测试集(最近 3 年)时,我得到一个“参数超出范围”错误。我不知道为什么我在使用这个特定的数据集配置时会出现这个错误,但我想知道 refit 是否有时会中断,或者我是否做错了什么。

library(tidyverse)
library(fpp3)
#> -- Attaching packages -------------------------------------------- fpp3 0.4.0 --
#> v lubridate   1.7.10     v feasts      0.2.2 
#> v tsibble     1.0.1      v fable       0.3.1 
#> v tsibbledata 0.3.0
#> -- Conflicts ------------------------------------------------- fpp3_conflicts --
#> x lubridate::date()    masks base::date()
#> x dplyr::filter()      masks stats::filter()
#> x tsibble::intersect() masks base::intersect()
#> x tsibble::interval()  masks lubridate::interval()
#> x dplyr::lag()         masks stats::lag()
#> x tsibble::setdiff()   masks base::setdiff()
#> x tsibble::union()     masks base::union()

data <- tsibbledata::aus_retail %>% 
  filter(State == "New South Wales",
         Industry == "Takeaway food services",
         Month >= yearmonth("2009 Jan"))

train <- data %>% 
  filter(Month < yearmonth("2016 Jan"))

test <- data %>% 
  filter(Month >= yearmonth("2016 Jan")) 

fit <- train %>% 
  model(ets = ETS(Turnover)) 

refit <- refit(fit, test)
#> Error: Problem with `mutate()` column `ets`.
#> i `ets = (function (object, ...) ...`.
#> x Parameters out of range for ETS(A,Ad,A) model

reprex 包于 2021-08-05 创建(v2.0.1)

4

0 回答 0