nls2.control - Control User's Options for nls2
On to:
DESCRIPTION
COMPONENTS
NOTES
SEE-ALSO
EXAMPLE
DESCRIPTION:
The control
argument of function nls2
allows to choose
which results are printed or saved and when.
It gives also the
possibility of stopping the execution when too many warnings appear.
It is a list:
list(freq=-1,
fitted=T, est.eq=F, estim=T,
deriv.fct=F, iter=T, num.res=T, odes=T,
sv.steps=seq(1, nls2.object$nb.steps),
sv.fitted=T, sv.as.var=T, sv.B.varZ.B=T,
sv.correlation=T, sv.data=T, sv.est.eq=T,
sv.estim=T, sv.deriv.fct=T, sv.mu=T,
sv.residuals=T, sv.num.res=T, sv.odes=T, sv.W=T, sv.Z=T,
it.steps=NULL,
it.fitted=F, it.est.eq=F, it.estim=F,
it.deriv.fct=F, it.iter=F, it.num.res=F, it.odes=F,
meth.warn=30, num.warn=30, anal.warn=30, integ.warn=30, all.warn=30,
lg.trace=0)
COMPONENTS:
-
To control the output:
freq
-
value to control the frequency of the intermediate
printings, and, also of the
intermediate savings.
Scalar equal to 0 if no results should be printed or saved,
equal to -1 if results should be printed or saved at the first
and at the last iterations of the iterative process, and
equal to "n", "n" being a positive integer value,
if results should be printed or saved at the first,
at the last and every "n" iterations.
By default, "freq=-1" (printing at the first and last iterations).
-
For controlling what is printed,
-
the following components can be used.
These components are logics that should be TRUE if the associated
results are to be printed.
"fitted": the fitted values of the regression and of the variance functions.
"est.eq": the elements of the estimating equation.
"estim": the estimated values of the multiple parameters.
"deriv.fct": the derivatives of the regression function
and the derivatives of the variance function
with respect to the active parameters.
"iter": the iteration indexes.
"num.res": the direction, the optimal step, the parameter
of the Gauss-Marquardt algorithm, the square value of sigma,
the stopping criterion. the fitting criterion.
"odes": when the model is described by a differential equation system,
the values of this system.
By default, all components are set to TRUE apart from "est.eq" and "deriv.fct".
To control the results stored in the
nls2.object:
-
the components with prefix "sv."
-
To choose the results
returned in the
nls2.object,
use the components with prefix "sv."
By default, all components are T, i.e all results are returned.
careful:
the other functions which have a nls2.object
as argument may need some results;
for example,
plres.nls2 fails if the residuals are not present.
"sv.data": the vector of replications and the
data.stat
component
"sv.fitted": the fitted values of the regression and of the variance functions.
"sv.as.var": the asymptotic variance
"sv.correlation": the correlation matrix
"sv.B.varZ.B": the product:
"transposed B * variance of Z * B"
divided by the number of observations, replications included if any.
(See the `nls2 Reference Manual').
"sv.est.eq": the elements of the estimating equation.
"sv.estim": the estimated values of the multiple parameters.
"sv.deriv.fct": the derivatives of the regression function
and the derivatives of the variance function
with respect to the active parameters.
"sv.mu": the moments of order 3 and 4
"sv.residuals": the residuals and the standardized residuals
"sv.num.res": the direction, the optimal step and the parameter
of the Gauss-Marquardt algorithm, the square value of sigma, the
stopping and fitting criterions, the residual sum of squares and the
non-weighted residual sum of squares.
"sv.odes": when the model is described by a differential equation system,
the values of this system.
"sv.W":
the product: "transposed B * D" divided by the number of observations, replications included if any.
"sv.Z": the exhaustive statistics
(See the `nls2 Reference Manual').
See NOTES.
- sv.steps
-
in case of estimation by several steps,
integer or vector of integers which
specifies the steps for which results should be returned in the
nls2.object.
By default, all results of all steps are returned.
To control the saving of intermediate results:
Intermediate results can be stored in
nls2.object
by using the components with prefix "it.".
- it.steps
-
if intermediate results should be saved,
must be equal to 1 in non-alternated estimation,
and otherwise, must a scalar or a vector that contains
the indexes of the steps when saving is required.
By default, no saving.
- the other components with prefix "it."
-
They allow to choose which intermediate results should be saved.
Same as the print options.
The default value, when the argument `it.steps' is present, is:
"it.iter=T, it.num.res=T".
Otherwise, the default is no saving.
To control the warnings and errors:
-
meth.warn,num.warn,anal.warn,integ.warn,all.warn:
-
the maximum numbers of occurrences of the
methodological, numerical, analyser, integrator
warnings and of warnings of any type.
Execution terminates with an error
when any of these numbers is reached.
Default value: 30
See also the paragraph `NOTES'.
- lg.trace
-
this component may be useful in case of wrong execution to
help the maintenance staff for debugging.
If "lg.trace=n", the names of the "n"
last programs that are called by the function
appear.
By default, when the "check" option of the S-session is TRUE and when
execution
terminates badly, a trace appears with a length equal to 15.
NOTES:
About the "sv." components:
-
Whatever is the value of the "sv." components, the nls2.object
contains :
-
WHAT HAPPENED DURING THE ESTIMATION PROCESS,
-
THE ESTIMATION CONTEXT,
replications and data.stat excepted,
- nb.iters,
stat.crit.type, stat.crit.code,
method ,
nh,
effic, W.type.
-
To use the function renls2
on the nls2.object,
the list
should contain
sv.estim=T, sv.fitted=T, sv.data=T at least
or not be set.
-
To use the function plvar,
it should contain
sv.estim=T, sv.fitted=T, sv.data=T, sv.num.res=T.
-
To use the function plres,
it should contain
sv.fitted=T, sv.data=T, sv.rss=T
-
To use the function plfit,
it should contain
sv.estim=T, sv.fitted=T, sv.data=T.
-
To use the function bootstrap,
it should contain
sv.estim=T, sv.fitted=T, sv.data=T, sv.num.res=T, sv.as.var=T.
Except when the 'method' argument of bootstrap is 'param',
it should contain also sv.residuals.
-
To use the function calib,
it should contain
sv.estim=T, sv.fitted=T, sv.data=T, sv.num.res=T, sv.as.var=T, sv.residuals=T.
-
To use the function wald,
it should contain
sv.estim=T, sv.as.var=T.
-
To use the function confidence,
it should contain
esv.stim=T, sv.as.var=T, sv.num.res=T, sv.data=T.
-
To use the function ellips,
it should contain
esv.stim=T, sv.as.var=T.
About the warnings:
-
The "warn" option of the S-session controls the warning outputs;
for example, The S command "options(warn=-1)" suppresses
all the warnings.
-
When the option "check" of the S-session is TRUE,
the warning messages appear in a longer form: some
additional explanations are given to the user.
SEE ALSO:
`nls2'.
EXAMPLE:
Example 1: estimation in 3 steps.
# Warning messages of nls2 will appear in a long form:
options(check=T)
# The intermediate results kept by default are saved
# every 5 iterations for each of the steps. Therefore,
# the intermediate results printed by default will
# appear automatically with the same frequency.
crole<- list(freq=5, it.steps=c(1,2,3))
nls2(..., control=crole, ...)
Example 2: all intermediate printings are suppressed.
# Warning messages will not appear:
options(warn=-1)
nls2(..., control= list(freq=0), ...)
Creation: 2001 -