nlstools: Nonlinear least squares fit

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

Description

Tools to help the fit of nonlinear models with nls

Usage

1
2
3
preview (formula, data, start, variable = 1)
plotfit (x, smooth=FALSE, variable=1, xlab=NULL, ylab=NULL, pch.obs=1, pch.fit="+", lty=1, lwd=1, col.obs="black", col.fit="red", ...)
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; default is the first independent variable as it appear in the orginal dataset

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.

xlab

X-label

ylab

Y-label

pch.obs

type of point of the observed values

pch.fit

type of point of the fitted values (not applicable if smooth=TRUE)

lty

type of line of the smoothed fitted values (if smooth=TRUE)

lwd

thickness of line of the smoothed fitted values (if smooth=TRUE)

col.obs

color of the observed points

col.fit

color of the fitted values

...

further arguments passed to or from other methods

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@gmail.com
Marie-Laure Delignette-Muller ml.delignette@vetagro-sup.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

1
2
3
4
5
6
7
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)

nlstools documentation built on May 2, 2019, 5:49 p.m.