Multiplicative STL decomposition + nonseasonal + out of sample accuracy

Hi guys,
Still working in my model, now I'm trying to check my out of sample data using test set, some help will be appreciated :

library(fpp3)
#> Warning: package 'fpp3' was built under R version 3.6.2
#> ── Attaching packages ──────────────────────────────────────────── fpp3 0.4.0 ──
#> ✓ tibble      3.1.0      ✓ tsibble     1.0.0 
#> ✓ dplyr       1.0.5      ✓ tsibbledata 0.2.0 
#> ✓ tidyr       1.1.2      ✓ feasts      0.1.7 
#> ✓ lubridate   1.7.10     ✓ fable       0.3.0 
#> ✓ ggplot2     3.3.3
#> Warning: package 'tidyr' was built under R version 3.6.2
#> Warning: package 'ggplot2' was built under R version 3.6.2
#> Warning: package 'tsibbledata' was built under R version 3.6.2
#> Warning: package 'feasts' was built under R version 3.6.2
#> Warning: package 'fabletools' was built under R version 3.6.2
#> Warning: package 'fable' was built under R version 3.6.2
#> ── 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_tsbl_training <- AirPassengers %>% 
    as_tsibble()

dcmcp_spec2 <- decomposition_model(
    STL(log(value)),
    ETS(season_adjust ~ error("A") + trend("A") + season("N")))

holt_fit <- data_tsbl_training %>% 
    model(dcmcp_spec2)

data_tsbl_test <- data_tsbl_training %>% 
    slice(133:144)


holt_fit %>% 
    refit(data_tsbl_test) %>% 
    accuracy()
#> Error: Problem with `mutate()` input `dcmcp_spec2`.
#> x método não aplicável para 'refit' aplicado a um objeto de classe "c('decomposition_model', 'model_combination')"
#> ℹ Input `dcmcp_spec2` is `(function (object, ...) ...`.

Created on 2021-03-22 by the reprex package (v1.0.0)

Best

Lucas

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.