crps: Continuous Ranked Probability Score

Description Usage Arguments Details Value References See Also Examples

Description

Computes the continuous ranked probability score (CRPS) for univariate ensemble forecasting models.

Usage

1
crps(fit, ensembleData, dates=NULL, ...)

Arguments

fit

A model fit to ensemble forecasting data, obtained using fitMOS or
ensembleMOS.

ensembleData

An ensembleData object that includes ensemble forecasts, verification observations and possibly dates. Missing values (indicated by NA) are allowed. This need not be the data used for the model fit, although it must include the same ensemble members.

dates

The dates for which the CRPS will be computed. These dates must be consistent with fit and ensembleData. The default is to use all of the dates in fit. The dates are ignored if fit originates from fitMOS, which also ignores date information.

...

Included for generic function compatibility.

Details

These methods are generic, and can be applied to all ensemble forecasting models. Missing values in forecasts and/or observations result in NA values in the CRPS vector.

Value

crps is a matrix giving the CRPS for each instance in the data for both the raw ensemble and the probabilistic forecast.

References

T. Gneiting and A. E. Raftery, Strictly proper scoring rules, prediction and estimation, Journal of the American Statistical Association 102:359–378, 2007.

See Also

ensembleMOS, fitMOS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data("ensBMAtest", package = "ensembleBMA")

ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo")

obs <- paste("T2", "obs", sep = ".")
ens <- paste("T2", ensMemNames, sep = ".")
tempTestData <- ensembleData(forecasts = ensBMAtest[,ens],
                             dates = ensBMAtest[,"vdate"],
                             observations = ensBMAtest[,obs],
                             station = ensBMAtest[,"station"],
                             forecastHour = 48,
                             initializationTime = "00")

tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, 
                           dates = "2008010100",
                           model = "normal")

crpsValues <- crps(tempTestFit, tempTestData)
colMeans(crpsValues)

Example output

Loading required package: ensembleBMA
Loading required package: chron
Loading required package: evd

Attaching package: 'ensembleMOS'

The following objects are masked from 'package:ensembleBMA':

    brierScore, cdf, crps, quantileForecast, trainingData


modeling for date 2008010100 ...
(Intercept)      T2.gfs     T2.cmcg      T2.eta     T2.gasp      T2.jma 
     -17.42        0.26        0.19        0.22        0.00        0.24 
    T2.ngps     T2.tcwb     T2.ukmo 
       0.15        0.00        0.00 
          
1.14 0.00 

ensemble     EMOS 
2.510113 2.269935 

ensembleMOS documentation built on May 2, 2019, 11:03 a.m.