likelihood-ratio testing functions have a debug.
argument whose effect depends on the simuland
function. The default behaviour is thus defined by eval_replicate
, as: if debug.=TRUE
, upon error in the fitting procedures, dump.frames
will be called, in which case a dump file will be written on disk; and a list with debugging information will be returned (so that, say, pbapply
will not return a matrix). This behaviour may change in later versions, so non-default debug.
values should not be used in reproducible code. In serial computation, debug.=2
may induce a stop
; this should not happen in parallel computation because the calling functions check against debug.==2
.
Essential information such as the originally fitted models is passed to the function not as arguments but through its environment, which is controlled by the calling functions (see the eval_replicate
source code to know which are these arguments). Users should thus not assume that they can control their own simuland
function's environment as this environment will be altered.
Advanced users can define their own simuland
function. The eval_replicate
source code provides a template showing how to use the function's environment. The Example below illustrates another approach augmenting eval_replicate
. A further example is provided in the file
tests/testthat/test-LRT-boot.R
, using ... to pass additional arguments beyond response values.