Learn R Programming

openair (version 0.4-10)

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", ...)

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
...
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.
All statistics are based on complete pairs of mod and obs. Conditioning is possible through setting type.

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