\Header{profiler.nls}{Constructor for Profiler Objects from nls Objects}
\keyword{nonlinear}{profiler.nls}
\keyword{regression}{profiler.nls}
\keyword{models}{profiler.nls}
\begin{Description}\relax
Create a profiler object for the model object \code{fitted} of class
\code{\Link{nls}}.\end{Description}
\begin{Usage}
\begin{verbatim}
profiler(fitted, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fitted}] the original fitted model object of class
\code{\Link{nls}}.
\item[\code{...}] Additional parameters. None are used.
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{profiler.nls} which is a list with function
elements
\begin{ldescription}
\item[\code{getFittedModel()}] the \code{\Link{nlsModel}} object corresponding to \code{fitted}

\item[\code{getFittedPars()}] See documentation for \code{\Link{profiler}}

\item[\code{setDefault(varying, params)}] See documentation for \code{\Link{profiler}}

\item[\code{getProfile(varying, params)}] In the returned list, \code{fstat} is the ratio of change in
sum-of-squares and the residual standard error.

For other details, see documentation for \code{\Link{profiler}}

\end{ldescription}
\end{Value}
\begin{Section}{WARNING}
When using setDefault and getProfile together, the internal state of
the fitted model may get changed. So after completing the profiling
for a parameter, the internal states should be restored by a call to
setDefault without any arguments. For example see below or the source
for \code{\Link{profile.nls}}.\end{Section}
\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{nls}},
\code{\Link{nlsModel}},
\code{\Link{profiler}},
\code{\Link{profile.nls}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data( BOD )
## obtain the fitted object
fm1 <- nls(demand ~ SSasympOrig( Time, A, lrc ), data = BOD)
## get the profile for the fitted model
prof1 <- profiler( fm1 )
## profile with A fixed at 16.0
prof1$getProfile(c(FALSE, TRUE), 16.0)
## vary lrc
prof1$setDefault(varying = c(FALSE, TRUE))
## fix A at 14.0 and starting estimate of lrc at -0.2
prof1$setDefault(params = c(14.0, -0.2))
## and get the profile
prof1$getProfile()
## finally, set defaults back to original estimates
prof1$setDefault()
\end{ExampleCode}
\end{Examples}

