nnr                  package:assist                  R Documentation

_N_o_n_l_i_n_e_a_r _N_o_n-_p_a_r_a_m_e_t_r_i_c _R_e_g_r_e_s_s_i_o_n

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

     Fit a nonlinear nonparametric regression models with spline
     smoothing based on extended Gauss-Newton/Newton-Raphson and
     backfitting.

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

     nnr(formula, func, spar="v", data=sys.parent(), start=list(),verbose=FALSE,  control=list())

_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 a nonparametric function appearing with a
          symbol, e.g. f.  

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

    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. 

   start: a list of vectors or expressions which input inital values
          for the unknown functions. If expressions, the argument(s)
          inside should be the same as in 'func'. The length of 'start'
          should be the same as  the number of unknown functions. If
          named, the names of the list should match those in "func". If
          not named, the order  of the list is taken as that appearing
          in "func". 

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

 control: an optional list of control values to be used.  See
          nnr.control for details. 

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

     A nonlinear nonparametric model is fitted using the algorithms
     developed in Ke and Wang (2002).

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

     an object of class 'nnr' is returned, containing fitted values,
     fitted function values as well as  other information used to
     assess the estimate.

_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. (2002). Nonlinear Nonparametric Regression
     Models. Submitted.

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

     'nnr.control', 'ssr', 'print.nnr', 'summary.nnr', 'intervals.nnr'

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

     x<- 1:100/100
     y<- exp(sin(2*pi*x))+0.3*rnorm(x)
     fit<- nnr(y~exp(f(x)), func=list(f(u)~list(~u, cubic(u))), start=list(0))

     ## fit a generalized varying coefficient models
     data(Arosa)
     Arosa$csmonth <- (Arosa$month-0.5)/12
     Arosa$csyear <- (Arosa$year-1)/45
     ozone.vc.fit <- nnr(thick~f1(csyear)+exp(f2(csyear))*f3(csmonth),
             func=list(f1(x)~list(~I(x-.5),cubic(x)), f2(x)~list(~I(x-.5)-1,cubic(x)),
             f3(x)~list(~sin(2*pi*x)+cos(2*pi*x)-1,lspline(x,type="sine0"))),
             data=Arosa[Arosa$year%%2==1,], spar="m", start=list(f1=mean(thick),f2=0,f3=sin(csmonth)),
             control=list(backfit=1))

