addreg                package:funfits                R Documentation

_A_d_d_i_t_i_v_e _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:

     Estimates the univariate functions using backfitting. If lambda is
     omitted in the call then at each step the smoothing parameter is
     estimated by minimizing the GCV criterion: GCV(lambda)=(1/n)*
     RSS/(n- p*2 + cost*(sum( J_i))**2

     Here J_i = tr(A_i) -2 where  A_i is the smoothing matrix for
     variable i.

     If p=1 and cost =1 this is the usual GCV function. A cost > 1 has
     the effect of being more conservative in choosing estimates that
     deviate from a linear function.  Note that the effective number of
     parameters in the total model can be approximated by sum( tr(
     A_i)).

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

     addreg(x, y, lam, nback=20, tol=1e-05, start, cost=1)

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

       x: Matrix of independent variables 

       y: Vector of independent variables 

     lam: Vector of length P with values of the smoothing parameters.
          If missing then the parameters are found by generalized
          cross-validation. 

   nback: Maximum number of iterations for backfitting.  

     tol: Tolerance value for judging convergence of backfitting. 

   start: Matrix of starting values for the function estimates 

    cost: Cost for each degree of freedom in the GCV criterion. 

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

     A list of class addreg. Components fitted.values and residuals
     contain the results of the fit. predicted.comp is matrix whose
     columns contain the estimates for the individual functions. The
     component trace has the effective number of parameters associated
     with each smoother and lambda has the corresponding smoothing
     parameters. Convergence information is in the component converge.

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

     plot.addreg, gam, predict.addreg

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

     # Additive model fit to the minitriathon data. A prediction of 
     # run times based on the swim and bike performance.
     # The smoothing parameters found by GCV with cost=2. 
     cbind( minitri$swim, minitri$bike)-> x
     addreg( x,minitri$run,cost=2)-> out
     plot( out) # summary plots of fits
     list( c(10,25), c(35,55))-> grid.list
     predict.surface(out, grid.list)-> out.p 
     persp( out.p) # perspective plot of fitted surface

