snm                  package:assist                  R Documentation

_F_i_t _a _S_e_m_i-_p_a_r_a_m_e_t_r_i_c _N_o_n_l_i_n_e_a_r _M_i_x_e_d-_e_f_f_e_c_t_s _M_o_d_e_l

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

     This generic function fits a semi-paramteric nonlinear
     mixed-effects model  in the formulation described in Ke and Wang
     (2001). Current version only allows linear dependence on
     non-parametric  functions.

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

     snm(formula, func, data=sys.parent(), fixed, random=fixed, 
     groups, start, spar="v", verbose=FALSE, method="REML", control=NULL, 
     correlation=NULL, weights=NULL)

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

 formula: a formula object, with the response on the left of a ~
          operator, and an expression  of variables, parameters and
          non-parametric functions on the right. 

    func: a list of spline formulae each specifying the spline
          components necessary to  estimate each non-parametric
          function. On the left of a ~ operator of each component  is
          the unknow function symbol(s) as well as its arguments, while
          the right side is a  list of two components 'nb', an optional
          one-side formula for representing the null  space's bases,
          and a required 'rk' structure. 'nb' and 'rk' are similar to
          'formula'  and 'rk' in ssr. A missing 'nb' denotes an empty
          null space.  

   fixed: a two-sided formula specifying models for the fixed effects.
          The syntax of 'fixed' in 'nlme' is adopted. 

   start: a numeric vector, the same length as the number of fixed
          effects, supplying starting values for the fixed effects. 

    spar: a character string specifying a method for choosing the
          smoothing parameter. "v", "m" and "u" represent  GCV, GML and
          UBR respectively. Default is "v" for GCV. 

    data: An optional data frame containing the variables appearing in
          'formula' , 'random', 'rk', 'correlation', 'weights'. By
          default, the variables  are taken from the environment from
          which 'snm' is called. 

  random: an optional random effects structure specifying models for
          the random effects. The same syntax of 'random' in 'nlme' is
          assumed. 

  groups: an optional one-sided formula of the form ~g1 (single level)
          or ~g1/.../gQ  (multiple levels of nesting), specifying the
          partitions of the data over  which the random effects vary.
          g1,...,gQ must evaluate to factors in data.  See nlme for
          details.     

 verbose: an optional logical numerical value. If 'TRUE', information
          on the evolution of the iterative algorithm is printed.
          Default is 'FALSE'. 

  method: a character string. If 'REML' the model is fit by maximizing
          the restricted  log-likelihood. If 'ML' the log-likelihood is
          maximized. Default is 'ML.  

 control: a list of parameters to control the performance of the
          algorithm. 

correlation: an optional 'corStruct' object describing the within-group
          correlation  structure. See the documentation of corClasses
          for a description of the available corStruct classes. 
          Default is NULL, corresponding to no within-in group
          correlations. 

 weights: an optional 'varFunc' object or one-sided formula describing
          the  within-group heteroscedasticity structure. If given as a
          formula,  it is used as the argument to 'varFixed',
          corresponding to fixed variance weights.  See the
          documentation on varClasses for a description of the
          available varFunc  classes. Defaults to NULL, corresponding
          to homoscesdatic within-group errors. 

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

     an object of class 'snm' is returned, representing a
     semi-parametric nonlinear mixed effects model fit. Generic
     functions such as print, summary, predict and intervals have
     methods to show the results of the fit.

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

     Chunlei Ke chunlei_ke@yahoo.com and Yuedong Wang
     yuedong@pstat.ucsb.edu.

_R_e_f_e_r_e_n_c_e_s:

     Ke, C. and Wang, Y. (2001). Semi-parametric Nonlinear Mixed
     Effects Models and Their Applications. JASA 96:1272-1298.

     Pinheiro, J.C. and Bates, D. M. (2000). Mixed-Effects Models in S
     and S-PLUS. Springer.

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

     'predict.snm', 'intervals.snm', 'snm.control',
     'print.snm','summary.snm'

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

     data(CO2)

     options(contrasts=rep("contr.treatment", 2))    
     co2.fit1 <- nlme(uptake~exp(a1)*(1-exp(-exp(a2)*(conc-a3))), 
                      fixed=list(a1+a2~Type*Treatment,a3~1), 
                      random=a1~1, groups=~Plant, 
                      start=c(log(30),0,0,0,log(0.01),0,0,0,50),
                      data=CO2)

     M <- model.matrix(~Type*Treatment, data=CO2)[,-1]
     co2.fit2 <- snm(uptake~exp(a1)*f(exp(a2)*(conc-a3)),
                     func=f(u)~list(~I(1-exp(-u))-1,lspline(u, type="exp")),
                     fixed=list(a1~M-1,a3~1,a2~Type*Treatment),
                     random=list(a1~1), group=~Plant, verbose=TRUE,
                     start=co2.fit1$coe$fixed[c(2:4,9,5:8)], data=CO2)

