getCrps: Calculate the continuous ranked probability score

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/getCrps.R

Description

The continuous ranked probability score (CRPS) is intended to verify a probabilistic prediction, i.e. a prediction in the form of a probability distribution. Informally, it judges how close this distribution envelops the verifying observation.

Usage

1
getCrps(cdfx, cdfy, obs)

Arguments

cdfx

numeric vector. The quantiles belonging to the probabilities defined in cdfy.

cdfy

numeric vector. The probabilities belonging to the quantiles defined in cdfx.

obs

real number. The value of the observation corresponding to the probabilistic prediction.

Details

cdfx can have a variable step width.

Value

Real number, i.e. the CRPS value.

Note

Author(s)

Simon S

References

Hersbach, H. (2000). "Decomposition of the continuous ranked probability score for ensemble prediction systems". Weather and Forecasting.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## normal distribution
obs <- 0
cdfx <- seq(from=-5,to=5,by=0.01)
cdfy <- pnorm(q=cdfx)
getCrps(cdfx=cdfx,cdfy=cdfy,obs=obs)

## 'deterministic' prediction:
## in theory we should end up with the mean absolute error
## however, the numerical integration of the step function fails
obs <- 0
cdfx <- c(-3,-1,-1,2)
cdfy <- c(0,0,1,1)
getCrps(cdfx=cdfx,cdfy=cdfy,obs=obs)

hydro-giub/hydroBE documentation built on Sept. 20, 2019, 9:27 a.m.