This patch fixes a couple of issues with fracdiff: first, the first
observation needn't be discarded, cause fractional differencing is
performed by truncating what is an infinite polynomial anyway. Second,
fracdiff now deals more nicely with missing values at the beginning of a
sample.
Index: lib/src/generate.c
===================================================================
RCS file: /cvsroot/gretl/gretl/lib/src/generate.c,v
retrieving revision 1.234
diff -u -r1.234 generate.c
--- lib/src/generate.c 2 May 2005 14:55:26 -0000 1.234
+++ lib/src/generate.c 3 May 2005 11:15:59 -0000
@@ -3167,8 +3167,6 @@
DPRINTF(("Doing get_fracdiff, with d = %g\n", d));
- if (t1 == 0) t1 = 1;
-
err = series_adjust_t1t2(y, &t1, &t2);
if (err) {
return E_DATA;
@@ -3185,7 +3183,7 @@
}
for (dd=1; dd<=T && fabs(phi)>TOL; dd++) {
- for (t=dd; t<=t2; t++) {
+ for (t=t1+dd; t<=t2; t++) {
if (t >= t1) {
diffvec[t] += phi * y[t - dd];
}
Riccardo `Jack' Lucchetti
Dipartimento di Economia
Università di Ancona
jack(a)dea.unian.it
http://www.econ.unian.it/lucchetti