sumSqerror               package:dse1               R Documentation

_C_a_l_c_u_l_a_t_e _s_u_m _o_f _s_q_u_a_r_e_d _p_r_e_d_i_c_t_i_o_n _e_r_r_o_r_s

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

     Calculate a weighted sum squared prediction errors for a
     parameterization.

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

         sumSqerror(coefficients, model=NULL, data=NULL, error.weights=NULL)

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

coefficients: A vector of coefficients (parameters).

   model: an object of class TSmodel which gives the structure  of the
          model for which coefficients are used. 'coef(model)' should 
          be the same length as coefficients.

    data: an object of class TSdata which gives the data with  which
          the model is to be evaluated.

error.weights: a vector of weights to be applied to the  squared
          prediction errors.

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

     This function is primarily for use in parameter optimization,
     which requires that an objective function be specified by a vector
     of parameters.

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

     The value of the sum squared errors for a prediction horizon given
     by the  length of error.weights. Each period ahead is weighted by
     the corresponding  weight in error.weights.

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

     'l' 'l.SS' 'l.ARMA'

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

     if(is.R()) data("eg1.DSE.data.diff", package="dse1")
     model <- estVARXls(eg1.DSE.data.diff)
     sumSqerror(1e-10 + coef(model), model=TSmodel(model), 
             data=TSdata(model), error.weights=c(1,1,10))

