Learn R Programming

ensembleBMA (version 3.0-5)

ensembleBMAgamma0: BMA precipitation modeling

Description

Fits a Bayesian Model Averaging mixture of gammas with a point mass at 0 to ensemble forecasts. Intended for predicting precipitation. Allows specification of a training rule and forecasting dates.

Usage

ensembleBMAgamma0( ensembleData, dates = NULL, 
                   trainingRule = list(length = NA, lag = NA), 
                   control = controlBMAgamma0(), exchangeable = NULL)

Arguments

ensembleData
An ensembleData object including ensemble forecasts, verification observations and dates. Missing values (indicated by NA) are allowed.
dates
The dates for which forecasting models 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 length gives the number of time steps (e.g. days) in the training period, and the lag gives the number of time steps ahead of the most recent date in the t
control
A list of control values for the fitting functions. The defaults are given by the function controlBMAgamma0.
exchangeable
A numeric or character vector or factor indicating groups of ensemble members that are exchangeable (indistinguishable). The models fit will have equal weights and parameters within each group. The default determines exchangeability from

Value

  • A list with the following output components:
  • dateTableThe table of observations corresponding to the dates in ensembleData in chronological order.
  • trainingRuleThe training rule specified as input.
  • prob0coefsThe fitted coefficients in the model for the point mass at 0 (probability of zero precipitaion) for each member of the ensemble at each date.
  • biasCoefsThe fitted coefficients in the model for the mean of the gamma components for each member of the ensemble at each date (bias correction).
  • varCoefsThe fitted coefficients for the model for the variance of gamma components for each date. The coefficients are the same for all members of the ensemble.
  • weightsThe fitted BMA weights for the gamma components for each ensemble member at each date.
  • transformationThe function corresponding to the transformation of the data used to fit the models for the point mass at 0 and the bias model. The untransformed forecast is used to fit the variance model. This is input as part of control.
  • inverseTransformationThe function corresponding to the inverse of transformation. Used for quantile forecasts and verification. This is input as part of control.

Details

The output is for all of the dates in ensembleBMA, so there will be missing entries denoted by NA for dates that are too recent to be forecast with the training rule. The following methods are available for ensembleBMAgamma0 objects: cdf, quantileForecast, modelParameters, brierScore, crps and mae.

References

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. 516R, Department of Statistics, University of Washington, May 2008.

See Also

ensembleData, controlBMAgamma0, trainingControl, fitBMAgamma0, cdf, quantileForecast, modelParameters, brierScore, crps, mae

Examples

Run this code
data(prcpTest)

  labels <- c("CENT","AVN","CMCG","ETA","GASP","JMA","NGPS","TCWB","UKMO")

  prcpTestData <- ensembleData( forecasts = prcpTest[ ,labels],
                          dates = prcpTest$date, observations = prcpTest$obs)

\dontrun{
  prcpTestFit <- ensembleBMA( prcpTestData, model = "gamma0",
                              trainingRule = list(length=30,lag=2))
}
  prcpTestFit <- ensembleBMAgamma0( prcpTestData,
                              trainingRule = list(length=30,lag=2))

Run the code above in your browser using DataLab