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

specifying "mode" argument in X_13ARIMA_SEATS using x11() #147

Closed
juan-g-p opened this issue Mar 4, 2022 · 4 comments
Closed

specifying "mode" argument in X_13ARIMA_SEATS using x11() #147

juan-g-p opened this issue Mar 4, 2022 · 4 comments

Comments

@juan-g-p
Copy link

juan-g-p commented Mar 4, 2022

I am trying to get x11 to perform an additive rather than a multiplicative decomposition. The us_retail_employment series in Hyndman's fpp3 (section 3.5) is clearly additive, nonetheless the x11 decomposition performed on the book is multiplicative (below the code of the book)

x11_dcmp <- us_retail_employment %>% model(x11 = X_13ARIMA_SEATS(Employed ~ x11())) %>% components() autoplot(x11_dcmp) + labs(title = "Decomposition of total US retail employment using X-11.")

Checking the manual (https://www2.census.gov/software/x-13arima-seats/x-13-data/documentation/docx13as.pdf), it says that x11 uses by default multiplicative, but that this can be changed to additive specifying mode = add. I have tried this and multiple variations, could you please provide some insight as to how to properly specify the formula?

x11_dcmp <- us_retail_employment %>% model(x11 = X_13ARIMA_SEATS(Employed ~ transform(func = "none"), x11(mode = "add")))

@mitchelloharawild
Copy link
Member

Each of the 'specials' in the model should be added to the formula.

So instead of X_13ARIMA_SEATS(Employed ~ transform(func = "none"), x11(mode = "add")), it should be X_13ARIMA_SEATS(Employed ~ transform(func = "none") + x11(mode = "add")). You also need to match the reference manuals argument names exactly, so it should be transform(`function` = "none").

@robjhyndman Do you think the fpp3 should be updated to use an additive decomposition in X11 example?

@juan-g-p
Copy link
Author

juan-g-p commented Mar 4, 2022

Thank you for the great and prompt answer, as well as for the great materials you provide.

I was missing the backticks in one of my attempts.

If there is any way to contribute to your project I would be happy to.

@mitchelloharawild
Copy link
Member

You're welcome. The backticks are tricky for this, because of course function has special parsing for creating functions in R. However I do think it is important to match the reference manual as close as possible.

More than happy for you to contribute to the package if you would like to. Plenty of work to be done for the function help docs, writing vignettes & package tests. If you're working with X_13ARIMA_SEATS and into coding, adding refit() support would be really nice and hopefully not too challenging to wrap around seasonal::update.seas() (#140)

@robjhyndman
Copy link
Member

I think it would be better if the help showed an additive model for X_13ARIMA_SEATS. I'll update the book to state that the default is a multiplicative decomposition. For the example shown, it doesn't make much difference whether an additive or multiplicative decomposition is used, and I'd like to keep the code as simple as possible.

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

3 participants