On Sat, 27 Feb 2021, Sven Schreiber wrote:
Am 23.02.2021 um 10:23 schrieb Sven Schreiber:
> In the command reference for "modtest" I see two options labeled
"--logs
> (nonlinearity, logs)" and "--squares (nonlinearity, squares)". But
the
> description doesn't provide more information apart from being a LM-type
> test. Is there more information somewhere?
Just for the record I'd say it's pretty obvious what the logs and
squares LM tests do, if you run an example. The tests take the form
of an auxiliary regression with dependent variable the OLS residual
and independent variables the original regressors plus their logs or
squares. The statistic takes the form of n*R-squared from this
regression, which is distributed as chi-square with df = the number
of added regressors under the null that the original specification
is adequate ("linearity"). This is all clear from the output.
OK, so I went hunting in the C source. First I found do_modtest in
gui/library.c.
(Side remark: At the top of the file it says "library.c for gretl --
main interface to libgretl functions", so I don't understand why it
lives under "gui" in the source tree. A hansl batch script on the CLI
would also seem to use this.)
In that context "gretl" means the GUI program, as opposed to
gretlcli. The CLI programs gretlcli and gretlmpi have their own
interfaces to libgretl, which have to differ in various ways.
Nothing but the GUI program uses, or could use, gui/library.c.
I guess it would be useful if we could include the popular BDS test:
Brock, Dechert and Scheinkman (1987) (and later published as Brock,
Dechert, Scheinkman and LeBaron, 1996; apparently there is some C code
by LeBaron from 1997, LeBaron, B.(1997). “A Fast Algorithm for the BDS
Statistic”, Studies in Nonlinear Dynamics and Econometrics, 2, 53-59,
but maybe not necessary?)
Getting a hansl prototype is not too difficult per se, but there are
some other input parameters for the test which are somewhat arbitrary it
seems.
Could be worthwhile, but it would be nice to know how best to select
the "somewhat arbitrary" parameters. In addition it's not clear to
me what guidance one can get from a rejection on the BDS test, other
than just "there's something nonlinear going on". But closer study
might be rewarded.
Allin