forecastBMA {ensembleBMA}R Documentation

Ensemble BMA forecast for a given date at observation locations.

Description

Gives an ensemble BMA forecast for a given date at observation locations. The model to be fitted depends on the type of data.

Usage

forecastBMA( date, ensembleData, trainingRule = list(length = 30, lag = 2), 
             control = NULL, quantiles = 0.5, model = NULL, 
             minCRPS = NULL, popData = NULL)

Arguments

date An integer or character string givin the date for which the forecast is desired.
ensembleData An ensembleData object including ensemble forecasts, observations and dates. Must include the date referenced in the date argument.
trainingRule A list giving the length and lag for the training period. The default is to use a 30 day training period for a forecast 2 days ahead of the last day in the training period.
control A list of control values for the fitting functions. The default is controlBMAnormal() for temperature or pressure data and controlBMAgamma0() for precipitation data.
quantiles A vector of quantiles for which the forecast is desired. The default is 0.5, for the median forecast of the model.
model A character string describing the BMA model to be fit. Current choices are "normal" for temperature or pressure data, and "gamma0" for precipitation data. Used only in function forecastBMA.
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 (temperature and pressure), because it can involve considerably more computation, particularly when unequal variances are specified in control. This argument applies only to 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. If provided, the predictors in popData would replace the logical variable in the regression.
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.

Value

The matrix of quantile forecasts for the given date.

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, controlBMAnormal, controlBMAgamma0, gridForecastBMA, quantileForecastBMA

Examples

  data(slp)

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

  unique(slpData$dates)

  slpForc1 <- forecastBMA( "2000063000", slpData, model = "normal",
                               quantiles = c(0.5,0.9))

  slpForc2 <- forecastBMAnormal( "2000063000", slpData, 
                               quantiles = c(0.5,0.9))

[Package ensembleBMA version 2.0 Index]