Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between feasts and forecast on guerrero lambda calculation #114

Closed
robjhyndman opened this issue Aug 10, 2020 · 2 comments
Closed

Comments

@robjhyndman
Copy link
Member

See https://stackoverflow.com/q/63346756/144157

library(tidyverse)
library(tsibble)
library(feasts)
#> Loading required package: fabletools
#> Registered S3 methods overwritten by 'fabletools':
#>   method      from 
#>   glance.NULL broom
#>   tidy.NULL   broom

vic_cafe <- tsibbledata::aus_retail %>%
  filter(
    State == "Victoria",
    Industry == "Cafes, restaurants and catering services"
  ) %>%
  select(Month, Turnover)

vic_cafe %>% features(Turnover, guerrero) %>% pull(lambda_guerrero)
#> [1] 0.1240828

forecast::BoxCox.lambda(as.ts(vic_cafe), method = "guerrero")
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
#> [1] 0.1734189

Created on 2020-08-11 by the reprex package (v0.3.0)

@mitchelloharawild
Copy link
Member

The difference is that forecast trims the data to start with the beginning of the year, but feasts does not.
{forecast} will always take Jan-Dec as the seasonal groups, but {feasts} will use Apr-Mar as the season when the data starts in April.

{feasts} also doesn't remove the start/end of the series if they don't exactly fit in the seasonal period (for example, partial years).

Should this behaviour be changed? My understanding is that the method isn't specific to starting at standard seasonal origins (although results will slightly differ).

@robjhyndman
Copy link
Member Author

Ah, ok. {feasts} is the preferable approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants