gcFitModel(time, data, gcID = "undefined", control = grofit.control())
time
.
grofit.control
containing a list of options generated by the function grofit.control.
gcFitModel
time
.data
.gcID
.nls
object generated by the R internal function nls
.grofit.control
containing list of options passed to the function as control
.gcFitSpline
that uses the R internal function lowess
to estimate initial values for the parametric fit. Four different models were tested by default. By means of an AIC criterion it is decided which model fits the data best. The tested models are: Gompertz law, modified Gompertz law, logistic law and Richards law.Note: If a certain model depicts not an appropriate description of a given data set nls
might stop and produce an error. This error stems from the generation of infinite or missing values or singular gradients in the optimization algorithm. These errors are not to be taken critical and indicates only that a certain model is not an appropriate description of a certain growth curve. When trying a couple of models it is usual that some of them can not be fitted. To prevent an overflow of almost redundant error messages ("nls(formulamodel, start = init.model) : singular gradient
", "Error in numericDeriv(form[[3L]], names(ind), env) : missing value or an inifinite produced by the model
") they are displayed only as short error message on screen.
If errors were frequently produced in models the user expects to be suitable, a change of the inital value definition (see e.g. initgompertz
, initlogistic
) might help.
gompertz
, gompertz.exp
, richards
, logistic
, gcFitSpline
, summary.gcFitModel
, plot.gcFitModel
x <- 1:30
y <- 1/(1+exp(0.5*(15-x)))+rnorm(30)/20
TestRun <- gcFitModel(x,y)
print(summary(TestRun))
plot(TestRun)
Run the code above in your browser using DataLab