# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# impulse

Class: arima

Impulse response function

## Syntax

impulse(Mdl)impulse(Mdl,numObs)Y = impulse(___)

## Description

impulse(Mdl) plots a discrete stem plot of the impulse response function for the univariate ARIMA model, Mdl, in the current figure window.

impulse(Mdl,numObs) plots the impulse response function for numObs periods.

Y = impulse(___) returns the impulse response in a column vector for any of the previous input arguments.

## Input Arguments

 Mdl ARIMA model, as created by arima or estimate. numObs Positive integer indicating the number of observations to include in the impulse response (the number of periods for which impulse computes the impulse response). When you specify numObs, impulse computes the impulse response by filtering a unit impulse followed by a vector of zeros of appropriate length. The filtering algorithm is very fast and results in an impulse response of known length. If you do not specify numObs, impulse determines the number of observation using the polynomial division algorithm of the underlying lag operator polynomials, mldivide.

## Output Arguments

 Y Column vector of impulse responses. If you specify numObs, then Y is numObs-by-1. If you do not specify numObs, the underlying lag operator polynomial division algorithm returns an impulse response of generally unknown length.

## Examples

expand all

Specify the AR(2) model,

 
Mdl = arima('AR',{0.5,-0.7},'Constant',0) 
Mdl = ARIMA(2,0,0) Model: -------------------- Distribution: Name = 'Gaussian' P: 2 D: 0 Q: 0 Constant: 0 AR: {0.5 -0.7} at Lags [1 2] SAR: {} MA: {} SMA: {} Variance: NaN 

Plot the impulse response function without specifying the number of observations.

impulse(Mdl) 

The model is stationary; the impulse response function decays in a sinusoidal pattern.

Specify the ARMA(1,1) model,

 
Mdl = arima('AR',0.7,'MA',0.2,'Constant',0) 
Mdl = ARIMA(1,0,1) Model: -------------------- Distribution: Name = 'Gaussian' P: 1 D: 0 Q: 1 Constant: 0 AR: {0.7} at Lags [1] SAR: {} MA: {0.2} at Lags [1] SMA: {} Variance: NaN 

Store the impulse response function for 15 periods.

Y = impulse(Mdl,15) 
Y = 1.0000 0.9000 0.6300 0.4410 0.3087 0.2161 0.1513 0.1059 0.0741 0.0519 0.0363 0.0254 0.0178 0.0125 0.0087 

When you specify the number of observations, you know the length of the output impulse response series.

expand all

## Tips

• To improve performance of the filtering algorithm, specify the number of observations to include in the impulse response, numObs. When you do not specify numObs, impulse computes the impulse response by converting the input model to a truncated, infinite-degree, moving average representation using the relatively slow lag operator polynomial division algorithm. This results in an impulse response of generally unknown length.

## References

[1] Box, G. E. P., G. M. Jenkins, and G. C. Reinsel. Time Series Analysis: Forecasting and Control 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.

[2] Enders, W. Applied Econometric Time Series. Hoboken, NJ: John Wiley & Sons, 1995.

[3] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

[4] Lütkepohl, H. New Introduction to Multiple Time Series Analayis. New York, NY: Springer-Verlag, 2007.