Learn R Programming

ensembleBMA (version 2.0)

ensembleBMA: Bayesian Model Averaging for ensemble forecasts.

Description

Fits a BMA mixture model to ensemble forecasts.

Usage

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

Arguments

ensembleData
An ensembleData, temperatureData, pressureData, or precipitationData object including ensemble forecasts, observations and dates.
dates
The dates for which modeling is 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 initilaizatiin to be independent of
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. The default is not to do the CRPS minimization for normal data (e.g. temperature o
popData
Optional predictors for the logistic regression for probability of 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 are an

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 weights for the mixture of gammas model for the nonzero observations at each date.
  • transformationA function corresponding 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 in various diagnostic methods for the output.

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: gridForecastBMA, quantileForecastBMA, bmaModelParameters, brierSkillScores, and crpsANDmae.

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, Technical Report No. 496R, Department of Statistics, University of Washington, October 2006 (to appear in Montly Weather Review).

See Also

ensembleData, forecastBMA, ensembleBMAnormal, ensembleBMAgamma0, gridForecastBMA, quantileForecastBMA, bmaModelParameters, brierSkillScores, crpsANDmae

Examples

Run this code
data(slp)

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

  slpFit <- ensembleBMA( slpData, model = "normal")

data(prcp)

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

Run the code above in your browser using DataLab