El mar, 26-01-2010 a las 10:42 +0100, Riccardo (Jack) Lucchetti
escribió:
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?
Not really. We have to put something in the default and I suppose the
mean of the whole series is a correct posibility for stationary data.
I was trying to replicate the smoothed series in Granger's (1989) book
"Forecasting in Business and Economics" (table 2.2 in page 25). In page
27 he proposed the filter (x_t is the original series, y_t is the
filtered series)
y_1=x_1, y_t=k y_t-1 + (1-k)x_t, t=2,...n.
"The larger the value of k, the greater the smoothing achieved. Typical
appropiate values for k would be 0.7 for monthly data, 0.5 for quarterly
data, and 0.3 for a series recorded annually. The smoothed consumption
series, with k=0.3 has been shown in table 2.2".
I can see that the "Weight on current observation" in the gretl dialog
box corresponds to (1-k), and setting this to 0.7 and the tickmark on
"the first EMA value is" pointing to "the mean of the first n
observations" (with n=1), I obtain exactly the same values in the book
but with a displacement one period ahead.
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.ea3.ehu.es