crps {ensembleBMA}R Documentation

Continuous Ranked Probability Score

Description

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

Usage

crps( fit, ensembleData, nSamples=NULL, seed=NULL, dates=NULL, ...)
CRPS( fit, ensembleData, nSamples=NULL, seed=NULL, dates=NULL, ...)

Arguments

fit A model fit to ensemble forecasting data.
ensembleData An ensembleData object that includes ensemble forecasts, verification observations and 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. \ If ensembleData includes dates, they must be consistent with fit and dates. If ensembleData does not include dates, they will be inferred from fit and dates.
nSamples The number of simulation samples for CRPS via simulation. For the normal model, the default is analytic computation of the CRPS. For the gamma model with a point mass at 0 (precipitation), the CRPS is always computed by simulation, with default nSamples = 10000.
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 fitBMA, 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 gamma0 model for precipitation and the gamma model for wind speed the CRPS is only available through simulation. The default number of simulation samples is 10,000.
Note that the gamma0 model for precipitation and the gamma model for wind speed may have been applied to a power transformation of the data.
For normal models for temperature and pressure, analytic computation of the CRPS is the default. CRPS will be computed via simulation for normal models only if nSamples is set to a positive value.

Value

crps is a matrix giving the CRPS for each instance in the data for both the raw ensemble and the median probabilistic forecast.
CRPS is a vector giving the mean of the CRPS over all instances for the raw ensemble and the median probabilistic forecast.

References

E. P. Grimit, T. Gneiting, V. J. Berrocal and N. A. Johnson, The continuous ranked probability score for circular variables and its application to mesoscale forecast ensemble verification, Quarterly Journal of the Royal Meteorological Society 132:2925-2642 (2006).

C. Fraley, A. E. Raftery, T. Gneiting and J. M. Sloughter, ensembleBMA: An R Package for Probabilistic Forecasting using Ensembles and Bayesian Model Averaging, Technical Report No. 516R, Department of Statistics, University of Washington, 2009.

C. Fraley, A. E. Raftery, T. Gneiting, Using Bayesian Model Averaging to Calibrate Forecast Ensembles with Missing and Exchangeable Ensemble Members, (in preparation).

See Also

ensembleBMA

Examples

  data(ensBMAtest)

  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")

## Not run: 
# R check
  tempTestFit <- ensembleBMAnormal( tempTestData, trainingDays = 30)
## End(Not run)
  crpsValues <- crps( tempTestFit, tempTestData)
  colMeans(crpsValues)

  CRPS( tempTestFit, tempTestData)

[Package ensembleBMA version 4.2 Index]