nls
,
with sensible starting parameters obtained from either nls.lm
(default) or optim
.pcrfit(data, cyc = 1, fluo, model = l4, do.optim = TRUE,
opt.method = "LM", nls.method = "port",
start = NULL, robust = FALSE, control = nls.control(),
weights = NULL, ...)
FALSE
, refinement of starting values by nls.lm
or optim
will be skipped.nls
. Default is "port"
, which works quite well.TRUE
, robust nonlinear regression is used. See 'Details'.nls
or qpcR:::rnls
.data
containing the weights for the nonlinear fit.optim
, genoud
or nls
.pcrfit
.opt.method
.model$ssfct
.
2) Starting values are refined by any of the methods available in optim
or the Levenberg-Marquardt algorithm (nls.lm
).
The opt.method
s can be combined to tweak the robustness, whereby the starting parameters are passed to
each succeeding method, i.e. rep("Nelder", 5) will do 5 successive Nelder-Mead optimisations or c("LM", "Nelder") will pass the starting
values from "LM" to "Nelder". Levenberg-Marquardt ("LM") is very fast and reliable in many scenarios and is thus the default.
3) One of the possible methods from nls
is then applied with the starting values obtained from 2).
This function is to be used at the single run level. Otherwise use pcrbatch
or modlist
.
The output from the optim methods is checked by ensuring all eigenvalues from the hessian are positive, otherwise a notice will occur.
If robust = TRUE
, robust nonlinear fitting will be used. To do this, the internal function qpcR:::rnls
is called
which is a modification of the nlrob
function of the 'robustbase' package. Modifications were done such that all available generic functions
for objects of class 'nls' can be used on the output of qpcR:::rnls
, such as predict
, confint
etc.## simple l4 fit of F1.1 of the 'reps' dataset
pcrfit(reps, 1, 2, l4)
## using BFGS and Nelder from 'optim'
pcrfit(reps, 1, 2, l5, opt.method = c("BFGS", "Nelder"))
## skip 'optim' method and supply
## own starting values
pcrfit(reps, 1, 2, l4, do.optim = FALSE, start = c(-5, -0.05, 11, 16))
## make a robust model
pcrfit(reps, 1, 2, l4, robust = TRUE)
Run the code above in your browser using DataLab