Learn R Programming

ensembleBMA (version 2.1)

fitBMA: BMA model fit to a training set

Description

Fits a Bayesian Modeling Averaging mixture model to a given training set.

Usage

fitBMA( ensembleData, control = NULL, model = NULL, 
        exchangeable = NULL, popData = NULL)

Arguments

ensembleData
An ensembleData object with ensemble forecasts, observations and dates. This is the training set for the model.
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" for temperature or pressure data, and "gamma0" for precipitation data.
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 fr
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:
  • ...One or more components corresponding to the coeffcients of the model.
  • weightsThe fitted BMA weights for the mixture components for each ensemble member.
  • nIterThe number of EM iterations.
  • transformationThe 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.
  • inverseTransformationThe function corresponding to the inverse of transformation (if any). Used for quantile forecasts and verification. This is input as part of control.

Details

This function fits a BMA model to a training data set. Methods available for fitBMA objects (the output of fitBMA) include: cdfBMA, quantileForecastBMA, and bmaModelParameters.

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, ensembleBMA, fitBMAgamma0, fitBMAnormal, cdfBMA, quantileForecastBMA, bmaModelParameters, controlBMAnormal, controlBMAgamma0

Examples

Run this code
data(slpTest)

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

  DATE <- sort(unique(slpTestData$dates))[27]
  trainDat <- trainingData( slpTestData, date=DATE, 
                            trainingRule=list(length=25,lag=2))
  slpFitA <- fitBMA(trainDat, model = "normal")

  D <- as.numeric(slpTestData$dates) <= 25
  slpFitB <- fitBMA(slpTestData[D, ], model = "normal")

Run the code above in your browser using DataLab