nlstools {nlstools}R Documentation

Nonlinear least squares fit

Description

Tools to help the fit of nonlinear models with nls

Usage

preview (formula, data, start, variable = 1)
plotfit (x, smooth = FALSE, variable = 1)
overview (x)

Arguments

formula formula of a non-linear model
data a data frame with header matching the variables given in the formula
start a list of parameter starting values which names match the parameters given in the formula
variable index of the variable to be plotted against the predicted values
x an object of class 'nls'
smooth a logical value, default is FALSE. If smooth is TRUE, a plot of observed values is plotted as a function of 1000 values continuously taken in the range interval [min(variable),max(variable)]. This option can only be used if the number of controlled variables is 1.

Details

The function preview helps defining the parameter starting values prior fitting the model. It provides a superimposed plot of observed (circles) and predicted (crosses) values of the dependent variable versus one of the independent variables with the model evaluated at the starting values of the parameters. The function overview returns the parameters estimates, their standard errors as well as their asymptotic confidence intervals and the correlation matrix (alternately, the function confint provides better confidence interval estimates whenever it converges). plotfit displays a superimposed plot of the dependent variable versus one the independent variables together with the fitted model.

Author(s)

Florent Baty florent.baty@unibas.ch
Marie-Laure Delignette-Muller ml.delignette@vet-lyon.fr

References

Bates DM and Watts DG (1988) Nonlinear regression analysis and its applications. Wiley, Chichester, UK.

See Also

nls in the stats library and confint.nls in the package MASS

Examples

data(growthcurve4)
preview(gompertzm, growthcurve4, 
        list(lag = 50, mumax = 0.1, LOG10N0 = 6, LOG10Nmax = 8.8))
nls1 <- nls(gompertzm, growthcurve4,
        list(lag = 10, mumax = 0.1, LOG10N0 = 6, LOG10Nmax = 9))
overview(nls1)
plotfit(nls1, smooth = TRUE)

[Package nlstools version 0.0-8 Index]