4.8.10.1.6. statsmodels.tsa.varma_process.varfilter

statsmodels.tsa.varma_process.varfilter(x, a)[source]

apply an autoregressive filter to a series x

Warning: I just found out that convolve doesn’t work as I
thought, this likely doesn’t work correctly for nvars>3

x can be 2d, a can be 1d, 2d, or 3d

Parameters:

x : array_like

data array, 1d or 2d, if 2d then observations in rows

a : array_like

autoregressive filter coefficients, ar lag polynomial see Notes

Returns:

y : ndarray, 2d

filtered array, number of columns determined by x and a

Notes

In general form this uses the linear filter

y = a(L)x

where x : nobs, nvars a : nlags, nvars, npoly

Depending on the shape and dimension of a this uses different Lag polynomial arrays

case 1
: a is 1d or (nlags,1)
one lag polynomial is applied to all variables (columns of x)
case 2
: a is 2d, (nlags, nvars)
each series is independently filtered with its own lag polynomial, uses loop over nvar
case 3
: a is 3d, (nlags, nvars, npoly)

the ith column of the output array is given by the linear filter defined by the 2d array a[:,:,i], i.e.

y[:,i] = a(.,.,i)(L) * x
y[t,i] = sum_p sum_j a(p,j,i)*x(t-p,j)
         for p = 0,...nlags-1, j = 0,...nvars-1,
         for all t >= nlags

Note: maybe convert to axis=1, Not

TODO: initial conditions