Tuesday, April 20, 2021

Time Series Analysis Using ARIMA From StatsModels

Time Series Analysis Using ARIMA From Statsmodels

ARIMA and exponential Moving averages are two methods for forecasting based on time series data. In this notebook, I will talk about ARIMA which is an acronym for Autoregressive Integrated Moving Averages.

Autoregressive Integrated Moving Averages (ARIMA)

The general process for ARIMA models is the following:

  • Visualize the Time Series Data
  • Make the time series data stationary
  • Plot the Correlation and AutoCorrelation Charts
  • Construct the ARIMA Model or Seasonal ARIMA based on the data
  • Use the model to make predictions

Let's go through these steps!

Monthly Champagne Sales Data
In [1]:
import numpy as np
import pandas as pd

import matplotlib.pyplot as plt
%matplotlib inline

For this example, I took the sales data which is available on kaggle https://ift.tt/3sDiIi5

In [2]:
df=pd.read_csv('perrin-freres-monthly-champagne-.csv')
In [3]:
df.head()
Out[3]:
Month Perrin Freres monthly champagne sales millions ?64-?72
(continued...)

from Planet SciPy
read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...