0

I've been scouring the net for something like this, but I can't quite figure it out.

enter image description here

Here is my data. I am trying to predict 'Close' using both the time series data from 'Close' as well as the time series data from 'Posts'. I've tried looking into documentation on SARIMA, auto arima, etc... and I'm not getting anywhere. Does anyone have any idea on how this could be done in Python? This is a pandas dataframe.

Potato Joe
  • 17
  • 6

1 Answers1

1
import pmdarima

arima_model = pmdarima.auto_arima(arima_final['Close'].values, X=arima_final['Posts'].values)
arima_model.predict(5, X=...)

That's the simplest way I know of to do what you're asking (use a model, presumably an ARIMA model, to predict future values of Close). The X argument is the exogenous data. Note that you'll also need to provide it with exogenous data when predicting, hence the X=... in the code above.

mmiron
  • 164
  • 5
  • Thanks for the answer. It causes a few issues with arrays and the like, but I did find something that works similarly in SARIMAX model = sm.tsa.SARIMAX(endog=train['Close'], exog=train['Posts'], order=(4,1,3)).fit() – Potato Joe Apr 25 '21 at 05:44