Learn R Programming

ensembleBMA (version 2.1)

fitBMAnormal: BMA mixture of normals fit to a training set

Description

Fits a Bayesian Model Averaging mixture of normals to a given training set.

Usage

fitBMAnormal( ensembleData, control = controlBMAnormal(),
              exchangeable = NULL)

Arguments

ensembleData
An ensembleData object with ensemble forecasts, observations and dates.
control
A list of control values for the fitting functions. The defaults are given by the function controlBMAnormal.
exchangeable
An optional numeric or character vector or factor indicating groups of ensemble members that are exchangeable (indistinguishable). The models have equal weights and parameters within each group. If supplied, this argument will override any

Value

  • A list with the following output components:
  • biasCoefsThe fitted bias-correction coefficients.
  • sdThe fitted standard deviations for the mixture of normals model (equal or varying across components according to the equalVariance setting in the control input).
  • weightsThe fitted BMA weights for the normal components for each ensemble member.
  • nIterThe number of EM iterations.

Details

This function fits a BMA model to a training data set. It is called by ensembleBMAnormal, which can produce a sequence of fits over a larger data set. Methods available for the output of fitBMAnormal 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.

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, controlBMAnormal, ensembleBMAnormal, cdfBMA, quantileForecastBMA, bmaModelParameters

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))

slpTestFit <- fitBMA(trainDat, model = "normal")

  slpTestFit <- fitBMAnormal(trainDat)

Run the code above in your browser using DataLab