In the Forecasting: principles and practice book they claim that:
R ensures the fitted model is both stationary and invertible
I checked and indeed - for example the following model fits, even though the data are not stationary and I should have differenced:
library(fpp2) fit2 <- arima(taylor, order=c(1,0,1), include.mean = TRUE, transform.pars=FALSE) 1/forecast:::arroots(fit2)$roots autoplot(fit2)
and the AR inverse root is
0.9813966+0i, which is a bad sign according to the text.
but HOW do they do it? When I try fitting the same model with python's
statsmodels it fails. What's the technique used for ensuring stationarity and invertibility?
transform.pars=FALSE so it's not that.