Learn R Programming

ensembleBMA (version 2.0)

fitBMA: BMA model fitting.

Description

Fits a Bayesian Modeling Averaging mixture model to ensemble forecasting data.

Usage

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

Arguments

ensembleData
An ensembleData object with forecasts, observations and dates for precipitation.
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.
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:
  • ...One or more components corresponding to the coeffcients of the model.
  • weightsThe fitted weights for the BMA mixture.
  • nIterThe number of EM iterations.
  • transformationThe 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.
  • inverseTransformationThe function corresponding to the inverse of transformation (if any). Used in various diagnostic methods for the output.

Details

This function fits a BMA model to a training data set. The following methods are available for the output of fitBMA: gridForecastBMA, quantileForecastBMA, and bmaModelParameters.

References

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, ensembleBMA, fitBMAgamma0, fitBMAnormal, gridForecastBMA, quantileForecastBMA, bmaModelParameters,

Examples

Run this code
data(slp)

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

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

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

Run the code above in your browser using DataLab