profiler.nls              package:stats              R Documentation

_C_o_n_s_t_r_u_c_t_o_r _f_o_r _P_r_o_f_i_l_e_r _O_b_j_e_c_t_s _f_r_o_m _n_l_s _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     ## S3 method for class 'nls':
     profiler(fitted, ...)

_A_r_g_u_m_e_n_t_s:

  fitted: the original fitted model object of class 'nls'.

     ...: Additional parameters. None are used.

_V_a_l_u_e:

     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' 

_W_a_r_n_i_n_g:

     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'.

_A_u_t_h_o_r(_s):

     Douglas M. Bates and Saikat DebRoy

_R_e_f_e_r_e_n_c_e_s:

     Bates, D.M. and Watts, D.G. (1988), _Nonlinear Regression Analysis
     and Its Applications_, Wiley

_S_e_e _A_l_s_o:

     'nls', 'nlsModel', 'profiler', 'profile.nls'

_E_x_a_m_p_l_e_s:

     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()

