Hi guys,
Actually I was following an article to simulate ensemble models with my data: https://robjhyndman.com/seminars/nyrc2020/,
And I got an error :
Problem with 'summarise()' input 'n'.
x object of type 'closure' cannot be divided into subsets
i input 'n' is dist_mixture(n[1], n[2], weights = c(0.5, 0.5)).
Sorry about my delayed answer, I was learning how to do it, follow reprex as requested:
library(forecast)
#> Warning: package 'forecast' was built under R version 3.6.2
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
library(tsibble)
#> Warning: package 'tsibble' was built under R version 3.6.2
library(fable)
#> Warning: package 'fable' was built under R version 3.6.2
#> Carregando pacotes exigidos: fabletools
#> Warning: package 'fabletools' was built under R version 3.6.2
#>
#> Attaching package: 'fabletools'
#> The following objects are masked from 'package:forecast':
#>
#> accuracy, forecast
library(distributional)
#> Warning: package 'distributional' was built under R version 3.6.2
iniciativa <- tibble(
data_planejada = sample(seq(as.Date("2020-01-01"), length=20, by="1 day"), size=20),
n = sample(seq(100), size=20)
)
iniciativa <- iniciativa %>% as_tsibble()
#> Using `data_planejada` as index variable.
ens_fit <- iniciativa %>%
model(
tslm = TSLM(n ~ trend() + season(period = 22)),
arima = ARIMA(n ~ trend() + season(period = 3), stepwise = TRUE)
) %>%
summarize(
n = dist_mixture(
n[1], n[2],
weights = c(0.5, 0.5))
)
#> Error in summarize(., n = dist_mixture(n[1], n[2], weights = c(0.5, 0.5))): não foi possível encontrar a função "summarize"
Also, I would like to hear some advice about how to choose the best model given the metrics attached.
There is a standard about when some error is acceptable than other ?