Am 13.05.2021 um 14:47 schrieb riles(a)triton.net:
The following code produces this error "Data error"
int list[2] = {1,0};
int kpss_error = ::kpss_test(2,list,dset,OPT_N,prn);
if (kpss_error!=0) {
errmsg(adf_error, prn);
}
When I use the same data set in the GUI everything works just fine.
From what I can tell it seems like the problem is because of 0 in list[2] = {1,0};
or int list[13] = {12,0,1,2,3,4,5,6,7,8,9,10,11};
If "list" in this
context means something comparable to the list object
at the hansl level, then index 0 refers to the constant term, and this
wouldn't make sense to run a kpss test on. (Even though for gretl
scripting everything is 1-based, but the const is definitely number 0.)
,,,
The error comes from the following lines in (line 2097)static int
real_kpss_test(int order, int varno, DATASET *dset,gretlopt opt, kpss_info *kinfo, PRN
*prn)
(line 2114) if (varno <= 0 || varno >= dset->v) {
return E_DATA;
}
were varno is set at (line 2435) in the kpss_test(....) function
This looks consistent with my previous interpretation, only try to run
the test on regular variables/series.
As always with the C level, not 100% sure, though ;-)
cheers
sven