profiler.nls {nls} | R Documentation

## Constructor for Profiler Objects from nls Objects

### Description

Create a profiler object for the model object `fitted` of class `nls`.

### Usage

    profiler.nls(fitted, ...)

### Arguments

`fitted` | the original fitted model object of class `nls`.
`...` | Additional parameters. None are used.

### Value

An object of class `profiler.nls` which is a list with function elements

`getFittedModel()` | the `nlsModel` object corresponding to `fitted`
`getFittedPars()` | See documentation for `profiler`
`setDefault(varying, params)` | See documentation for `profiler`
`getProfile(varying, params)` | In the returned list, `fstat` is the ratio of change in sum-of-squares and the residual standard error. For other details, see documentation for `profiler`

### 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 `profile.nls`.

### Author(s)

Douglas M. Bates and Saikat DebRoy

### References

Bates, D.M. and Watts, D.G. (1988), Nonlinear Regression Analysis and Its Applications, Wiley

### See Also

`nls`, `nlsModel`, `profiler`, `profile.nls`

### Examples

    library( nls )
    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(F,T), 16.0)
    # vary lrc
    prof1$setDefault(varying = c(F, T))
    # 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()