apply an autoregressive filter to a series x
x can be 2d, a can be 1d, 2d, or 3d
Parameters : | x : array_like
a : array_like
|
---|---|
Returns : | y : ndarray, 2d
|
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
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
All filtering is done with scipy.signal.convolve, so it will be reasonably fast for medium sized arrays. For large arrays fft convolution would be faster.
Note: maybe convert to axis=1, Not