nachi-hebbar / ARIMA-Temperature_Forecasting

Temperature forecasting using ARIMA model in Python. Pmdarima and statsmodel library are used
44 stars 63 forks source link

Prediction is strange #1

Open CoolandHot opened 3 years ago

CoolandHot commented 3 years ago

Hi, Nachiketa, thank you for releasing this tutorial.

I just tried the code in colab, but the prediction under section "Make Predictions on Test Set" is strange. Using the same code, my output is arima

Would you please check again ?

evarahmadanti commented 3 years ago

@CoolandHot @nachi-hebbar Hello , I have that problem too. Are you already fixed that ? I will appreciate if you answer this immediately.

7achilles7 commented 3 years ago

Hi Nachiketa,

Facing the same issue. Can you please look into this.

Does any of you guys got the problem @CoolandHot @evarahmadanti

CoolandHot commented 3 years ago

Hi Nachiketa,

Facing the same issue. Can you please look into this.

Does any of you guys got the problem @CoolandHot @evarahmadanti

Right, sorry to reply late. I solved this by using the rolling forward/walk-forward method, refer to How to Create an ARIMA Model for Time Series Forecasting in Python Basically, this issue happens because the original code is predicting to many steps in the future, this makes the prediction deviates more and more as the step goes on, while walk-forward predicts only one step forward. For example, we predict $100{th}$ data point using $0{th}$ to $99{th}$, then for the $101{th}$, we will use $1{th}$ to $100{th}$ as inputs.

@evarahmadanti @7achilles7

EccoAtSix commented 2 years ago

Hi Nachiketa, Facing the same issue. Can you please look into this. Does any of you guys got the problem @CoolandHot @evarahmadanti

Right, sorry to reply late. I solved this by using the rolling forward/walk-forward method, refer to How to Create an ARIMA Model for Time Series Forecasting in Python Basically, this issue happens because the original code is predicting to many steps in the future, this makes the prediction deviates more and more as the step goes on, while walk-forward predicts only one step forward. For example, we predict $100{th}$ data point using $0{th}$ to $99{th}$, then for the $101{th}$, we will use $1{th}$ to $100{th}$ as inputs.

@evarahmadanti @7achilles7

And what happens if we want to predict steps in the future out of the sample forecast? I wrote this but gives me the error:

model1=ARIMA(data_train, order=(3, 1 ,1))

modelo=model1.fit()

n_forecast=60

futures=modelo.get_prediction(start=len(data_train),end=len(data_train)+n_forecast-1)

ValueError: Out-of-sample operations in a model with a regression component require additional exogenous values via the exog argument.

I've seen that you don't need to put an exogenous variable....so why does this error come out?