snr                  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 _R_e_g_r_e_s_s_i_o_n _M_o_d_e_l

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

     This generic function fits a Semi-parametric Nonlinear Regression
     Model as formulated in Ke (2000).

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

     snr(formula, func, params, data = sys.parent(), start, 
         spar = "v", verbose = FALSE, control = list(), correlation = NULL, 
         weights = NULL) 

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

 formula: a model formula, with the response on the left of a ~
          operator  and on the right an expression representing the
          mean function  with at least one unknown function appearing
          with a symbol,  e.g. f. If "data" is present, all names
          except the nonparametric  function(s) used in the formula
          should be defined as parameters  or variables in the data
          frame. 

    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.    

  params: a two-sided formula specifying models for the parameters. 
          The syntax of 'params' in 'gnls' is adopted. See 'gnls' for
          details. 

    data: an optional data frame containing the variables named in
          model,  params, correlation and weights. By default the
          variables are taken  from the environment from which snr is
          called.   

   start: a numeric list with two components: "params=", a vector of
          the size of the length of the unknown parameters,  providing
          inital values for the paramters, and "f=" a list of vectors
          or expressions which input inital values for the unknown
          functions.  If the unknown functions appear linear in the
          model, the intial values then are not necessary.  

    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. 

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

 control: an optional list of control parameters. See 'snr.control' for
          details. 

correlation: an optional 'corStruct' as in gnls. Default is NULL,
          corresponding to uncorrelation. 

weights : an optional 'varFunc' structure as in 'gnls'. Default is
          NULL, representing equal variances. 

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

     A semi-parametric regression model is generalization of
     self-modeling  regression, nonlinear regression and smoothing
     spline models, including  as special cases (nonlinear) partial
     spline models, varying coefficients  models, PP regression and
     some other popular models. 'snr' is  implemented with an alternate
     iterative procedures with smoothing splines  to estimate the
     unknown functions and general nonlinear regression to estimate
     parameters.

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

     An object of class 'snr' is returned, representing a
     semi-parametric  nonlinear regression fit. Generic functions such
     as print, summary,  intervals and predict 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. (2000). Semi-parametric Nonlinear Regression and Mixed
     Effects  Models. PhD thesis, University of California, Santa
     Barbara.

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

     Wahba, G. (1990). Spline Models for Observational Data. SIAM, Vol.
     59.

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

     'intervals.snr',  'predict.snr', 'snr.control'

_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]

     ## fit a SNR model
     co2.fit2 <- snr(uptake~exp(a1)*f(exp(a2)*(conc-a3)),
                     func=f(u)~list(~I(1-exp(-u))-1,lspline(u, type="exp")),
                     params=list(a1~M-1, a3~1, a2~Type*Treatment),
                     start=list(params=co2.fit1$coe$fixed[c(2:4,9,5:8)]), data=CO2)

