Learn R Programming

verification (version 1.42)

quantileScore: Quantile Score

Description

Calculates verification statistics for quantile forecasts.

Usage

quantileScore(obs, pred, p, breaks, ...)

Value

qs.orig

Quantile score for original data

qs

Quantile score for binned data

qs.baseline

Quantile score for climatology

ss

Quantile skill score

qs.reliability

Reliability part of the quantile score

qs.resolution

Resolution part of the quantile score

qs.uncert

Uncertainty part of the quantile score

y.i

Discretized forecast values -- defined as the mean value of forecasts in each bin

obar.i

Conditional observed quantiles

prob.y

Number of forecast-observation pairs in each bin

obar

Climatology -- unconditional sample quantile of observations

breaks

Values used to bin the forecasts

check

Difference between original quantile score and quantile score decomposition

Arguments

obs

Vector of observations

pred

Vector of quantile forecasts

p

Probability level of quantile forecasts [0,1].

breaks

Values used to bin the forecasts

...

Optional arguments

Author

Sabrina Bentzien

Details

This function calculates the quantile score and its decomposition into reliability, resolution, and uncertainty. Note that a careful binning (discretization of forecast values) is necessary to obtain good estimates of reliability and resolution (see Bentzien and Friederichs (2013) for more details).

References

Bentzien, S. and Friederichs, P. (2013) Decomposition and graphical portrayal of the quantile score. Submitted to QJRMS.

See Also

check.func, qrel.plot

Examples

Run this code
data(precip.ensemble)

#Observations are in column 3
obs <- precip.ensemble[,3]

#Forecast values of ensemble are in columns 4 to 54
eps <- precip.ensemble[,4:54]

#Quantile forecasts from ensemble
p <- 0.9
qf <- apply(eps,1,quantile,prob=p,type=8)

#generate equally populated binnng intervals
breaks <- quantile(qf,seq(0,1,length.out=11))

qs <- quantileScore(obs,qf,p,breaks)
if (FALSE)  qrel.plot(qs) 

Run the code above in your browser using DataLab