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?
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.)
This then leads to nonlinearity_test in lib/src/compare.c, where it says:
"Run an auxiliary regression to test @pmod for nonlinearity, via the
addition of either squares or logs of the original indepdendent variables."
OK, so that's easy enough to understand. At the bottom of the 'modtest'
reference I'm also reminded that 'reset' is a different command, so
there is some thematic overlap there.
Furthermore, it suggests that those tests only apply to ols
estimation,
but my idea was to run a check after an ARMA model. Perhaps we could try
to implement something that works there?
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.
In the more distant future it might also be an idea to consider this
modification:
https://doi.org/10.1016/j.spl.2020.108794
cheers
sven