On Mon, 11 Jun 2018, Allin Cottrell wrote:
The filter() function is certainly nice to have, but I can't help
thinking
it's kinda backwards, and hence less intuitive than it could be -- or is it
just me?
Allow me to establish notation: let's say what you want to generate is
A(L) y_t = B(L) x_t
This function offers "an ARMA-like filtering of the argument
x", but
what's naturally interpreted as the MA part comes first and is obligatory
while the AR part is second and optional.
If I remember correctly, this is a consequence of the fact that the
"driver" series must have some kind of impact on the result, so the MA
polynomial B(L) cannot be empty, and therefore it seems natural that
something _has_ to be there, while the same is not true for the A(L)
polynomial (when you want some kind of moving average).
For example, using filter() for generating data for an ARDL model is quite
easy: if you have
y_t = a y_{t-1} + b0 x_t + b1 x_{t-1} + epsilon_t
you just use
series y = filter(epsilon, {b0, b1}, a)
You can of course use it to construct a pure AR series but that
requires
"pretending" that y is x, so to speak.
well, you could just use "1" for the middle argument, as in
y = filter(u, 1, phi)
for y_t = \phi y_{t-1} + u_t
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------