

nls {nls}                                    R Documentation

_N_o_n_l_i_n_e_a_r _L_e_a_s_t _S_q_u_a_r_e_s

_D_e_s_c_r_i_p_t_i_o_n_:

     Determine the nonlinear least squares estimates of the
     parameters.

_U_s_a_g_e_:

     nls(formula, data, start, control=nls.control(),
         algorithm="default", trace=F, subset, na.action)

_A_r_g_u_m_e_n_t_s_:

 formula: a nonlinear model formula including variables and
          parameters

    data: an optional data frame in which to evaluate the
          variables in `formula'

   start: a named list or named numeric vector of starting
          estimates

 control: an optional list of control settings.  See
          `nlsControl' for the names of the settable control
          values and their effect.

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.

  subset: an optional vector specifying a subset of observa-
          tions to be used in the fitting process.

na.action: a function which indicates what should happen
          when the data contain `NA's.

_D_e_t_a_i_l_s_:

     An `nls' object is a type of fitted model object.  It
     has methods for the generic functions `coef', `for-
     mula', `resid', `print', `summary', and `fitted'.

_V_a_l_u_e_:

     A list of

       m: an `nlsModel' object incorporating the model

    data: the expression that was passed to `nls' as the
          data argument.  The actual data values are present
          in the environment of the `m' component.

_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 Regres-
     sion Analysis and Its Applications, Wiley

_S_e_e _A_l_s_o_:

     `nlsModel'

_E_x_a_m_p_l_e_s_:

     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 )

