On Tue, 26 Jan 2010, Ignacio Diaz-Emparanza wrote:
I think there is some bug in the exponential MA filter
of gretl (Variable/filter/exponential MA).
I tried it with the Ct data in data3-6.gdt. If I ask for the filter with
the default options, including "weight on current observation = 0.100"
the graph produced is very strange (a parabola) and if I ask to save the
series, in the description of the saved series appears the text
"Exponential moving average of Ct (current weight 0.9)".
I tried writing 0.9 in the "weight on current observation" and the
resulting graph is rather more logic, but the series seems to be placed
one period ahead.
If you try the following
<script>
open data3-6.gdt
series foo = mean(Ct)
series foo = 0.9*foo(-1) + 0.1*Ct
</script>
and compare foo with the automatically-generated series, you'll see two
things: one, you're right about the time displacement. Two, the parabola
effect is a consequence of initialising the EWMA with the sample mean,
which of course produces strange results with a trending series such as Ct
in your example. Do you have a better idea?
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti