Learn R Programming

ensembleBMA (version 3.0-5)

trainingData: Extract Training Data

Description

Extracts the training data corresponding to a given date and training rule.

Usage

trainingData( ensembleData, date,
              trainingRule = list( length = NA, lag = NA),
              exchangeable = NULL)

Arguments

ensembleData
An ensembleData object that includes, ensemble forecasts, observations and dates.
date
The date for which the training data is desired.
trainingRule
A list giving the length and lag for the training period. The length gives the number of time steps (e.g. days) in the training period, and the lag gives the number of time steps ahead of the most recent date in the t
exchangeable
A numeric or character vector or factor indicating groups of ensemble members that are exchangeable (indistinguishable). The modeling will have equal weights and parameters within each group. The default determines exchangeability from

Value

  • An ensembleData object corresponding to the training data for the given date relative to ensembleData.

Details

The training rule uses the most recent days for the given period regardless of whether or not they are consecutive.

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.

J. M. Sloughter, A. E. Raftery, T. Gneiting and C. Fraley, Probabilistic quantitative precipitation forecasting using Bayesian model averaging, Monthly Weather Review 135:3309--3320, 2007.

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, fitBMA, trainingControl

Examples

Run this code
data(slpTest)

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

  trainDat <- trainingData(slpTestData, date = "2000063000",
                           trainingRule = list(length=30,lag=2))
 
  slpTestFitTD <- fitBMAnormal(trainDat)

Run the code above in your browser using DataLab