nlsj.control: Control the Iterations in nlsj

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/nlsjcontrol.R

Description

Allow the user to set some characteristics of the nls nonlinear least squares algorithm.

Usage

1
2
3
4
5
6
7
nlsj.control(maxiter = 500, tol = 0.00001, minFactor = 1/1024,
	printEval = FALSE, warnOnly = FALSE, scaleOffset = 0,
    nDcentral = FALSE, watch = FALSE, phi = 1, lamda = 0, 
	offset = 100, laminc = 10, lamdec = 0.4, resmax = 10000, 
	rofftest = TRUE, smallsstest = TRUE,
	derivmeth="numericDeriv", altderivmeth="numericDeriv",
	trace=FALSE)

Arguments

maxiter

A positive integer specifying the maximum number of iterations allowed.

tol

A positive numeric value specifying the tolerance level for the relative offset convergence criterion.

minFactor

A positive numeric value specifying the minimum step-size factor allowed on any step in the iteration. The increment is calculated with a Gauss-Newton algorithm and successively halved until the residual sum of squares has been decreased or until the step-size factor has been reduced below this limit.

printEval

a logical specifying whether the number of evaluations (steps in the gradient direction taken each iteration) is printed.

warnOnly

a logical specifying whether nls() should return instead of signalling an error in the case of termination before convergence. Termination before convergence happens upon completion of maxiter iterations, in the case of a singular gradient, and in the case that the step-size factor is reduced below minFactor.

scaleOffset

a constant to be added to the denominator of the relative offset convergence criterion calculation to avoid a zero divide in the case where the fit of a model to data is very close. The default value of 0 keeps the legacy behaviour of nls(). A value such as 1 seems to work for problems of reasonable scale with very small residuals.

nDcentral

only when numerical derivatives are used: logical indicating if central differences should be employed, i.e., numericDeriv(*, central=TRUE) be used.

watch

If TRUE, allows iterations to be interactive. Default = FALSE. NOT currently active.

phi

Number to use in a diagonal added to the augmented J' J Marquardt matrix in the Nash-Marquardt stabilization of the Gauss-Newton algorithm. Default = 1

lamda

Initial value for the lamda parameter used in Levenberg-Marquardt stabilization (note false spelling of lambda as a historical artifact that often detects copying). When zero, the Gauss-Newton method is used. ?? May need to coordinate with algorithm parameter of nlsj()

offset

Number to use in a tolerance-free comparison of two numbers. Default = 100. Items a and b are taken as equal if (a + offset) == (b + offset).

laminc

Factor to use to increase the Marquardt lamda parameter. Default = 10

lamdec

Factor to use to decrease the Marquardt lamda parameter. Default = 0.4

resmax

Maximum number of residual evaluations allowed. Not used in nls(). Default 10000 suggested is likely too big for general use.

rofftest

When TRUE (default), use the relative offset convergence criterion, modified if appropriate with scaleOffset to deal with small residuals.

smallsstest

TRUE if we check for a very small sum of squares as an indicator for terminating the iterations. nls() only uses the relative offset test, and then only with scaleOffset=0.0. Nevertheless, suggest default of TRUE.

derivmeth

The method to computer derivatives for the Jacobian. To mimic nls(), this defaults to "numericDeriv".

altderivmeth

An alternate derivative method if "derivmeth" is infeasible, e.g., if derivmeth is "default" (analytic), then the alternative "numericDeriv" would call that routine. In future, there may be other methods.??

trace

When TRUE, allows progress information to be printed. ?? NEED to coordinate with argument "trace". Default=FALSE)

Value

A list with components

maxiter
tol
minFactor
printEval
warnOnly
scaleOffset
nDcentreal
watch
phi
lamda
offset
laminc
lamdec
resmax
rofftest
smallsstest
derivmeth
altderivmeth
trace

with meanings as explained under ‘Arguments’.

Author(s)

Douglas Bates and Saikat DebRoy; John C. Nash for extensions made in the 2020 Improvements to nls() Google Summer of Code project with Arkajyoti Bhattacharjee.

References

Bates, D. M. and Watts, D. G. (1988), Nonlinear Regression Analysis and Its Applications, Wiley.

See Also

nls

Examples

1
nlsj.control(minFactor = 1/2048)

ArkaB-DS/nlsj documentation built on Dec. 17, 2021, 9:43 a.m.