omz*_*bek 2 r forecasting arima forecast fable-r
我正在尝试使用 fable 包创建 1000 家商店的预测。包是否fable像函数一样并行工作forecast?
非常感谢
plan()您可以使用future 包并行拟合模型。
可以使用 future 包并行估计模型。通过在估计模型之前指定 future::plan() ,将根据该计划计算它们。
library(fable)
#> Loading required package: fabletools
library(dplyr)
library(future)
plan(multisession)
tsibbledata::aus_retail %>%
filter(
Industry == "Food retailing"
) %>%
model(
snaive = SNAIVE(Turnover),
ets = ETS(log(Turnover) ~ error("A") + trend("A") + season("A")),
)
#> # A mable: 8 x 4
#> # Key: State, Industry [8]
#> State Industry snaive ets
#> <chr> <chr> <model> <model>
#> 1 Australian Capital Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 2 New South Wales Food retailing <SNAIVE> <ETS(A,A,A)>
#> 3 Northern Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 4 Queensland Food retailing <SNAIVE> <ETS(A,A,A)>
#> 5 South Australia Food retailing <SNAIVE> <ETS(A,A,A)>
#> 6 Tasmania Food retailing <SNAIVE> <ETS(A,A,A)>
#> 7 Victoria Food retailing <SNAIVE> <ETS(A,A,A)>
#> 8 Western Australia Food retailing <SNAIVE> <ETS(A,A,A)>
Run Code Online (Sandbox Code Playgroud)
由reprex 包于 2020 年 11 月 23 日创建(v0.3.0)