SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # load pmdarima
  2. import pmdarima
  3. #automatically fit the optimal ARIMA model for given time series
  4. arima_model_fitted = pmdarima.auto_arima(X)
  5. # one-step out-of sample forecast
  6. forecast = arima_model.predict(n_periods=1)[0]
  7.  
  8. # load statsmodels
  9. import statsmodels.tsa.arima_model stm
  10. # fit ARIMA model
  11. model = stm.ARIMA(X, order=(3,1,2))
  12. model_fit = model.fit()
  13. # one-step out-of sample forecast
  14. forecast = model_fit.forecast()[0]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top