predict.cggd              package:cggd              R Documentation

_M_a_k_e _p_r_e_d_i_c_t_i_o_n_s _o_r _e_x_t_r_a_c_t _c_o_e_f_f_i_c_i_e_n_t_s _f_r_o_m _a _f_i_t_t_e_d _c_g_g_d _m_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     While 'cggd' produces the entire path of solutions, predict.cggd
     allows one to extract a prediction at a particular point along the
     path.

_U_s_a_g_e:

      ## S3 method for class 'cggd':
      predict(object, newx, t, type = c("fit", "coefficients"), mode=c("k","t"), ...)

_A_r_g_u_m_e_n_t_s:

  object: A fitted cggd object 

    newx: If type="fit", then newx should be the x values at which the
          fit is required. If type="coefficients", then newx can be
          omitted. 

       t: A value specifying the desired model. Its values depends on
          the mode argument. By default (mode="k"), _t_ should take on
          values between 0 and max k (e.g., a step of 1.3 means .3 of
          the way between step 1 and 2.) 

    type: If type="fit", predict returns the fitted value. If
          type="coefficients", predict returns the coefficients. 

    mode: Mode="k" means the t= argument indexes the cggd step number,
          and the coefficients will be returned corresponding to the
          values at step t. If mode="t", then t is a time on the
          coefficient path. 

     ...: additional parameters. 

_V_a_l_u_e:

     Either the fitted value, or a vector of coefficients.

_A_u_t_h_o_r(_s):

     Cun-Hui Zhang and Ofer Melnik

_R_e_f_e_r_e_n_c_e_s:

     Cun-Hui Zhang (2007) "Continuous Generalized Gradient Descent"
     _Journal of Computational and Graphical Statistics_ ; see also
     <URL: http://stat.rutgers.edu/~cunhui/software/CGGD.html>.

_S_e_e _A_l_s_o:

     plot,  cggd, cv.cggd

_E_x_a_m_p_l_e_s:

     data(housing)
     attach(housing)
     object <- cggd(x,y)
     coef4.1 <- predict(object, t=4.1,type="coefficients", mode="k") 
     detach(housing)

