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
ARMA
filter- a
the auto-regressive (recursive) coefficients of an
ARMA
filter- x
numerical vector input (real value)
- z
initial condition, must have length of
n-1
, wheren
is the maximum of lengths ofa
andb
; default is all zeros