DIAGNOSTICS              package:nsRFA              R Documentation

_D_i_a_g_n_o_s_t_i_c_s _o_f _m_o_d_e_l_s

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

     Diagnostics of model results, it compares estimated values 'y'
     with observed values 'x'.

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

      R2 (x, y, na.rm=FALSE)
      RMSE (x, y, na.rm=FALSE) 
      MAE (x, y, na.rm=FALSE)
      RMSEP (x, y, na.rm=FALSE)
      MAEP (x, y, na.rm=FALSE)

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

       x: observed values

       y: estimated values

   na.rm: logical. Should missing values be removed?

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

     If xi are the observed values, yi the estimated values, with
     i=1,...,n, and <x> the sample mean of xi, then:

              R2 = 1 - (sum(xi-yi)^2)/(sum(xi^2-n<x>^2)


                    RMSE = sqrt(1/n sum(xi-yi)^2)


                        MAE = 1/n sum(|xi-yi|)


                 RMSEP = sqrt(1/n sum((xi-yi)/xi)^2)


                     MAEP = 1/n sum(|(xi-yi)/xi|

     See <URL:
     http://en.wikipedia.org/wiki/Coefficient_of_determination>, <URL:
     http://en.wikipedia.org/wiki/Mean_squared_error> and <URL:
     http://en.wikipedia.org/wiki/Mean_absolute_error> for other
     details.

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

     'R2' returns the coefficient of determination R2 of a model.

     'RMSE' returns the root mean squared error of a model.

     'MAE' returns the mean absolute error of a model.

     'RMSE' returns the percentual root mean squared error of a model.

     'MAE' returns the percentual mean absolute error of a model.

_N_o_t_e:

     For information on the package and the Author, and for all the
     references, see 'nsRFA'.

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

     'lm', 'summary.lm', 'predict.lm', 'REGRDIAGNOSTICS'

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

     data(hydroSIMN)

     datregr <- parameters
     regr0 <- lm(Dm ~ .,datregr); summary(regr0)
     regr1 <- lm(Dm ~ Am + Hm + Ybar,datregr); summary(regr1)

     obs <- parameters[,"Dm"]
     est0 <- regr0$fitted.values
     est1 <- regr1$fitted.values

     R2(obs, est0)
     R2(obs, est1)

     RMSE(obs, est0)
     RMSE(obs, est1)

     MAE(obs, est0)
     MAE(obs, est1)

     RMSEP(obs, est0)
     RMSEP(obs, est1)

     MAEP(obs, est0)
     MAEP(obs, est1)

