MATLAB Examples

# Autoregressive Model

This example shows how to compute and plot the impulse response function for an autoregressive (AR) model. The AR(p) model is given by

where is a -degree AR operator polynomial, .

An AR process is stationary provided that the AR operator polynomial is stable, meaning all its roots lie outside the unit circle. In this case, the infinite-degree inverse polynomial, , has absolutely summable coefficients, and the impulse response function decays to zero.

## Step 1. Specify the AR model.

Specify an AR(2) model with coefficients and .

modelAR = arima('AR',{0.5,-0.75}); 

## Step 2. Plot the impulse response function.

Plot the impulse response function for 30 periods.

impulse(modelAR,30) 

The impulse function decays in a sinusoidal pattern.