\Header{nls}{Nonlinear Least Squares}
\alias{anova.nls}{nls}
\alias{anovalist.nls}{nls}
\alias{coef.nls}{nls}
\alias{deviance.nls}{nls}
\alias{df.residual.nls}{nls}
\alias{fitted.nls}{nls}
\alias{logLik.nls}{nls}
\alias{print.nls}{nls}
\alias{print.summary.nls}{nls}
\alias{residuals.nls}{nls}
\alias{summary.nls}{nls}
\alias{weights.nls}{nls}
\keyword{nonlinear}{nls}
\keyword{regression}{nls}
\keyword{models}{nls}
\begin{Description}\relax
Determine the nonlinear least squares estimates of the parameters.\end{Description}
\begin{Usage}
\begin{verbatim}
nls(formula, data, start, control=nls.control(),
    algorithm="default", trace=F, subset, na.action)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] a nonlinear model formula including variables and parameters
\item[\code{data}] an optional data frame in which to evaluate the variables in
\code{formula}
\item[\code{start}] a named list or named numeric vector of starting estimates
\item[\code{control}] an optional list of control settings.  See
\code{nlsControl} for the names of the settable control values and
their effect.
\item[\code{algorithm}] character string specifying the algorithm to use.
The default algorithm is a Gauss-Newton algorithm. The other 
alternative is "plinear", the Golub-Pereyra algorithm for
partially linear least-squares models.
\item[\code{subset}] an optional vector specifying a subset of observations
to be used in the fitting process.
\item[\code{na.action}] a function which indicates what should happen
when the data contain \code{NA}s.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
An \code{nls} object is a type of fitted model object.  It has methods
for the generic functions \code{coef}, \code{formula}, \code{resid},
\code{print}, \code{summary}, and \code{fitted}.\end{Details}
\begin{Value}
A list of
\begin{ldescription}
\item[\code{m}] an \code{nlsModel} object incorporating the model
\item[\code{data}] the expression that was passed to \code{nls} as the data
argument.  The actual data values are present in the environment of
the \code{m} component.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Douglas M. Bates and Saikat DebRoy\end{Author}
\begin{References}\relax
Bates, D.M. and Watts, D.G. (1988), \emph{Nonlinear Regression Analysis
and Its Applications}, Wiley\end{References}
\begin{SeeAlso}\relax
\code{\Link{nlsModel}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library( nls )
data( DNase )
DNase1 <- DNase[ DNase$Run == 1, ]
## using a selfStart model
fm1DNase1 <- nls( density ~ SSlogis( log(conc), Asym, xmid, scal ), DNase1 )
summary( fm1DNase1 )
## using conditional linearity
fm2DNase1 <- nls( density ~ 1/(1 + exp(( xmid - log(conc) )/scal ) ),
                  data = DNase1,
                  start = list( xmid = 0, scal = 1 ),
                  alg = "plinear", trace = TRUE )
summary( fm2DNase1 )
## without conditional linearity
fm3DNase1 <- nls( density ~ Asym/(1 + exp(( xmid - log(conc) )/scal ) ),
                  data = DNase1,
                  start = list( Asym = 3, xmid = 0, scal = 1 ),
                  trace = TRUE )
summary( fm3DNase1 )
\end{ExampleCode}
\end{Examples}

