Open samkodes opened 6 months ago
When trying to use an exogenous regressor with an i(n) (e.g. i(1)) term, the sarima function throws an error. For example:
sarima
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')
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?
Thanks for the report and the complete example.
This looks like a bug, I will check.
When trying to use an exogenous regressor with an i(n) (e.g. i(1)) term, the
sarima
function throws an error. For example: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?