SSfol                  package:nls                  R Documentation

_F_i_r_s_t-_o_r_d_e_r _C_o_m_p_a_r_t_m_e_n_t _M_o_d_e_l

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

     This `selfStart' model evaluates the first-order compartment
     function and its gradient.  It has an `initial' attribute that 
     creates initial estimates of the parameters `lKe', `lKa', and
     `lCl'.

_U_s_a_g_e:

     SSfol(Dose, input, lKe, lKa, lCl)

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

    Dose: a numeric value representing the initial dose.

   input: a numeric vector at which to evaluate the model.

     lKe: a numeric parameter representing the natural logarithm of the
          elimination rate constant.

     lKe: a numeric parameter representing the natural logarithm of the
          absorption rate constant.

     lCl: a numeric parameter representing the natural logarithm of the
          clearance.

_V_a_l_u_e:

     a numeric vector of the same length as `input', which is the value
     of the expression `Dose * exp(lKe+lKa-lCl) *
     (exp(-exp(lKe)*input)-exp(-exp(lKa)*input)) /
     (exp(lKa)-exp(lKe))'.

     If all of the arguments `lKe', `lKa', and `lCl' are names of
     objects, the gradient matrix with respect to these names is
     attached as an attribute named `gradient'.

_A_u_t_h_o_r(_s):

     Jose Pinheiro and Douglas Bates

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

     `nls', `selfStart'

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

     library( nls )
     data( Theoph )
     Theoph.1 <- Theoph[ Theoph$Subject == 1, ]
     SSfol( Theoph.1$Dose, Theoph.1$Time, -2.5, 0.5, -3 )  # response only
     lKe <- -2.5; lKa <- 0.5; lCl <- -3
     SSfol( Theoph.1$Dose, Theoph.1$Time, lKe, lKa, lCl ) # response and gradient
     getInitial(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph.1)
     ## Initial values are in fact the converged values
     fm1 <- nls(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph.1)
     summary(fm1)

