On Mon, 11 Jun 2018, Allin Cottrell wrote:
> 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)
Hmm, doesn't that give you
y_t = a y_{t-1} + b0 epsilon_t + b1 epsilon_{t-1}
ah sorry, you're right, wrong example; what I meant was
y_t = a y_{t-1} + b0 x_t + b1 x_{t-1}
and
series y = filter(x, {b0, b1}, a)
Using filter() to achieve what I had originally described is awkward. The
best thing I can think of is
series y = a * y(-1) + filter(x, {b0, b1}) + epsilon
>> 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
True. But my "awkward" case was in effect y_t = a y_{t-1} + k, which would I
think require
y = filter(u, 0, a) + k
if one wishes to avoid
y = filter(y, a) + k # "x" = "y"
or possibly
y = filter(const, k, a)
but I agree this is a bit of a hack
Not that it's necessary to avoid the latter once one sees that it
works fine.
Anyway, I'm happy to withdraw my objection (if that's what it was). Filter
can certainly do the job once you get your head around it.
-------------------------------------------------------
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
-------------------------------------------------------