Learn R Programming

ensembleBMA (version 2.0)

fitBMAgamma0: BMA for a mixture of gammas with a point mass at 0.

Description

Fits a Bayesian Modeling Averaging mixture of gammas with a point mass at 0 to ensemble forecasting data. Intended for modeling precipitation.

Usage

fitBMAgamma0( ensembleData, control = controlBMAgamma0(), 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 defaults are given by the function controlBMAgamma0.
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:
  • prob0coefsThe fitted coefficients in the model for the point mass at 0 for each member of the ensemble.
  • biasCoefsThe fitted coefficients in the model for the mean of nonzero observations for each member of the ensemble (used for bias correction).
  • varCoefsThe fitted coefficients for the model for the variance of nonzero observations (these are the same for all members of the ensemble).
  • weightsThe fitted weights for the mixture of gammas model for the nonzero observations.
  • nIterThe number of EM iterations.
  • transformationThe function corresponding the transformation 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. Used in various diagnostic methods for the output.

Details

This function fits a BMA model to a training data set. It is called by ensembleBMAgamma0, which produces a sequence of fits over a larger precipitation 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, controlBMAgamma0, ensembleBMAgamma0, gridForecastBMA, quantileForecastBMA, bmaModelParameters

Examples

Run this code
data(prcp)

  prcpData <- ensembleData( dates = prcp$date, observations = prcp$obs,
                          forecasts = prcp[,c("CENT","AVN","CMCG","ETA",
                                      "GASP","JMA","NGPS","TCWB","UKMO")])

  DATE <- sort(unique(prcpData$dates))[27]
  trainDat <- trainingData(prcpData, date = DATE,
                           trainingRule = list(length=25,lag=2))
  prcpFit25a <- fitBMAgamma0(trainDat)

  D <- as.numeric(prcpData$dates) <= 25
  prcpFit25b <- fitBMAgamma0(prcpData[D, ])

  prcpFit25c <- fitBMAgamma0(prcpData[D, ], 
                     popData = ensembleForecasts(prcpData[D,]) == 0)

Run the code above in your browser using DataLab