What is ACF in ARIMA?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

What is ACF in ARIMA?

What is ACF in ARIMA?

This recipe explains what is ACF in ARIMA

0

Recipe Objective

To calculate lag values for the Autoregression (AR) and Moving Average (MA) parameters, p and q respectively in ARIMA modelling, ACF (Autocorrelation function) is used. It is the coorelation between observation of a time series separated by k time units.

So this recipe is a short example on What is ACF in ARIMA. Let's get started.

Step 1 - Import the library

import numpy as np import pandas as pd from statsmodels.graphics.tsaplots import plot_acf import matplotlib.pyplot as plt

Let's pause and look at these imports. Numpy and pandas are general ones. Here, plot_acf and plt will help is plotting of ACF pattern of ARIMA model.

Step 2 - Setup the Data

df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/a10.csv', parse_dates=['date']).set_index('date')

Here, we have used one time series data from github. Also, we have set our index to date.

Now our dataset is ready.

Step 3 - Plotting ACF

plt.figure() plt.subplot(211) plot_acf(df, ax=plt.gca()) plt.show()

We have used plot_acf to simply plot our ACF model. By observing the plot, we can have an understanding of the lag between AR and MR terms of ARIMA model.

Step 4 - Lets look at our dataset now

Once we run the above code snippet, we will see:

Srcoll down the ipython file to visualize the results.

Clearly, an exponential decay in the seasonal pattern can be seen.

Relevant Projects

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Loan Eligibility Prediction using Gradient Boosting Classifier
This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.

Topic modelling using Kmeans clustering to group customer reviews
In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.

Forecast Inventory demand using historical sales data in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.