StatModel-class          package:modeltools          R Documentation

_C_l_a_s_s "_S_t_a_t_M_o_d_e_l"

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

     A class for unfitted statistical models.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("StatModel",
     ...)'.

_S_l_o_t_s:

     '_n_a_m_e': Object of class '"character"', the name of the model.

     '_d_p_p': Object of class '"function"', a function for data
          preprocessing (usually formula-based). 

     '_f_i_t': Object of class '"function"', a function for fitting the
          model to data.

     '_p_r_e_d_i_c_t': Object of class '"function"', a function for computing
          predictions.

     '_c_a_p_a_b_i_l_i_t_i_e_s': Object of class '"StatModelCapabilities"'.

_M_e_t_h_o_d_s:

     _f_i_t 'signature(model = "StatModel", data = "ModelEnv")': fit
          'model' to 'data'.

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

     This is an attempt to provide unified infra-structure for unfitted
     statistical models. Basically, an unfitted model provides a
     function for data pre-processing ('dpp', think of generating
     design matrices),  a function for fitting the specified model to
     data ('fit'), and a function for computing predictions
     ('predict').

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

       ### linear model example
       df <- data.frame(x = runif(10), y = rnorm(10))
       mf <- dpp(linearModel, y ~ x, data = df)
       mylm <- fit(linearModel, mf)

       ### the same
       print(mylm)
       lm(y ~ x, data = df)

       ### predictions
       Predict(mylm, newdata =  data.frame(x = runif(10)))

