CH09 - ARMA Models

Hi

I’m working through chapter 9 on Time-Series and in it we import statsmodels.tsa.api as tsa. Later on, we user tsa.ARMA to for model creation. However, this no longer appears to be available in later versions of statsmodels.

An example is Cell 12 of the 02_arima_models notebook.

I’ve tried adapting it to use model = sm.tsa.SARIMAX(endog=train_set, order=(p, 0 ,q)).fit() as suggested by a user on the MLTrading subreddit, but I get a “ValueError: array length 0 does not match index length 228” Traceback at the following line:

result = (pd.DataFrame({‘y_true’: y_true, ‘y_pred’: y_pred})
.replace(np.inf, np.nan)
.dropna())

Are there any plans to update the workbooks to later libraries?

Hi @MrFanciful,

thank you for your interest. I’m afraid I won’t be able to keep all workbooks up to date for the latest versions; there are over 100 notebooks and numerous libraries that keep evolving. Also, keep in mind, that different users will be working with different versions., which further complicates things.

It’s probably a good exercise to adjust the code according to the new docs and you are most welcome to submit a pull request with updated code. I hope this works for you!

Cheers, Stefan