Calculates the Index of Agreement (Willmott, 1981), a standardized measure
of the degree of model prediction error which varies between 0 and 1:
Usage
d2(obs, sim, na.rm = TRUE)
Arguments
- obs
Numeric vector of observed values.
- sim
Numeric vector of simulated (modelled) values.
- na.rm
Logical; should missing values (NA) in either vector be removed
pairwise before computation? Default is TRUE.
Value
numeric; Index of Agreement (d), ranging from 0 to 1.
Details
$$d = 1 - \frac{\sum_{i=1}^n (\text{sim}_i - \text{obs}_i)^2}{\sum_{i=1}^n (|\text{sim}_i - \bar{\text{obs}}| + |\text{obs}_i - \bar{\text{obs}}|)^2}$$
A value of 1 indicates a perfect match, and 0 indicates no agreement at all.