View source: R/ensembleBMAnormal.R

ensembleBMAnormal | R Documentation |

Fits a Bayesian Model Averaging mixture of normals to ensemble forecasts. Allows specification of a training rule and forecasting dates.

ensembleBMAnormal(ensembleData, trainingDays, dates = NULL, control = controlBMAnormal(), exchangeable = NULL, minCRPS = FALSE)

`ensembleData` |
An |

`trainingDays` |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |

`dates` |
The dates for which BMA forecasting models are desired.
By default, this will be all dates in |

`control` |
A list of control values for the fitting functions. The defaults are
given by the function |

`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 |

`minCRPS` |
A logical variable indicating whether or not to add a postprocessing step after the BMA fit to choose the standard deviation so as to minimize the CRPS for the training data. The default is not to do the CRPS minimization, because it can add considerable extra cost to the computation, particularly when there are many ensemble members. |

The output is for all of the `dates`

in `ensembleData`

, so there
will be missing entries denoted by `NA`

for dates that are too recent
to be forecast with the training rule.

The following methods are available for `ensembleBMAnormal`

objects:
`cdf`

, `quantileForecast`

, `modelParameters`

,
`brierScore`

, `crps`

, `CRPS`

and `MAE`

.

A list with the following output components:

`training` |
A list containing information on the training length and lag and the number of instances used for training for each modeling day. |

`biasCoefs` |
The fitted bias-correction coefficients for each ensemble member at each date. |

`sd` |
The fitted standard deviations for the mixture of normals model at each date. |

`weights` |
The fitted BMA weights for the normal components for each ensemble member at each date. |

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*.

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).

C. Fraley, A. E. Raftery, T. Gneiting,
Calibrating Multi-Model Forecast Ensembles
with Exchangeable and Missing Members using Bayesian Model Averaging,
*Monthly Weather Review 138:190–202, 2010*.

`ensembleData`

,
`controlBMAnormal`

,
`fitBMAnormal`

,
`cdf`

,
`quantileForecast`

,
`modelParameters`

,
`brierScore`

,
`crps`

,
`MAE`

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) ## equivalent to ## tempTestFit <- ensembleBMA( tempTestData, trainingDays = 30, ## model = "normal") ## End(Not run) # for quick run only; use more training days for forecasting tempTestFit <- ensembleBMAnormal( tempTestData[1:20,], trainingDays = 8)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.