Learn R Programming

ensembleBMA (version 2.1)

mae: Mean Absolute Error

Description

Computes the mean absolute error (MAE) for ensemble BMA forecasting models.

Usage

mae( fit, ensembleData, dates=NULL, nSamples=NULL, seed=NULL, popData=NULL, ...)

Arguments

fit
An ensemble BMA model fit for ensembleData.
ensembleData
An ensembleData object that includes both ensemble forecasts and observations. It need not be the object used to form fit, although it must include the same ensemble members. If ensembleData includes d
dates
The dates for which the CRPS and MAE will be computed. These dates must be consistent with fit and ensembleData. The default is to use all of the dates in fit.
nSamples
The number of simulation samples for MAE via simulation. The default is analytic computation of the MAE.
seed
Argument to set.seed for random number generation in simulation.
popData
For gamma0 model fits, there is an additional popData argument for providing predictors in the logistic regression for probability of zero precipitation. If popData was supplied to obtain in the modeling for
...
Included for generic function compatibility.

Value

  • A vector giving the MAE for the deterministic forecasts associated with the raw ensemble and the BMA model. For the raw ensemble, this is the mean absolute difference of the the ensemble means and the observations. For the BMA mixture of normals model, it is the mean absolute difference of the BMA predictive mean (Raftery et al. 2005) and the observations. For the BMA mixture of gammas with a point mass at 0 model used for precipitation, it is the mean absolute difference of the BMA median forecast and the observations (Sloughter et al. 2007).

Details

This method is generic, and can be applied to all ensemble BMA forecasting models. Note the model may have been applied to a transformation of the data, but that information is included in the input fit, and the output is transformed appropriately.

References

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

ensembleBMA

Examples

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

  slpTestFit <- ensembleBMAnormal(slpTestData)

  mae( slpTestFit, slpTestData)

Run the code above in your browser using DataLab