

   SSfol {nls}                                  R Documentation

   FFiirrsstt--oorrddeerr CCoommppaarrttmmeenntt MMooddeell

   DDeessccrriippttiioonn::

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

   UUssaaggee::

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

   AArrgguummeenntts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 loga-
             rithm of the elimination rate constant.

        lKe: a numeric parameter representing the natural loga-
             rithm of the absorption rate constant.

        lCl: a numeric parameter representing the natural loga-
             rithm of the clearance.

   VVaalluue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 `gradi-
        ent'.

   AAuutthhoorr((ss))::

        Jose Pinheiro and Douglas Bates

   SSeeee AAllssoo::

        `nls', `selfStart'

   EExxaammppllees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)

