# Testing for Autocorrelation

Learn to apply the Ljung-Box test for autocorrelation.

## Motivation

Sometimes, we’ll need to know if there is any autocorrelation of any form in our series at all. In other words, we will be interested in whether or not *all*** **autocorrelations up to some lag are 0. The most common case arises when evaluating the results of a model, such as an ARIMA model.

ARIMA models require that prediction errors (or residuals) are **independent and identically distributed (IID)** with a constant mean and variance, i.e., white noise. In this definition, independent means that the residuals are not serially correlated. If an ARIMA model is not producing this type of residual, it fails to capture all the underlying patterns in the data. In this lesson, we will go through some tests that will let us assess if our data is autocorrelated.

Get hands-on with 1400+ tech skills courses.