This is an implementation of the Generalized Discrimination Score (also known as Two Alternatives Forced Choice Score, 2AFC) for various representations of forecasts and verifying observations. The Generalized Discrimination Score is a generic forecast verification framework which can be applied to any of the following verification contexts: dichotomous, polychotomous (ordinal and nominal), continuous, probabilistic, and ensemble. A comprehensive description of the Generalized Discrimination Score, including all equations used in this package, is provided by Mason and Weigel (2009).
Compute the Generalized Discrimination Score for various types of forecasts and observations.
You can install the development version of afc from GitHub with:
# install.packages("pak")
pak::pak("MeteoSwiss/afc")
This is a basic example which shows you how to solve a common problem:
library(afc)
data(cnrm.nino34.cc)
afc.cc(cnrm.nino34.cc$obsv,cnrm.nino34.cc$fcst)
#> [1] 0.8717949