The function is written from the scratch. The result has been
compared against the 'Matlab' filter function with one-dimensional
real inputs. Other situations such as matrix b or multi-dimensional
x are not implemented. For double filters (forward-backward),
see filtfilt.
Arguments
- b
one-dimensional real numerical vector, the moving-average coefficients of an
ARMAfilter- a
the auto-regressive (recursive) coefficients of an
ARMAfilter- x
numerical vector input (real value)
- z
initial condition, must have length of
n-1, wherenis the maximum of lengths ofaandb; default is all zeros