Learn R Programming

ensembleBMA (version 2.1)

ensembleData: Create an ensembleData object

Description

Creates an ensembleData object including ensemble forecasts along with dates and (optionally) observations. Other descriptive information such as latitude, longitude, and station type may be included as well.

Usage

ensembleData( forecasts, caseLabels = NULL, memberLabels = NULL, 
              exchangeable = NULL, dates = NULL, observations = NULL, 
              latitude = NULL, longitude = NULL, ...)

Arguments

forecasts
A matrix with columns corresponding to forecasts from individual members of an ensemble and rows corresponding to forecasts for the same date.
caseLabels
An optional set of labels assigned to the forecast instances. The default is to use the row names corresponding to forecasts.
memberLabels
An optional set of labels assigned to the ensemble members. The default is to use the column names corresponding to forecasts. These are important because they are used to match ensemble members with BMA modeling weights and pa
exchangeable
A numeric or character vector or factor indicating groups of ensemble members that are exchangeable (indistinguishable). The models fit will have equal weights and parameters within each group. The same names/labels should be used as
dates
Optional vector of dates corresponding to the forecasts. This must be in integer or ordered factor form. If a factor, it must sort in chronological order.
observations
Optional vector of observed weather conditions corresponding to the forecasts. Must be supplied if the data is to be used for BMA modeling.
latitude
Optional vector of latitudes of the forecast locations.
longitude
Optional vector of longitudes of the forecast locations.
...
A named list of additional attributes such as station name and station type.

Value

  • An ensembleData object, incorporating forecasts and (optionally) observations with the associated dates.

Details

Methods for ensembleData objects include ensembleSize, ensembleForecasts, ensembleVerifObs, and ensembleDates. Subsetting is possible, but in the case of columns it applies only to the ensemble forecasts.

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, ensembleBMAgamma0, ensembleBMAnormal

Examples

Run this code
data(slpTest)

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

 slpTestDataX <- ensembleData(forecasts = slpTest[ ,labels],
                        observations = slpTest$obs, dates = slpTest$date,
         exchangeable = c(AVN=1, GEM=2, ETA=1, NGM=3, NOGAPS=4))

slpTestFit <- ensembleBMAnormal( slpTestData)
 slpTestFitX <- ensembleBMAnormal( slpTestDataX)
  data(prcpTest)

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

prcpTestFit <- ensembleBMAgamma0(prcpTestData)

Run the code above in your browser using DataLab