Learn R Programming

ensembleBMA (version 3.0-5)

mae: Mean Absolute Error

Description

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

Usage

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

Arguments

fit
A model fit to ensemble forecasting data.
ensembleData
An ensembleData object that includes ensemble forecasts, verification observations and dates. Missing values (indicated by NA) are allowed. \ This need not be the data used for the model fit, alt
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.
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.
...
Included for generic function compatibility.

Value

  • A vector giving the MAE for the deterministic forecasts associated with the raw ensemble and for the ensemble forecasting model. This is the mean absolute difference of the raw ensemble medians and the observations, and the mean absolute difference of the median forecast and the observations (as in Sloughter et al. 2007). \ Note that Raftery et al. 2005 uses the mean absolute difference of the raw ensemble means and the observations, and the mean absolute difference of the BMA predictive mean and the observations.

Details

This method is generic, and can be applied to all ensemble 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. 516R, Department of Statistics, University of Washington, May 2008.

C. Fraley, A. E. Raftery, T. Gneiting, BMA Forecasting with Missing and Exchangeable Ensemble Members, in preparation.

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,
                   trainingRule = list(length=25, lag = 2))

  mae( slpTestFit, slpTestData)

Run the code above in your browser using DataLab