nls.multstart::nls_multstart is used to calculate a 5 parameter logistic regression. Multiparametric regression requires to guess starting values. This guessing is done based on standard values (for aa, dd) and on a previous regression made by the bioplex biomanager (for cc, dd, gg). Sometimes, results of model fitting have not been consistent. Try to vary n_iter or simply repeat the fitting.

alt_5pl_model(
  list,
  n_iter = 1000,
  weights = c("lower", "upper", "none"),
  model_name = NULL,
  exag_factor = 10,
  start_pars = "std_curve_pars",
  ...
)

Arguments

list

one list entry as derived from plexr::read_bioplex

n_iter

number of iterations for nls.multstart::nls_multstart

weights

on which end of the regression does good fitting to standards is required most (e.g. where do the measured values lie), lower range or upper range or no weights (none); alternatively provide a numeric vector of weights - has to be same length as list$standard$FI; rows of list$standard will be order increasingly by FI before fitting; take this into account when providing numeric weights.

model_name

if NULL, just the model is returned; if model_name is not NULL the model is added under that name to list and list is returned

exag_factor

exaggeration factor used to increase range of allowed range of gg, bb, cc from std_curve_pars

start_pars

name of list entry that contains start_parameters for nls; ignored if not found or if NULL

...

additional parameters passed to nls.multstart::nls_multstart; e.g. or supp_errors = "Y"

Value

plain nls_model when is.null(model_name); or appended list with nls_model named model_name and start_pars

Details

Model for fitting is FI ~ dd + (aa - dd) / ((1 + (Conc / cc)^bb))^gg. dd corresponds to the horizontal asymptote for x -> -Inf, aa corresponds to the horizontal asymptote for x -> Inf. (https://laustep.github.io/stlahblog/posts/5pl.html)