\HeaderA{profiler.nls}{Constructor for Profiler Objects from nls Objects}{profiler.nls}
\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{\LinkA{nls}{nls}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'nls':
profiler(fitted, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fitted}] the original fitted model object of class
\code{\LinkA{nls}{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{\LinkA{nlsModel}{nlsModel}} object corresponding to \code{fitted}

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

\item[\code{setDefault(varying, params)}] See documentation for \code{\LinkA{profiler}{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{\LinkA{profiler}{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{\LinkA{profile.nls}{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{\LinkA{nls}{nls}},
\code{\LinkA{nlsModel}{nlsModel}},
\code{\LinkA{profiler}{profiler}},
\code{\LinkA{profile.nls}{profile.nls}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## 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}

