fitted-methods          package:fRegression          R Documentation

_E_x_t_r_a_c_t _R_e_g_r_e_s_s_i_o_n _M_o_d_e_l _F_i_t_t_e_d _V_a_l_u_e_s

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

     Extracts fitted values from a fitted regression model.

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



     _o_b_j_e_c_t = "_A_N_Y" Generic function

     _o_b_j_e_c_t = "_f_R_E_G" Extractor function for fitted values.


_N_o_t_e:

     'fitted' is a generic function which extracts fitted values  from
     objects returned by modeling functions, here the 'regFit' and
     'gregFit' parameter estimation functions.

     The class of the fitted values is the same as the class of the 
     data input to the function 'regFit' or 'gregFit'. In contrast the
     slot 'fitted' returns a numeric vector.

_A_u_t_h_o_r(_s):

     Diethelm Wuertz for the Rmetrics R-port.

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

     ## regSim -
        x.df = regSim(model = "LM3", n = 50)
       
     ## regFit -
        # Use data.frame input:
        fit = regFit(Y ~ X1 + X2 + X3, data = x.df, use = "lm")
        
     ## fitted - 
        val = slot(fit, "fitted")
        head(val)
        class(val)
        val = fitted(fit)
        head(val)
        class(val)
        
     ## regFit -
        # Convert to dummy timeSeries Object:
        x.tS = as.timeSeries(x.df)
        fit = regFit(Y ~ X1 + X2 + X3, data = x.tS, use = "lm")
        
     ## fitted - 
        val = slot(fit, "fitted")
        head(val)
        class(val)
        val = fitted(fit)
        head(val)
        class(val)

