ensembleBMA {ensembleBMA}R Documentation

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 the result at the previous time step.
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 or pressure), because it can involve considerably more computation, particularly when unequal variances are specified in control. This argument is used only for normal models.
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 intercept, the transformed forecast data, and a logical variable indicating whether or not the forecast is equal to 0. In addition, the coefficient of the transformed forecast must not be greater than 0 and that of the logical variable must not be less than 0 in the default. If provided, the predictors in popData would replace the logical variable in the regression, and no constraints are imposed on the regression coefficients.
To supply one pop predictor per ensemble member, popData can be a matrix or data frame (if the predictor is categorical) with number of rows equal to the number of observations, and number of columns equal to the ensemble size.
To supply multiple numeric pop predictors per ensemble member, popData can be an array of dimension (number of observations) by (ensemble size) by (number of pop predictors).
To supply multiple pop predictors per ensemble member, some of which may be categorical, popData must be a list of (number of observations) by (ensemble size) matrices, one for each pop predictor.

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.

Value

A list with the following output components:

dateTable The table of observations corresponding to the dates in x in chronological order.
trainingRule The training rule specified as input.
... One or more components corresponding to fitted coefficients for the model.
weights The fitted weights for the mixture of gammas model for the nonzero observations at each date.
transformation A 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.
inverseTransformation A function corresponding to the inverse of transformation (if any). Used in various diagnostic methods for the output.

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

  data(slp)

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

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

## Not run: 
  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")
## End(Not run)

[Package ensembleBMA version 2.0 Index]