ensembleData {ensembleBMA} | R Documentation |
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.
ensembleData( forecasts, caseLabels = NULL, memberLabels = NULL, exchangeable = NULL, dates = NULL, observations = NULL, latitude = NULL, longitude = NULL, ...)
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 for BMA modeling
because they are used to match ensemble members
with BMA modeling weights and parameters.
|
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 for the forecasts. The default assumes that none of the ensemble members are exhangeable. |
dates |
A character vector or its factor equivalent specifying the dates corresponding to the forecasts. The character form of each date must be a string with format format YYYYMMDDHH or YYYYMMDD, where YYYY is the year, MM the monthn, DD the day, and (optionally) HH the hour. |
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. |
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.
An ensembleData
object, incorporating forecasts and (optionally) observations
with the associated dates.
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.
ensembleBMA
,
ensembleBMAgamma0
,
ensembleBMAnormal
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)) ## Not run: slpTestFit <- ensembleBMAnormal( slpTestData, trainingRule = list(length=25,lag=2)) slpTestFitX <- ensembleBMAnormal( slpTestDataX, trainingRule = list(length=25,lag=2)) ## End(Not run) data(prcpTest) labels <- c("CENT","AVN","CMCG","ETA","GASP","JMA","NGPS","TCWB","UKMO") prcpTestData <- ensembleData( forecasts = prcpTest[ ,labels], dates = prcpTest$date, observations = prcpTest$obs) ## Not run: prcpTestFit <- ensembleBMAgamma0(prcpTestData, trainingRule = list(length=30,lag=2)) ## End(Not run)