tsa.arima_process.arma_impulse_response()

statsmodels.tsa.arima_process.arma_impulse_response

statsmodels.tsa.arima_process.arma_impulse_response(ar, ma, nobs=100) [source]

get the impulse response function (MA representation) for ARMA process

Parameters:

ma : array_like, 1d

moving average lag polynomial

ar : array_like, 1d

auto regressive lag polynomial

nobs : int

number of observations to calculate

Returns:

ir : array, 1d

impulse response function with nobs elements

Notes

This is the same as finding the MA representation of an ARMA(p,q). By reversing the role of ar and ma in the function arguments, the returned result is the AR representation of an ARMA(p,q), i.e

ma_representation = arma_impulse_response(ar, ma, nobs=100) ar_representation = arma_impulse_response(ma, ar, nobs=100)

fully tested against matlab

Examples

AR(1)

>>> arma_impulse_response([1.0, -0.8], [1.], nobs=10)
array([ 1.        ,  0.8       ,  0.64      ,  0.512     ,  0.4096    ,
        0.32768   ,  0.262144  ,  0.2097152 ,  0.16777216,  0.13421773])

this is the same as

>>> 0.8**np.arange(10)
array([ 1.        ,  0.8       ,  0.64      ,  0.512     ,  0.4096    ,
        0.32768   ,  0.262144  ,  0.2097152 ,  0.16777216,  0.13421773])

MA(2)

>>> arma_impulse_response([1.0], [1., 0.5, 0.2], nobs=10)
array([ 1. ,  0.5,  0.2,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ])

ARMA(1,2)

>>> arma_impulse_response([1.0, -0.8], [1., 0.5, 0.2], nobs=10)
array([ 1.        ,  1.3       ,  1.24      ,  0.992     ,  0.7936    ,
        0.63488   ,  0.507904  ,  0.4063232 ,  0.32505856,  0.26004685])

© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.tsa.arima_process.arma_impulse_response.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部