Create an ensembleData object

Share:

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

1
2
3
ensembleData( forecasts, dates = NULL, observations = NULL, ...,
              forecastHour, initializationTime,
              startupSpeed = NULL, exchangeable = NULL)

Arguments

forecasts

A matrix or array (for vector qunatities) with columns corresponding to forecasts from individual members of an ensemble and rows corresponding to forecasts for the same date.

dates

A numeric or character vector or factor specifying the valid dates for the forecasts. If numeric, it is interpreted as a Julian date if it has an origin attribute specifying the month, day, and year, e.g. c(month = 1, day = 1, year = 2000). Otherwise 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 (or matrix for vector quantities) of observed weather conditions corresponding to the forecasts. Must be supplied if the data is to be used for BMA modeling.

...

A named list of additional attributes such as latitude, longitude, and startupSpeed for wind speed.

forecastHour

A number giving the forecast hour, the time interval between the initialization and forecast times, in units of hours.

initializationTime

A number or character string giving the initialization time.

startupSpeed

A numeric value specifying a value below which the anemometer readings for wind speed will be recorded as zero. This value is used for all stations when the startup speed is not explicity specified as part of the data.

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.

Details

For use with batch processing modeling functions (ensembleBMA etc), instances ensembleData object are assumed the same forecast hour and initialization time, which should be specified as part of the object.
Methods for ensembleData objects include ensembleSize, ensembleForecasts, ensembleValidDates.
Subsetting is possible, but in the case of columns it applies only to the ensemble forecasts.
For vector wind computations, the velocity should be in the first column and the direction in the second.

Value

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

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, 2007 (revised 2010).

See Also

ensembleBMA, ensembleBMAgamma, ensembleBMAgamma0, ensembleBMAnormal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  data(ensBMAtest)

  ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo")

  obs <- paste("T2","obs", sep = ".")
  ens <- paste("T2", ensMemNames, sep = ".")


  tempTestData <- ensembleData( forecasts = ensBMAtest[,ens],
                                dates = ensBMAtest[,"vdate"],
                                observations = ensBMAtest[,obs],
                                station = ensBMAtest[,"station"],
                                forecastHour = 48,
                                initializationTime = "00")

## Not run:  # R check

  tempTestFit <- ensembleBMAnormal( tempTestData, trainingDays = 30)


## End(Not run)

  obs <- paste("PCP24","obs", sep = ".")
  ens <- paste("PCP24", ensMemNames, sep = ".")

  prcpTestData <- ensembleData( forecasts = ensBMAtest[,ens],
                                dates = ensBMAtest[,"vdate"], 
                                observations = ensBMAtest[,obs], 
                                station = ensBMAtest[,"station"],
                                forecastHour = 48,
                                initializationTime = "00")
## Not run:  # R check

  prcpTestFit <- ensembleBMAgamma0( prcpTestData, trainingDays = 30)


## End(Not run)

  obs <- paste("MAXWSP10","obs", sep = ".")
  ens <- paste("MAXWSP10", ensMemNames, sep = ".")

  winsTestData <- ensembleData( forecasts = ensBMAtest[,ens],
                                dates = ensBMAtest[,"vdate"], 
                                observations = ensBMAtest[,obs],
                                station = ensBMAtest[,"station"],
                                forecastHour = 48,
                                initializationTime = "00")

## Not run:  # R check

 winsTestFit <- ensembleBMAgamma(winsTestData, trainingDays = 30)


## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.