Learn R Programming

openair (version 0.5-23)

modStats: Calculate common model evaluation statistics

Description

Function to calculate common numerical model evaluation statistics with flexible conditioning

Usage

modStats(mydata, mod = "mod", obs = "obs",
    type = "default", rank.name = NULL, ...)

Arguments

mydata
A data frame.
mod
Name of a variable in mydata that respresents modelled values.
obs
Name of a variable in mydata that respresents measured values.
type
type determines how the data are split i.e. conditioned, and then plotted. The default is will produce statistics using the entire data. type can be one of the built-in types as detailed in cutData e.g. "
rank.name
Simple model ranking can be carried out if rank.name is supplied. rank.name will generally refer to a column representing a model name, which is to ranked. The ranking is based the Index of Agreement performance, as t
...
Other aruments to be passed to cutData e.g. hemisphere = "southern"

Value

  • Returns a data frame with model evaluation statistics.

Details

This function is under development and currently provides some common model evaluation statistics. These include (to be mathematically defined later):
  • $n$, the number of complete pairs of data.
  • $FAC2$, fraction of predictions within a factor of two.
  • $MB$, the mean bias.
  • $MGE$, the mean gross error.
  • $NMB$, the normalised mean bias.
  • $NMGE$, the normalised mean gross error.
  • $RMSE$, the root mean squared error.
  • $r$, the Pearson correlation coefficient.
  • $IOA$, the Index of Agreement based on Willmott et al. (2011), which spans between -1 and +1 with values approaching +1 representing better model performance. An IOA of 0.5, for example, indicates that the sum of the error-magnitudes is one half of the sum of the observed-deviation magnitudes. When IOA = 0.0, it signifies that the sum of the magnitudes of the errors and the sum of the observed-deviation magnitudes are equivalent. When IOA = -0.5, it indicates that the sum of the error-magnitudes is twice the sum of the perfect model-deviation and observed-deviation magnitudes. Values of IOA near -1.0 can mean that the model-estimated deviations about O are poor estimates of the observed deviations; but, they also can mean that there simply is little observed variability - so some caution is needed when the IOA approaches -1.
All statistics are based on complete pairs of mod and obs. Conditioning is possible through setting type.

References

Willmott, C.J., Robeson, S.M., Matsuura, K., 2011. A refined index of model performance. International Journal of Climatology.

Examples

Run this code
## the example below is somewhat artificial --- assuming the observed
## values are given by NOx and the predicted values by NO2.

modStats(mydata, mod = "no2", obs = "nox")

## evaluation stats by season

modStats(mydata, mod = "no2", obs = "nox", type = "season")

Run the code above in your browser using DataLab