Index: adf_kpss.c =================================================================== RCS file: /cvsroot/gretl/gretl/lib/src/adf_kpss.c,v retrieving revision 1.128 diff -u -w -r1.128 adf_kpss.c --- adf_kpss.c 23 Jun 2015 15:03:53 -0000 1.128 +++ adf_kpss.c 30 Jun 2015 20:15:59 -0000 @@ -488,7 +488,8 @@ if (!na(F)) { pprintf(prn, " %s: F(%d, %d) = %.3f [%.4f]\n", - _("lagged differences"), order, pmod->dfd, F, + _("lagged diff exclusion test"), + order, pmod->dfd, F, snedecor_cdf_comp(order, pmod->dfd, F)); } @@ -527,26 +528,29 @@ if (p <= 0 && pmax == 0) { if (opt & OPT_G) { - pprintf(prn, _("Dickey-Fuller (GLS) test for %s\n"), s); + pprintf(prn, _("%s: Dickey-Fuller (GLS) test\n"), s); } else { - pprintf(prn, _("Dickey-Fuller test for %s\n"), s); + pprintf(prn, _("%s: Dickey-Fuller test\n"), s); } } else { if (opt & OPT_G) { - pprintf(prn, _("Augmented Dickey-Fuller (GLS) test for %s\n"), s); + pprintf(prn, _("%s: Augmented Dickey-Fuller (GLS) test\n"), s); } else { - pprintf(prn, _("Augmented Dickey-Fuller test for %s\n"), s); + pprintf(prn, _("%s: Augmented Dickey-Fuller test\n"), s); } - if (p == 1) { - pprintf(prn, _("including one lag of (1-L)%s"), s); + if (p <= 0) { + pputs(prn, _("without lagged differences")); + } else if (p == 1) { + pprintf(prn, _("including one lag of diff(%s)"), s); } else { - pprintf(prn, _("including %d lags of (1-L)%s"), p, s); + pprintf(prn, _("including %d lags of diff(%s)"), p, s); } + if (pmax >= p) { const char *critstr = test_down_string(test_down, opt); pputc(prn, '\n'); - pprintf(prn, _("(max was %d, criterion %s)"), + pprintf(prn, _("(max lag was %d, criterion %s)"), pmax, critstr); } pputc(prn, '\n'); @@ -556,10 +560,10 @@ static const char *DF_model_string (int i) { const char *models[] = { - "(1-L)y = (a-1)*y(-1) + e", - "(1-L)y = b0 + (a-1)*y(-1) + e", - "(1-L)y = b0 + b1*t + (a-1)*y(-1) + e", - "(1-L)y = b0 + b1*t + b2*t^2 + (a-1)*y(-1) + e" + "diff(y) = (a-1)*y(-1) + res", + "diff(y) = cnst + (a-1)*y(-1) + res", + "diff(y) = cnst + b1*t + (a-1)*y(-1) + res", + "diff(y) = cnst + b1*t + b2*t^2 + (a-1)*y(-1) + res" }; if (i >= 0 && i < 4) { @@ -572,10 +576,10 @@ static const char *ADF_model_string (int i) { const char *models[] = { - "(1-L)y = (a-1)*y(-1) + ... + e", - "(1-L)y = b0 + (a-1)*y(-1) + ... + e", - "(1-L)y = b0 + b1*t + (a-1)*y(-1) + ... + e", - "(1-L)y = b0 + b1*t + b2*t^2 + (a-1)*y(-1) + ... + e" + "diff(y) = (a-1)*y(-1) + ... + res", + "diff(y) = cnst + (a-1)*y(-1) + ... + res", + "diff(y) = cnst + b1*t + (a-1)*y(-1) + ... + res", + "diff(y) = cnst + b1*t + b2*t^2 + (a-1)*y(-1) + ... + res" }; if (i >= 0 && i < 4) { @@ -588,8 +592,8 @@ static const char *DF_test_string (int i) { const char *tests[] = { - N_("test without constant"), - N_("test with constant"), + N_("without constant"), + N_("with constant"), N_("with constant and trend"), N_("with constant and quadratic trend") }; @@ -608,7 +612,7 @@ const char *urcstrs[] = { "nc", "c", "ct", "ctt" }; - char pvstr[48]; + char pvstr[80]; // was 48 char taustr[16]; int i; @@ -622,36 +626,41 @@ } else { int asy = (ainfo->order > 0 || (opt & OPT_G)); - sprintf(pvstr, "%s %.4g", + sprintf(pvstr, "%-22s = %7.4f\n %-.34s", (asy)? _("asymptotic p-value") : _("p-value"), - ainfo->pval); + ainfo->pval, + "---------------------------------------"); } if (*blurb_done == 0) { DF_header(ainfo->vname, ainfo->order, ainfo->kmax, test_down, opt, prn); - pprintf(prn, _("sample size %d\n"), ainfo->T); + pprintf(prn, _("sample size: %d\n"), ainfo->T); if (ainfo->flags & ADF_PANEL) { pputc(prn, '\n'); } else { - pputs(prn, _("unit-root null hypothesis: a = 1")); - pputs(prn, "\n\n"); + pputs(prn, _("(H0: unit-root, a = 1)\n")); + pputs(prn, " \n"); } *blurb_done = 1; } + // only if no Engle-Granger test + if ( !(ainfo->flags & ADF_EG_RESIDS) ) { + pprintf(prn, "%s", _(DF_test_string(i))); + if (ainfo->nseas > 0 && i > 0) { + pputs(prn, _(" plus seasonal dummies")); + } + pputs(prn, ":\n"); + } + if (ainfo->flags & ADF_EG_RESIDS) { /* last step of Engle-Granger test */ pprintf(prn, " %s: %s\n", _("model"), (ainfo->order > 0)? ADF_model_string(0) : DF_model_string(0)); } else { - pprintf(prn, " %s ", _(DF_test_string(i))); - if (ainfo->nseas > 0 && i > 0) { - pputs(prn, _("plus seasonal dummies")); - } - pputc(prn, '\n'); - pprintf(prn, " %s: %s\n", _("model"), + pprintf(prn, "( %s )\n", (ainfo->order > 0)? ADF_model_string(i) : DF_model_string(i)); } @@ -662,10 +671,11 @@ sprintf(taustr, "tau_%s(%d)", urcstrs[i], ainfo->niv); } - pprintf(prn, " %s: %g\n" - " %s: %s = %g\n", - _("estimated value of (a - 1)"), ainfo->b0, - _("test statistic"), taustr, ainfo->tau); + pprintf(prn, " %-.34s\n %-22s = %9.6f\n" + " %-s: %-11s = %7.4f\n", + "--------------------------------------------", + _("estimated a-1"), ainfo->b0, + _("test stat"), taustr, ainfo->tau); if ((opt & OPT_G) && i+1 == UR_TREND) { double c[4]; @@ -680,13 +690,14 @@ } if (!na(dfmod->rho)) { - pprintf(prn, " %s: %.3f\n", _("1st-order autocorrelation coeff. for e"), + pprintf(prn, " %s: %.3f\n", _("1st-order residual autocorr"), dfmod->rho); } if (ainfo->order > 1) { show_lags_test(dfmod, ainfo->order, prn); } + // pputs(prn, " ------------------------------------\n"); } /* test the lag order down using the t-statistic criterion */