predictValuesLm         package:rotRPackage         R Documentation

_P_r_e_d_i_c_t_s _v_a_l_u_e_s _t_h_r_o_u_g_h _a _l_i_n_e_a_r _m_o_d_e_l

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

     This ROT function, called from a LinearModel C++ object, and given
     a        sample, is used to predict the corresponding values
     through the linear      model. It returns the predicted sample.

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

     predictValuesLm(x, beta)

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

       x: A m-by-n matrix containing the explanatory variables.

    beta: A n-by-1 vector containng the linear model parameters.

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

     As it is not asked in LinearModel.getPredict(), no prediction
     interval  is returned; it is up to the user to be careful about
     that. It is also to   noted that the sample is not assumed to
     contain the '1's corresponding to   the intercept parameter.

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

     A m-by-1 vector is returned, containing the predicted values.

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

     Pierre-Matthieu Pair, Softia for EDF.

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

     set.seed(1)
     x <- matrix(runif(40), 10, 4)
     r <- matrix(c(1,2,3,4), 4, 1)
     y <- x %*% r + matrix(rnorm(10, 0, 0.05), 10, 1)
     LM <- computeLinearModel(x, y)
     predictValuesLm(x, LM$parameterEstimate) 

