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

i(n) terms fail when using exogenous regressors #2

Open
samkodes opened this issue May 14, 2024 · 1 comment
Open

i(n) terms fail when using exogenous regressors #2

samkodes opened this issue May 14, 2024 · 1 comment

Comments

@samkodes
Copy link

samkodes commented May 14, 2024

When trying to use an exogenous regressor with an i(n) (e.g. i(1)) term, the sarima function throws an error. For example:

testdata <- data.frame(y1=rnorm(100),x1 = rnorm(100))

smod2 <- sarima( y1 ~   x1 | ar(1)+i(1),
                 data=testdata
                 )

The error is:
Error in model.frame.default(formula, data = data.frame(.dummy = t), na.action = NULL) : variable lengths differ (found for 'x1')

I am guessing this has to do with differencing the exogenous regressor, but this seems like a very common use case?

Would the solution simply be to pre-difference the data so the i(1) term is not required, though this demands that the user re-integrate any forecast?

@GeoBosh
Copy link
Owner

GeoBosh commented May 15, 2024

Thanks for the report and the complete example.

This looks like a bug, I will check.

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