# predictor_assessment: Model quality assessment In VEZY/sticRs: A Package to Set, Manage and Analyze STICS Simulations https://vezy.github.io/sticRs/

## Description

Provide several metrics to assess the quality of the predictions of a model (see note) against observations.

## Usage

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 R2(sim, obs, na.action = stats::na.omit) RMSE(sim, obs, na.rm = T) nRMSE(sim, obs, na.rm = T) MAE(sim, obs, na.rm = T) ABS(sim, obs, na.rm = T) MSE(sim, obs, na.rm = T) EF(sim, obs, na.rm = T) NSE(sim, obs, na.rm = T) Bias(sim, obs, na.rm = T) MAPE(sim, obs, na.rm = T) FVU(sim, obs, na.rm = T) RME(sim, obs, na.rm = T) 

## Arguments

 sim Simulated values obs Observed values na.action A function which indicates what should happen when the data contain NAs. na.rm Boolean. Remove NA values if TRUE (default)

## Details

The statistics for model quality can differ between sources. Here is a short description of each statistic and its equation (see html version for LATEX):

• R2(): coefficient of determination, computed using lm on obs~sim.

• RMSE(): Root Mean Squared Error, computed as

RMSE = sqrt(mean((sim-obs)^2)

• NSE(): Nash-Sutcliffe Efficiency, alias of EF, provided for user convenience.

• nRMSE(): Normalized Root Mean Squared Error, also denoted as CV(RMSE), and computed as:

nRMSE = (RMSE/mean(obs))*100

• MAE(): Mean Absolute Error, computed as:

MAE = mean(abs(sim-obs))

• ABS(): Mean Absolute Bias, which is an alias of MAE()

• FVU(): Fraction of variance unexplained, computed as:

FVU = SS_res/SS_tot

• MSE(): Mean squared Error, computed as:

MSE = mean((sim-obs)^2)

• EF(): Model efficiency, also called Nash-Sutcliffe efficiency (NSE). This statistic is related to the FVU as EF= 1-FVU. It is also related to the R2 because they share the same equation, except SStot is applied relative to the identity function (i.e. 1:1 line) instead of the regression line. It is computed as:

EF = 1-SS_res/SS_tot

• Bias(): Modelling bias, simply computed as:

Bias = mean(sim-obs)

• MAPE(): Mean Absolute Percent Error, computed as:

MAPE = mean(abs(obs-sim)/obs)

• RME(): Relative mean error (%), computed as:

RME = mean((sim-obs)/obs)

## Value

A statistic depending on the function used.

## Note

SS_res is the residual sum of squares and SS_tot the total sum of squares. They are computed as:

SS_res= sum((obs-sim)^2)

SS_tot= sum((obs-mean(obs))^2

Also, it should be noted that y_i refers to the observed values and \hat{y_i} to the predicted values, and \bar{y} to the mean value of observations.

This function was inspired from the evaluate() function from the SticsEvalR package. This function is used by stics_eval
 1 2 3 4 library(sticRs) sim= rnorm(n = 5,mean = 1,sd = 1) obs= rnorm(n = 5,mean = 1,sd = 1) RMSE(sim,obs)