Last data update: 2014.03.03

R: Continuous Ranked Probability Score
crpsR Documentation

Continuous Ranked Probability Score

Description

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

Usage

crps(fit, ensembleData, dates=NULL, nSamples=NULL, seed=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.

nSamples

The number of simulation samples for CRPS via simulation.

seed

Argument to set.seed for random number generation in simulation.

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. For Gaussian (normal) models for temperature and pressure, calculation of the CRPS via simulation is not used and analytic computation is the only option.

Value

crps is a vector giving the CRPS for each instance in the data.

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

  data(ensMOStest)

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

  tempTestData <- ensembleData( forecasts = ensMOStest[,ensMemNames],
                                dates = ensMOStest[,"vdate"],
                                observations = ensMOStest[,"obs"],
                                station = ensMOStest[,"station"],
                                forecastHour = 48,
                                initializationTime = "00")


  tempTestFit <- ensembleMOSnormal( tempTestData, trainingDays = 30)

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

Results