RJT1990 / pyflux

Open source time series library for Python
BSD 3-Clause "New" or "Revised" License
2.11k stars 240 forks source link

Predict error in agregation with ARIMAX and ARIMA #57

Open esraozdemir1 opened 7 years ago

esraozdemir1 commented 7 years ago

These are my models: model1 = pf.ARIMA(data=df, ar=1, ma=0) model2 = pf.ARIMAX(data=df, formula='y ~ 1 + t', ar=1, ma=0)

mix = pf.Aggregate(learning_rate=1.0, loss_type='squared') mix.add_model(model1) mix.add_model(model2)

Although, I can run mix.summary and mix.predict_is(h=1) code without any error, I have an error when run the "mix.predict(h=1) " code. the error is that "TypeError: 'NoneType' object has no attribute 'getitem'"

Why I got this error?

RJT1990 commented 7 years ago

Thanks for reporting - I'll try to have a look at this before the planned release this week.

RJT1990 commented 7 years ago

Ah, this is because the current Aggregation algorithm does not support exogenous variable models right now. The error is because to predict for the next period, it needs to have assumptions for what the exogenous variables will be in the next period - since none is provided in the current code, the code refers to a Nonetype.

Ideally we should support all models through the Aggregation algorithm, so I will make a note to put this feature in that will allow you to compute the mixture for your case above.

Thanks - will revert in next few days.

esraozdemir1 commented 7 years ago

Did you find an opportunity to look this mistake?

RJT1990 commented 7 years ago

Probably will be in the release after next

RJT1990 commented 7 years ago

(By the way, you are welcome to put in a pull request if you would like to speed this up - I think the code in question is quite simple to adjust - it's located in the ensembles folder?)