Time Series analysis AR process Vs IIR filters

A time series is a sequence of data points collected at regular time intervals. Time series data is typically analyzed to understand trends, patterns, and relationships over time. Time series analysis is used in forecasting. For example: Forecasting stock prices, Forecasting weather etc.

An Auto Rregressive (Auto -Self, Regressive – Moving back) process is a type of statistical model. It is used to describe a time series as a linear combination of its past values and white noise. An AR process is defined by a set of coefficients that determine how much each past value contributes to the current value of the time series.

The equation for an AR(p) process, where p is the order of the process, is given by:

y[n] = c + b[1]*y[n-1] + … + b[p]*y[n-p] + e[n]

where y[n] is the value of the time series at time n, c is a constant term, b[1] through b[p] are the AR coefficients, and e[n] is white noise.

An IIR (Infinite impulse response) filter is a type of digital filter that can be used to process signals in order to remove noise or extract useful information. It works by applying a set of coefficients to the input signal to produce an output signal.

The equation for an infinite impulse response (IIR) filter is given by:

y[n] = b[0]*x[n] + b[1]*x[n-1] + … + b[M]*x[n-M] – a[1]*y[n-1] – … – a[N]*y[n-N]

where x[n] and y[n] are the input and output signals at time n, and b[0] through b[M] and a[1] through a[N] are the filter coefficients.

By looking at the above equations, one can notice similarities and relationship between them can be determined. IIR filters and AR processes are similar in the sense that an IIR filter can be implemented using an AR process by setting the filter coefficients equal to the AR model coefficients. See below given Python code example and output.

RMSE of AR model: 0.0770
RMSE of IIR filter: 0.2588

Cheers

~~Dheeraj