ARIMA(Auto Regression Integrated Moving Average) Model Implementation in Python. Following things are covered in the video:
1) Reading Time Series Data in Python using Pandas library
2) Checking for stationarity of time series model
3) Auto Arima Function to select order of Auto Regression Model
4) Predicting Future temperature values using given dataset
5) Statsmodels library is used for modelling
My medium article on the same(Contains code and dataset): https://medium.com/@nachihebbar/temperature-forecasting-with-arima-model-in-python-427b2d3bcb53?sk=ff83ea42d7ca5eee874fc4f4be219604
Recommended Books to get better at Time Series Analysis and Python:
1)Practical Time Series Analysis: https://amzn.to/31lsLhq
2)Time Series with Python: https://amzn.to/2Ez073m
3)Hands-On Time Series Analysis with R: https://amzn.to/3aUxuKq
My 2nd Youtube Channel: https://www.youtube.com/channel/UCJBz6f1QtbNrDYwR-AUcSjA
You can connect with me on linkedin: https://www.linkedin.com/in/nachiketa-hebbar-86186515b/
Video Rating: / 5
There is a small correction in the plot. By mistake I had trained the model on the entire data set, instead of just the training set. While shooting the video, I noticed this mistake and made the correction, however I forgot to rerun the code.
On fitting the model on training set, the plot that you would probably get is a somewhat constant plot that ranges between the values of 44 to 46.
That is fine, it just means that the model would have got a lower error in forecasting around the mean value, instead of fitting to the irregular variations. You can also try with a bigger data set, or other models like random forest or even RNN's.
Hi,
start=len(train)
end=len(train)+len(test)-1
pred=model.predict(start=start,end=end,typ='levels')
print('pred')
I am getting an error here
predict() got an unexpected keyword argument 'typ'
Could you plz help me with that
Hi. I'm doing some studies, i'd like to argue my result with you. Is it possible?
this is a lie
I'm using same data and train model as yours but my prediction on test set result is different, the result tends to be constant up from 44 until 46 not fluctuating like in the video and example.
It will same as the example if I use model=ARIMA(df['AvgTemp'],order=(1,0,5)) when I train the model, not use model=ARIMA(train['AvgTemp'],order=(1,0,5)) but I think it's wrong if using df as train model
What's your opinion?
Can we improve the performance of model ?
pmdarima..there is no such module in my jupyter notebook
i did it for another dataset..my p value is 2.23 like that..so it is not stationery.. so can u upload some cvideos on how to make the data stationery.it will be really very helpful
thanks nachiketan..this is really very helpful video…i have watched all ur videos related to time series analysis..can u help me out as im facing one problem..i took another dataset and imported it in python and i got the visualization..but when im doin dickey fuller test..im not getting any output and no error even
how to handle seasonality?
what if the number of data points is less than 50?
Hi Nachiketa, thanks for the great video on ARIMA and the code, could you please help on how to use the order=(3,1,3) in your code, currently it fails to run the code.
I tried the same code you used. But its not giving good forecast like yours.
Not sure what's the problem.
Its basically starting from 44 and then stays 46 value till end of forecast. There is no trend ,or variations in the forecast actually.
Can you tell me the reason why its happening.
Why the plot is not overlapping ?? The graph looks like it lags one step. Try using df.shift(-1), and you will see that all predict and real value overlap
very nice explaination…keep posting
Hello Nachiketa,
I appreciate your effort in making these educational videos. Your delivery style is very good.
I have one doubt. I am using the airpassenger data for future prediction. To make the data stationary first I apply log transformation then I applied differentiation, then I predict. Now please tell me how to inverse transformation these predicted values. I did it but the prediction is way more than the actual. Kindly tell me the best way.
¿Which is better an ARIMA model or a Neural Network?
¿or sometimes one is better than the other?
Hi Nachi, having a lot of fun with this video and data. I am working with the same df and code, simply trying to replicate your results. I get stuck when I print out predictions (7:00 in video). I have much less variation in my predictions. numbers start at 44 and eventually stay on 46, so my plot is a straight line.
Everything before this has matched: p value, order, aic
Any idea what I am doing wrong here? Thanks!
Hi Nachiketa – excellent video going precisely into ARIMA. Great work. I wanted to access the tutorials from the #1 series in the playlist but didnt find one. Please share link of the series. Regards , Krish
If I only want to consider a certain lag in my ARIMA model?? for example only consider the lag 3 but i don't want the lag 1 and 2 in my model, How can i do that ??