Learn R Programming

ensembleBMA (version 2.1)

ensembleBMA: BMA mixture model fit

Description

Fits a BMA mixture model to ensemble forecasts. Allows specification of a model, training rule, and forecasting dates.

Usage

ensembleBMA( ensembleData, dates = NULL, trainingRule = list(length=30,lag=2), 
             control = NULL, model = NULL, warmStart = FALSE, minCRPS = NULL, 
             exchangeable = NULL, popData = NULL)

Arguments

ensembleData
An ensembleData, temperatureData, pressureData, or precipitationData object including ensemble forecasts, observations and dates.
dates
The dates for which forecasts are desired. By default, this will include all dates consistent with the training rule.
trainingRule
A list giving the length and lag for the training period. The default is to use a 30 time step training period for a forecast 2 time steps ahead of the last time step in the training period.
control
A list of control values for the fitting functions. The default is controlBMAnormal() for normal models and controlBMAgamma0() for gamma models with a point mass at 0.
model
A character string describing the BMA model to be fit. Current choices are "normal", typically used for temperature or pressure data, and "gamma0", typically used for precipitation data.
warmStart
A logical variable indicating whether or not estimation of models for a sequence of dates or time steps should be initialized with the weights from the previous date or time step. The default is for the initialization to be independen
minCRPS
A logical variable indicating whether or not to add a postprocessing step after a normal BMA fit to choose the standard deviation so as to minimize the CRPS for the training data. The default is not to do the CRPS minimization for normal da
exchangeable
A numeric or character vector or factor indicating groups of ensemble members that are exchangeable (indistinguishable). The model fit will have equal weights and parameters within each group. The default determines exchangeability from
popData
Optional predictors for the logistic regression for probability of zero precipitation. This option applies to the mixture of gammas model with a point mass at zero that is used for precipitation. In this model, the default predictors a

Value

  • A list with the following output components:
  • dateTableThe table of observations corresponding to the dates in x in chronological order.
  • trainingRuleThe training rule specified as input.
  • ...One or more components corresponding to fitted coefficients for the model.
  • weightsThe fitted BMA weights for the mixture components for each ensemble member at each date.
  • transformationA function corresponding to the transformation (if any) of the data used to fit the models for the point mass at 0 and mean of nonzero observations. The untransformed forecast is used to fit the variance model. This is input as part of control.
  • inverseTransformationA function corresponding to the inverse of transformation (if any). Used for quantile forecasts and verification. This is input as part of control.

Details

If dates are specified in dates that cannot be forecast with the training rule, the corresponding BMA model parameter outputs will be missing (NA) but not NULL. The training rule uses the number of days corresponding to its length regardless of whether or not the dates are consecutive. The following methods are available for the output of ensembleBMA: cdfBMA, quantileForecastBMA, bmaModelParameters, brierScore, crps and mae.

References

A. E. Raftery, T. Gneiting, F. Balabdaoui and M. Polakowski, Using Bayesian Model Averaging to calibrate forecast ensembles, Monthly Weather Review 133:1155--1174, 2005.

J. M. Sloughter, A. E. Raftery, T. Gneiting and C. Fraley, Probabilistic quantitative precipitation forecasting using Bayesian model averaging, Monthly Weather Review 135:3209--3220, 2007.

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. 516, Department of Statistics, University of Washington, August 2007.

See Also

ensembleData, ensembleBMAnormal, ensembleBMAgamma0, cdfBMA, quantileForecastBMA, bmaModelParameters, brierScore, crps, mae, controlBMAnormal, controlBMAgamma0

Examples

Run this code
data(slpTest)

  labels <- c("AVN","GEM","ETA","NGM","NOGAPS")
  slpTestData <- ensembleData(forecasts = slpTest[ ,labels],
                         observations = slpTest$obs, dates = slpTest$date)

  slpTestFit <- ensembleBMA( slpTestData, model = "normal")

data(prcp)

  labels <- c("CENT","AVN","CMCG","ETA","GASP","JMA","NGPS","TCWB","UKMO")
  prcpTestData <- ensembleData( forecasts = prcpTest[ , labels],
                          dates = prcpTest$date, observations = prcpTest$obs)
  prcpTestFit <- ensembleBMA(prcpTestData, model = "gamma0")

Run the code above in your browser using DataLab