reweight                package:party                R Documentation

_R_e-_f_i_t_t_i_n_g _M_o_d_e_l_s _w_i_t_h _N_e_w _W_e_i_g_h_t_s

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

     Generic function for re-fitting a model object using the same
     observations but different weights.

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

     reweight(object, weights, ...)

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

  object: a fitted model object.

 weights: a vector of weights.

     ...: arguments passed to methods.

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

     The method is not unsimilar in spirit to 'update', but much more
     narrowly focused. It should return an updated fitted model 
     derived from re-fitting the model on the same observations but
     using different weights.

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

     The re-weighted fitted model object.

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

     'update'

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

       ## fit cars regression
       mf <- dpp(linearModel, dist ~ speed, data = cars)
       fm <- fit(linearModel, mf)
       fm
       
       ## re-fit, excluding the last 4 observations
       ww <- c(rep(1, 46), rep(0, 4))
       reweight(fm, ww)

