Skip to contents

Alias for nse(). MEC, NSE, and the uppercase R-squared efficiency R2() are the same statistic. They must not be confused with lowercase r2(), the squared Pearson correlation.

Usage

mec(obs, pred, na.rm = TRUE)

Arguments

obs

Numeric observation vector.

pred

Numeric prediction vector paired with obs.

na.rm

Logical; remove incomplete pairs?

Value

One numeric value.

Details

$$\mathrm{MEC}=1-\frac{\sum_{i=1}^{n}(obs_i-pred_i)^2} {\sum_{i=1}^{n}(obs_i-\bar{obs})^2}.$$

Its interpretation and references are given in nse(). It returns NA with a warning under the same undefined conditions as nse().

Examples

mec(1:3, c(1, 3, 2))
#> [1] 0