Title: | Ensemble Model Output Statistics |
---|---|
Description: | Ensemble Model Output Statistics to create probabilistic forecasts from ensemble forecasts and weather observations. |
Authors: | RA Yuen, Sandor Baran, Chris Fraley, Tilmann Gneiting, Sebastian Lerch, Michael Scheuerer, Thordis Thorarinsdottir |
Maintainer: | Sandor Baran <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.8.2 |
Built: | 2025-02-13 04:57:40 UTC |
Source: | https://github.com/cran/ensembleMOS |
Computes the Brier score for the probability of exceedance of precipitation threshold values for univariate ensemble forecasting models.
brierScore(fit, ensembleData, thresholds, dates=NULL, ...)
brierScore(fit, ensembleData, thresholds, dates=NULL, ...)
fit |
A model fit to ensemble forecasting data, obtained using
|
ensembleData |
An |
thresholds |
Threshold values for which the probability of exceedance is evaluated, set to 0 to evaluate probability of precipitation forecasts. |
dates |
The dates for which the CRPS will be computed.
These dates must be consistent with |
... |
Included for generic function compatibility. |
Note that the Brier scores are only available for EMOS models suitable for precipitation accumulation, i.e. the censored and shifted gamma, and the censored generalized extreme value distribution EMOS model.
BScores
is a vector giving the Brier scores for each instance in the
data.
T. Gneiting and A. E. Raftery, Strictly proper scoring rules, prediction and estimation, Journal of the American Statistical Association 102:359–378, 2007.
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitCSG0 <- ensembleMOScsg0(prcpTestData, trainingDays = 25, dates = "2008010100") brierScore(prcpTestFitCSG0, ensembleData = prcpTestData, thresholds = 0)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitCSG0 <- ensembleMOScsg0(prcpTestData, trainingDays = 25, dates = "2008010100") brierScore(prcpTestFitCSG0, ensembleData = prcpTestData, thresholds = 0)
Computes the cumulative distribution function (CDF) of an ensemble forecasting model at observation locations.
cdf(fit, ensembleData, values, dates = NULL, ...)
cdf(fit, ensembleData, values, dates = NULL, ...)
fit |
A model fit to ensemble forecasting data, obtained using
|
ensembleData |
An |
values |
The vector of desired values at which the CDF of the ensemble forecasting model is to be evaluated. |
dates |
The dates for which the CDF will be computed.
These dates must be consistent with |
... |
Included for generic function compatibility. |
This method is generic, and can be applied to any ensemble forecasting
model obtained using fitMOS
or ensembleMOS
.
For the EMOS models that allow for point masses at 0, i.e. the censored and
shifted gamma, and the censored generalized extreme value distribution EMOS model,
the function contains an addition logical argument randomizeATzero
that specifies
whether the value of the CDF at zero should be chosen randomly from the interval between
0 and the value of the CDF at zero. The default choice if FALSE
, setting
randomizeATzero = TRUE
is practical for computing randomized PIT values.
A matrix of probabilities corresponding to the CDF at the desired values. Useful for determining propability of freezing, precipitation, etc.
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman, Calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Monthly Weather Review 133:1098–1118, 2005.
ensembleMOS
,
fitMOS
,
quantileForecast
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, model = "normal", dates = "2008010100") tempTestCDF <- cdf(tempTestFit, tempTestData, values = seq(from=277, to=282, by = 1)) tempTestCDF
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, model = "normal", dates = "2008010100") tempTestCDF <- cdf(tempTestFit, tempTestData, values = seq(from=277, to=282, by = 1)) tempTestCDF
Specifies a list of values controling the censored and shifted gamma EMOS fit of ensemble forecasts.
controlMOScsg0(scoringRule = c("crps", "log"), optimRule = c("Nelder-Mead", "BFGS", "L-BFGS-B"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL, q = NULL), maxIter = Inf)
controlMOScsg0(scoringRule = c("crps", "log"), optimRule = c("Nelder-Mead", "BFGS", "L-BFGS-B"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL, q = NULL), maxIter = Inf)
scoringRule |
The scoring rule to be used in optimum score estimation. Options are "crps" for the continuous ranked probability score and "log" for the logarithmic score. |
optimRule |
Numerical optimization method to be supplied to |
coefRule |
Method to control non-negativity of regression estimates. Options are:
|
varRule |
Method to control non-negativity of the scale parameters.
Options |
start |
A list of starting parameters, |
maxIter |
An integer specifying the upper limit of the number of iterations used to fit the model. |
If no value is assigned to an argument, the first entry of
the list of possibly choices will be used by default.
Note that optimMethod options are only available for scoringRule = "log"
.
In case of scoringRule = "crps"
, the optimization method
is set to "L-BFGS-B" by default.
Given an ensemble of size :
, the
following shifted gamma model left-censored at 0
is fit by
ensembleMOScsg0
:
where denotes the shifted gamma distribution left-censored at zero,
with shape
, scale
and shift
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, and the variance
is a linear
function of the ensemble mean
, see ensembleMOScsg0
for details.
A list whose components are the input arguments and their assigned values.
M. Scheuerer and T. M. Hamill, Statistical post-processing of ensemble precipitation forecasts by fitting censored, shifted gamma distributions. Monthly Weather Review 143:4578–4596, 2015.
S. Baran and D. Nemoda, Censored and shifted gamma distribution based EMOS model for probabilistic quantitative precipitation forecasting. Environmetrics 27:280–292, 2016.
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitCSG0 <- ensembleMOScsg0(prcpTestData, trainingDays = 25, dates = "2008010100", control = controlMOScsg0(maxIter = as.integer(100), scoringRule = "log", optimRule = "Nelder-Mead", coefRule= "none", varRule = "square"))
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitCSG0 <- ensembleMOScsg0(prcpTestData, trainingDays = 25, dates = "2008010100", control = controlMOScsg0(maxIter = as.integer(100), scoringRule = "log", optimRule = "Nelder-Mead", coefRule= "none", varRule = "square"))
Specifies a list of values controling the censored generalized extreme value distribution EMOS fit of ensemble forecasts.
controlMOSgev0(optimRule = c("Nelder-Mead", "L-BFGS-B", "BFGS"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, s = NULL, c = NULL, d = NULL, q = NULL), maxIter = Inf)
controlMOSgev0(optimRule = c("Nelder-Mead", "L-BFGS-B", "BFGS"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, s = NULL, c = NULL, d = NULL, q = NULL), maxIter = Inf)
optimRule |
Numerical optimization method to be supplied to |
coefRule |
Method to control non-negativity of regression estimates. Options are:
|
varRule |
Method to control non-negativity of the scale parameters.
Options |
start |
A list of starting parameters, |
maxIter |
An integer specifying the upper limit of the number of iterations used to fit the model. |
Note that only minimum CRPS estimation is available and chosen by default.
If no value is assigned to an argument, the first entry of the list of possibly choices will be used by default.
Given an ensemble of size :
, the
following generalized extreme value distribution EMOS
model left-censored at 0 is fit by
ensembleMOSgev0
:
where denotes the generalized extreme value distribution
left-censored at zero,
with location
, scale
and shape
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, where
denotes the ratio of ensemble forecasts
that are exactly 0, and the shape parameter
is a linear
function of the ensemble variance
, where
is Gini's mean difference.
See ensembleMOSgev0 for details.
A list whose components are the input arguments and their assigned values.
M. Scheuerer, Probabilistic quantitative precipitation forecasting using ensemble model output statistics. Quarterly Journal of the Royal Meteorological Society 140:1086–1096, 2014.
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = "2008010100", control = controlMOSgev0(maxIter = as.integer(100), optimRule = "Nelder-Mead", coefRule= "none", varRule = "square"))
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = "2008010100", control = controlMOSgev0(maxIter = as.integer(100), optimRule = "Nelder-Mead", coefRule= "none", varRule = "square"))
Specifies a list of values controling the log-normal EMOS fit of ensemble forecasts.
controlMOSlognormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
controlMOSlognormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
scoringRule |
The scoring rule to be used in optimum score estimation. Options are "crps" for the continuous ranked probability score and "log" for the logarithmic score. |
optimRule |
Numerical optimization method to be supplied to |
coefRule |
Method to control non-negativity of regression estimates. Options are:
|
varRule |
Method to control non-negativity of the variance parameters.
Options |
start |
A list of starting parameters, |
maxIter |
An integer specifying the upper limit of the number of iterations used to fit the model. |
If no value is assigned to an argument, the first entry of
the list of possibly choices will be used by default.
Given an ensemble of size :
, the
following log-normal model is fit by
ensembleMOSlognormal
:
where denotes the log-normal distrbution with
meanlog
parameter and
scalelog
parameter , see
Lognormal. The model is parametrized such that the mean value of
the log-normal distribution is a linear function
of the ensemble forecats, and the variance is a linear function
. For transformations between
and mean
and variance of the log-normal distribution, see Baran and Lerch (2015).
See ensembleMOSlognormal for details.
Note that in case of scoringRule = "log"
, forecast cases in the
training period with observation values of 0 are ignored in the model
estimation as 0 is not included in the support of the log-normal
distribution.
A list whose components are the input arguments and their assigned values.
S. Baran and S. Lerch, Log-normal distribution based Ensemble Model Output Statistics models for probabilistic wind-speed forecasting. Quarterly Journal of the Royal Meteorological Society 141:2289–2299, 2015.
ensembleMOSlognormal
,
fitMOSlognormal
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitLN <- ensembleMOSlognormal(windTestData, trainingDays = 25, dates = "2008010100", control = controlMOSlognormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitLN <- ensembleMOSlognormal(windTestData, trainingDays = 25, dates = "2008010100", control = controlMOSlognormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
Specifies a list of values controling the Gaussian (normal) EMOS fit of ensemble forecasts.
controlMOSnormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
controlMOSnormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
scoringRule |
The scoring rule to be used in optimum score estimation. Options are "crps" for the continuous ranked probability score and "log" for the logarithmic score. |
optimRule |
Numerical optimization method to be supplied to |
coefRule |
Method to control non-negativity of regression estimates. Options are:
|
varRule |
Method to control non-negativity of the variance parameters.
Options |
start |
A list of starting parameters, |
maxIter |
An integer specifying the upper limit of the number of iterations used to fit the model. |
If no value is assigned to an argument, the first entry of
the list of possibly choices will be used by default.
Given an ensemble of size :
, the
following Gaussian model is fit by
ensembleMOSnormal
:
B
is the array of fitted regression coefficients for each date. See ensembleMOSnormal for details.
A list whose components are the input arguments and their assigned values.
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman, calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Monthly Weather Review 133:1098–1118, 2005.
ensembleMOSnormal
,
fitMOSnormal
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25, dates = "2008010100", control = controlMOSnormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25, dates = "2008010100", control = controlMOSnormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
Specifies a list of values controling the truncated normal EMOS fit of ensemble forecasts.
controlMOStruncnormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
controlMOStruncnormal(scoringRule = c("crps", "log"), optimRule = c("BFGS","Nelder-Mead"), coefRule = c("square", "none", "positive"), varRule = c("square", "none"), start = list(a = NULL, B = NULL, c = NULL, d = NULL), maxIter = Inf)
scoringRule |
The scoring rule to be used in optimum score estimation. Options are "crps" for the continuous ranked probability score and "log" for the logarithmic score. |
optimRule |
Numerical optimization method to be supplied to |
coefRule |
Method to control non-negativity of regression estimates. Options are:
|
varRule |
Method to control non-negativity of the scale parameters.
Options |
start |
A list of starting parameters, |
maxIter |
An integer specifying the upper limit of the number of iterations used to fit the model. |
If no value is assigned to an argument, the first entry of the list of possibly choices will be used by default.
Given an ensemble of size :
, the
following truncated normal model is fit by
ensembleMOStruncnormal
:
where denotes the normal distribution truncated at zero,
with location
and squared scale
.
B
is a vector of fitted regression coefficients . See ensembleMOStruncnormal for details.
A list whose components are the input arguments and their assigned values.
T. L. Thorarinsdottir and T. Gneiting, Probabilistic forecasts of wind speed: Ensemble model output statistics by using heteroscedastic censored regression. Journal of the Royal Statistical Society Series A 173:371–388, 2010.
ensembleMOStruncnormal
,
fitMOStruncnormal
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitTN <- ensembleMOStruncnormal(windTestData, trainingDays = 25, dates = "2008010100", control = controlMOStruncnormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitTN <- ensembleMOStruncnormal(windTestData, trainingDays = 25, dates = "2008010100", control = controlMOStruncnormal(maxIter = as.integer(100), scoringRule = "log", optimRule = "BFGS", coefRule= "none", varRule = "square"))
Computes the continuous ranked probability score (CRPS) for univariate ensemble forecasting models.
crps(fit, ensembleData, dates=NULL, ...)
crps(fit, ensembleData, dates=NULL, ...)
fit |
A model fit to ensemble forecasting data, obtained using
|
ensembleData |
An |
dates |
The dates for which the CRPS will be computed.
These dates must be consistent with |
... |
Included for generic function compatibility. |
These methods are generic, and can be applied to all ensemble
forecasting models. Missing values in forecasts and/or observations
result in NA
values in the CRPS vector.
crps
is a matrix giving the CRPS for each instance in the data for
both the raw ensemble and the probabilistic forecast.
T. Gneiting and A. E. Raftery, Strictly proper scoring rules, prediction and estimation, Journal of the American Statistical Association 102:359–378, 2007.
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = "2008010100", model = "normal") crpsValues <- crps(tempTestFit, tempTestData) colMeans(crpsValues)
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = "2008010100", model = "normal") crpsValues <- crps(tempTestFit, tempTestData) colMeans(crpsValues)
Fits a EMOS model to ensemble forecasts. Allows specification of a model, training rule, and forecasting dates.
ensembleMOS(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = NULL, warmStart = FALSE, model = NULL, exchangeable = NULL)
ensembleMOS(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = NULL, warmStart = FALSE, model = NULL, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions. The corresponding
control function has to be chosen in accordance with the selected
|
warmStart |
If |
model |
A character string describing the EMOS model to be fit.
Current choices are |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The model fit will have equal weights and parameters within each
group.
The default determines exchangeability from |
If dates are specified in dates
that cannot be forecast
with the training rule, the corresponding EMOS model parameter
outputs will be missing (NA
) but not NULL
.
The training rule uses the number of days corresponding to its
length
regardless of whether or not the dates are consecutive.
A list containing information on the training (length, lag and the
number of instances used for training for each modeling date), the
exchangeability, and vectors and/or matrics containing the estimated
regression and variance coefficient values depending on the specified
model
.
Gaussian (normal) EMOS model:
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman,
Calibrated probabilistic forecasting using ensemble model output
statistics and minimum CRPS estimation.
Monthly Weather Review 133:1098–1118, 2005.
Truncated normal EMOS model:
T. L. Thorarinsdottir and T. Gneiting,
Probabilistic forecasts of wind speed:
Ensemble model output statistics by using
heteroscedastic censored regression.
Journal of the Royal Statistical Society Series A
173:371–388, 2010.
Log-normal EMOS model:
S. Baran and S. Lerch, Log-normal distribution based Ensemble Model
Output Statistics models for probabilistic wind-speed forecasting.
Quarterly Journal of the Royal Meteorological Society 141:2289–2299,
2015.
Censored and shifted gamma EMOS model:
M. Scheuerer and T. M. Hamill, Statistical post-processing of ensemble precipitation
forecasts by fitting censored, shifted gamma distributions.
Monthly Weather Review 143:4578–4596, 2015.
S. Baran and D. Nemoda, Censored and shifted gamma distribution based EMOS
model for probabilistic quantitative precipitation forecasting.
Environmetrics 27:280–292, 2016.
Censored generalized extreme value distribution EMOS model:
M. Scheuerer, Probabilistic quantitative precipitation forecasting using ensemble
model output statistics. Quarterly Journal of the Royal Meteorological
Society 140:1086–1096, 2014.
trainingData
,
ensembleMOSnormal
,
ensembleMOStruncnormal
,
ensembleMOSlognormal
,
ensembleMOScsg0
,
ensembleMOSgev0
,
controlMOSnormal
,
controlMOStruncnormal
,
controlMOSlognormal
,
controlMOScsg0
,
controlMOSgev0
,
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, model = "normal") ## Same as ## tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25)
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, model = "normal") ## Same as ## tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25)
Fits a censored and shifted gamma EMOS model to ensemble forecasts for specified dates.
ensembleMOScsg0(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOScsg0(), warmStart = FALSE, exchangeable = NULL)
ensembleMOScsg0(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOScsg0(), warmStart = FALSE, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions specified via the function controlMOScsg0. For details and default values, see controlMOScsg0. |
warmStart |
If |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The modeling will have equal parameters within each group.
The default determines exchangeability from |
Given an ensemble of size :
, the
following shifted gamma model left-censored at 0
is fit by
ensembleMOScsg0
:
where denotes the shifted gamma distribution left-censored at zero,
with shape
, scale
and shift
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, and the variance
is a linear
function of the ensemble mean
, see Baran and Nemoda (2016)
for details.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
c , d
|
The fitted parameters for the variance, see details. |
q |
Fitted shift parameter, see details. |
M. Scheuerer and T. M. Hamill, Statistical post-processing of ensemble precipitation forecasts by fitting censored, shifted gamma distributions. Monthly Weather Review 143:4578–4596, 2015.
S. Baran and D. Nemoda, Censored and shifted gamma distribution based EMOS model for probabilistic quantitative precipitation forecasting. Environmetrics 27:280–292, 2016.
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") fitDates <- c("2008010100", "2008010200") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = fitDates)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") fitDates <- c("2008010100", "2008010200") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = fitDates)
Fits a Censored generalized extreme value distribution EMOS model to ensemble forecasts for specified dates.
ensembleMOSgev0(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSgev0(), warmStart = FALSE, exchangeable = NULL)
ensembleMOSgev0(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSgev0(), warmStart = FALSE, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions specified via the function controlMOSgev0. For details and default values, see controlMOSgev0. |
warmStart |
If |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The modeling will have equal parameters within each group.
The default determines exchangeability from |
Given an ensemble of size :
, the
following generalized extreme value distribution EMOS
model left-censored at 0 is fit by
ensembleMOSgev0
:
where denotes the generalized extreme value distribution
left-censored at zero,
with location
, scale
and shape
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, where
denotes the ratio of ensemble forecasts
that are exactly 0, and the shape parameter
is a linear
function of the ensemble variance
, where
is Gini's mean difference.
See ensembleMOSgev0 for details.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
the mean CRPS over the specified training period using
optim
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
s |
A vector of fitted EMOS coefficients for |
c , d
|
The fitted coefficients for the shape parameter, see details. |
q |
Fitted shape parameter, see details. |
M. Scheuerer, Probabilistic quantitative precipitation forecasting using ensemble model output statistics. Quarterly Journal of the Royal Meteorological Society 140:1086–1096, 2014.
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = "2008010100")
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTestFitGEV0 <- ensembleMOSgev0(prcpTestData, trainingDays = 25, dates = "2008010100")
Fits a log-normal EMOS model to ensemble forecasts for specified dates.
ensembleMOSlognormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSlognormal(), warmStart = FALSE, exchangeable = NULL)
ensembleMOSlognormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSlognormal(), warmStart = FALSE, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions specified via the function controlMOStruncnormal. For details and default values, see controlMOStruncnormal. |
warmStart |
If |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The modeling will have equal parameters within each group.
The default determines exchangeability from |
Given an ensemble of size :
, the
following log-normal model is fit by
ensembleMOSlognormal
:
where denotes the log-normal distrbution with
meanlog
parameter and
scalelog
parameter , see
Lognormal. The model is parametrized such that the mean value of
the log-normal distribution is a linear function
of the ensemble forecats, and the variance is a linear function
. For transformations between
and mean
and variance of the log-normal distribution, see Baran and Lerch (2015).
See ensembleMOSlognormal for details.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
c , d
|
The fitted parameters for the variance, see details. |
S. Baran and S. Lerch, Log-normal distribution based Ensemble Model Output Statistics models for probabilistic wind-speed forecasting. Quarterly Journal of the Royal Meteorological Society 141:2289–2299, 2015.
controlMOSlognormal
,
fitMOSlognormal
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitLN <- ensembleMOSlognormal(windTestData, trainingDays = 25)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitLN <- ensembleMOSlognormal(windTestData, trainingDays = 25)
Fits a Gaussian (normal) EMOS model to ensemble forecasts for specified dates.
ensembleMOSnormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSnormal(), warmStart = FALSE, exchangeable = NULL)
ensembleMOSnormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOSnormal(), warmStart = FALSE, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions specified via the function controlMOSnormal. For details and default values, see controlMOSnormal. |
warmStart |
If |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The modeling will have equal parameters within each group.
The default determines exchangeability from |
Given an ensemble of size :
, the
following Gaussian model is fit by
ensembleMOSnormal
:
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
c , d
|
Vectors of the fitted variance parameters for each date, see details. |
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman, Calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Monthly Weather Review 133:1098–1118, 2005.
controlMOSnormal
,
fitMOSnormal
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25)
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOSnormal(tempTestData, trainingDays = 25)
Fits a truncated normal EMOS model to ensemble forecasts for specified dates.
ensembleMOStruncnormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOStruncnormal(), warmStart = FALSE, exchangeable = NULL)
ensembleMOStruncnormal(ensembleData, trainingDays, consecutive = FALSE, dates = NULL, control = controlMOStruncnormal(), warmStart = FALSE, exchangeable = NULL)
ensembleData |
An |
trainingDays |
An integer giving the number of time steps (e.g. days) in the training period. There is no default. |
consecutive |
If |
dates |
The dates for which EMOS forecasting models are desired.
By default, this will be all dates in |
control |
A list of control values for the fitting functions specified via the function controlMOStruncnormal. For details and default values, see controlMOStruncnormal. |
warmStart |
If |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The modeling will have equal parameters within each group.
The default determines exchangeability from |
Given an ensemble of size :
, the
following truncated normal model is fit by
ensembleMOStruncnormal
:
where denotes the normal distribution truncated at zero,
with location
and squared scale
.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
c , d
|
The fitted parameters for the squared scale, see details. |
T. L. Thorarinsdottir and T. Gneiting, Probabilistic forecasts of wind speed: Ensemble model output statistics by using heteroscedastic censored regression. Journal of the Royal Statistical Society Series A 173:371–388, 2010.
controlMOStruncnormal
,
fitMOStruncnormal
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitTN <- ensembleMOStruncnormal(windTestData, trainingDays = 25)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTestFitTN <- ensembleMOStruncnormal(windTestData, trainingDays = 25)
Fits an EMOS model to a given training set.
fitMOS(ensembleData, control = NULL, model = NULL, exchangeable = NULL)
fitMOS(ensembleData, control = NULL, model = NULL, exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions. The corresponding
control function has to be chosen in accordance with the selected
|
model |
A character string describing the EMOS model to be fit.
Current choices are |
exchangeable |
A numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The model fit will have equal weights and parameters
within each group.
The default determines exchangeability from |
A list with estimated coefficient values. The specific content depends on
the chosen model
.
Gaussian (normal) EMOS model:
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman,
Calibrated probabilistic forecasting using ensemble model output
statistics and minimum CRPS estimation.
Monthly Weather Review 133:1098–1118, 2005.
Truncated (normal) EMOS model:
T. L. Thorarinsdottir and T. Gneiting,
Probabilistic forecasts of wind speed:
Ensemble model output statistics by using
heteroscedastic censored regression.
Journal of the Royal Statistical Society Series A
173:371–388, 2010.
Log-normal EMOS model:
S. Baran and S. Lerch, Log-normal distribution based Ensemble Model
Output Statistics models for probabilistic wind-speed forecasting.
Quarterly Journal of the Royal Meteorological Society 141:2289–2299,
2015.
Censored and shifted gamma EMOS model:
M. Scheuerer and T. M. Hamill, Statistical post-processing of ensemble precipitation
forecasts by fitting censored, shifted gamma distributions.
Monthly Weather Review 143:4578–4596, 2015.
S. Baran and D. Nemoda, Censored and shifted gamma distribution based EMOS
model for probabilistic quantitative precipitation forecasting.
Environmetrics 27:280–292, 2016.
Censored generalized extreme value distribution EMOS model:
M. Scheuerer, Probabilistic quantitative precipitation forecasting using ensemble
model output statistics. Quarterly Journal of the Royal Meteorological
Society 140:1086–1096, 2014.
fitMOSnormal fitMOStruncnormal fitMOSlognormal fitMOScsg0 fitMOSgev0 controlMOSnormal controlMOStruncnormal controlMOSlognormal controlMOScsg0 controlMOSgev0
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOS(tempTrain, model = "normal") ## equivalent to ## tempTrainFit <- fitMOSnormal(tempTrain)
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOS(tempTrain, model = "normal") ## equivalent to ## tempTrainFit <- fitMOSnormal(tempTrain)
Fits a censored and shifted gamma EMOS model to a given training set.
fitMOScsg0(ensembleData, control = controlMOScsg0(), exchangeable = NULL)
fitMOScsg0(ensembleData, control = controlMOScsg0(), exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions specified via the function controlMOScsg0. For details and default values, see controlMOScsg0. |
exchangeable |
An optional numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The models have equal EMOS coefficients within each group.
If supplied, this argument will override any specification of
exchangeability in |
Given an ensemble of size :
, the
following shifted gamma model left-censored at 0
is fit by
ensembleMOScsg0
:
where denotes the shifted gamma distribution left-censored at zero,
with shape
, scale
and shift
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, and the variance
is a linear
function of the ensemble mean
, see Baran and Nemoda (2016)
for details.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
c , d
|
The fitted parameters for the variance, see details. |
q |
Fitted shift parameter, see details. |
M. Scheuerer and T. M. Hamill, Statistical post-processing of ensemble precipitation forecasts by fitting censored, shifted gamma distributions. Monthly Weather Review 143:4578–4596, 2015.
S. Baran and D. Nemoda, Censored and shifted gamma distribution based EMOS model for probabilistic quantitative precipitation forecasting. Environmetrics 27:280–292, 2016.
controlMOScsg0
,
ensembleMOScsg0
,
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTrain <- trainingData(prcpTestData, trainingDays = 30, date = "2008010100") prcpTestFit <- fitMOScsg0(prcpTrain)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTrain <- trainingData(prcpTestData, trainingDays = 30, date = "2008010100") prcpTestFit <- fitMOScsg0(prcpTrain)
Fits a censored generalized extreme value distribution EMOS model to a given training set.
fitMOSgev0(ensembleData, control = controlMOSgev0(), exchangeable = NULL)
fitMOSgev0(ensembleData, control = controlMOSgev0(), exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions specified via the function controlMOSgev0. For details and default values, see controlMOSgev0. |
exchangeable |
An optional numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The models have equal EMOS coefficients within each group.
If supplied, this argument will override any specification of
exchangeability in |
Given an ensemble of size :
, the
following generalized extreme value distribution EMOS
model left-censored at 0 is fit by
ensembleMOSgev0
:
where denotes the generalized extreme value distribution
left-censored at zero,
with location
, scale
and shape
. The model is
parametrized such that the mean
is a linear function
of the ensemble forecats, where
denotes the ratio of ensemble forecasts
that are exactly 0, and the shape parameter
is a linear
function of the ensemble variance
, where
is Gini's mean difference.
See ensembleMOSgev0 for details.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
the mean CRPS over the specified training period using
optim
.
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 date. |
a |
A vector of fitted EMOS intercept parameters for each date. |
B |
A matrix of fitted EMOS coefficients for each date. |
s |
A vector of fitted EMOS coefficients for |
c , d
|
The fitted coefficients for the shape parameter, see details. |
q |
Fitted shape parameter, see details. |
M. Scheuerer, Probabilistic quantitative precipitation forecasting using ensemble model output statistics. Quarterly Journal of the Royal Meteorological Society 140:1086–1096, 2014.
controlMOSgev0
,
ensembleMOSgev0
,
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTrain <- trainingData(prcpTestData, trainingDays = 30, date = "2008010100") prcpTestFit <- fitMOSgev0(prcpTrain)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") 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") prcpTrain <- trainingData(prcpTestData, trainingDays = 30, date = "2008010100") prcpTestFit <- fitMOSgev0(prcpTrain)
Fits a log-normal EMOS model to a given training set.
fitMOSlognormal(ensembleData, control = controlMOSlognormal(), exchangeable = NULL)
fitMOSlognormal(ensembleData, control = controlMOSlognormal(), exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions specified via the function controlMOSlognormal. For details and default values, see controlMOSlognormal. |
exchangeable |
An optional numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The models have equal EMOS coefficients within each group.
If supplied, this argument will override any specification of
exchangeability in |
Given an ensemble of size :
, the
following log-normal model is fit by
ensembleMOSlognormal
:
where denotes the log-normal distrbution with
meanlog
parameter and
scalelog
parameter , see
Lognormal. The model is parametrized such that the mean value of
the log-normal distribution is a linear function
of the ensemble forecats, and the variance is a linear function
. For transformations between
and mean
and variance of the log-normal distribution, see Baran and Lerch (2015).
See ensembleMOSlognormal for details.
A list with the following output components:
a |
The fitted intercept. |
B |
The fitted EMOS coefficients. |
c , d
|
The fitted parameters for the variance, see details. |
S. Baran and S. Lerch, Log-normal distribution based Ensemble Model Output Statistics models for probabilistic wind-speed forecasting. Quarterly Journal of the Royal Meteorological Society 141:2289–2299, 2015.
controlMOSlognormal
,
ensembleMOSlognormal
,
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTrain <- trainingData(windTestData, trainingDays = 30, date = "2008010100") windTestFit <- fitMOSlognormal(windTrain)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTrain <- trainingData(windTestData, trainingDays = 30, date = "2008010100") windTestFit <- fitMOSlognormal(windTrain)
Fits a Gaussian (normal) EMOS model to a given training set.
fitMOSnormal(ensembleData, control = controlMOSnormal(), exchangeable = NULL)
fitMOSnormal(ensembleData, control = controlMOSnormal(), exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions specified via the function controlMOSnormal. For details and default values, see controlMOSnormal. |
exchangeable |
An optional numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The models have equal EMOS coefficients within each group.
If supplied, this argument will override any specification of
exchangeability in |
Given an ensemble of size :
, the
following Gaussian model is fit by
ensembleMOSnormal
:
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
A list with the following output components:
a |
The fitted intercept. |
B |
The fitted EMOS coefficients. |
c , d
|
The fitted variance parameters, see details. |
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman, Calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Monthly Weather Review 133:1098–1118, 2005.
controlMOSnormal
,
ensembleMOSnormal
,
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOSnormal(tempTrain)
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOSnormal(tempTrain)
Fits a truncated normal EMOS model to a given training set.
fitMOStruncnormal(ensembleData, control = controlMOStruncnormal(), exchangeable = NULL)
fitMOStruncnormal(ensembleData, control = controlMOStruncnormal(), exchangeable = NULL)
ensembleData |
An |
control |
A list of control values for the fitting functions specified via the function controlMOStruncnormal. For details and default values, see controlMOStruncnormal. |
exchangeable |
An optional numeric or character vector or factor indicating groups of
ensemble members that are exchangeable (indistinguishable).
The models have equal EMOS coefficients within each group.
If supplied, this argument will override any specification of
exchangeability in |
Given an ensemble of size :
, the
following truncated normal model is fit by
ensembleMOStruncnormal
:
where denotes the normal distribution truncated at zero,
with location
and squared scale
.
B
is a vector of fitted regression coefficients: . Specifically,
are
fitted to optimize
control$scoringRule
over the specified training period using
optim
with method = control$optimRule
.
A list with the following output components:
a |
The fitted intercept. |
B |
The fitted EMOS coefficients. |
c , d
|
The fitted parameters for the squared scale, see details. |
T. L. Thorarinsdottir and T. Gneiting, Probabilistic forecasts of wind speed: Ensemble model output statistics by using heteroscedastic censored regression. Journal of the Royal Statistical Society Series A 173:371–388, 2010.
controlMOStruncnormal
,
ensembleMOStruncnormal
,
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTrain <- trainingData(windTestData, trainingDays = 30, date = "2008010100") windTestFit <- fitMOStruncnormal(windTrain)
data("ensBMAtest", package = "ensembleBMA") ensMemNames <- c("gfs","cmcg","eta","gasp","jma","ngps","tcwb","ukmo") obs <- paste("MAXWSP10","obs", sep = ".") ens <- paste("MAXWSP10", ensMemNames, sep = ".") windTestData <- ensembleData(forecasts = ensBMAtest[,ens], dates = ensBMAtest[,"vdate"], observations = ensBMAtest[,obs], station = ensBMAtest[,"station"], forecastHour = 48, initializationTime = "00") windTrain <- trainingData(windTestData, trainingDays = 30, date = "2008010100") windTestFit <- fitMOStruncnormal(windTrain)
Computes the parameters of the forecast distribution resulting for univariate ensemble forecasting models.
pars(fit, ensembleData, dates=NULL, ...)
pars(fit, ensembleData, dates=NULL, ...)
fit |
A model fit to ensemble forecasting data, obtained using
|
ensembleData |
An |
dates |
The dates for which the parameters will be computed.
These dates must be consistent with |
... |
Included for generic function compatibility. |
These methods are generic, and can be applied to all ensemble forecasting models.
pars
is a matrix giving the distribution parameter values
for each instance in the data. The returned parameters denoted in
the column names depend on the model used to generate the
fit
object.
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = c("2008010100", "2008010200"), model = "normal") parValues <- pars(tempTestFit, tempTestData) parValues
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = c("2008010100", "2008010200"), model = "normal") parValues <- pars(tempTestFit, tempTestData) parValues
Computes quantiles for the probability distribution function (PDF) for ensemble forecasting models.
quantileForecast(fit, ensembleData, quantiles = 0.5, dates = NULL, ...)
quantileForecast(fit, ensembleData, quantiles = 0.5, dates = NULL, ...)
fit |
A model fit to ensemble forecasting data. |
ensembleData |
An |
quantiles |
The vector of desired quantiles for the PDF of the EMOS model. |
dates |
The dates for which the quantile forecasts will be computed.
These dates must be consistent with |
... |
Included for generic function compatibility. |
This method is generic, and can be applied to any ensemble forecasting model. This can be used to compute prediction intervals for the PDF.
A matrix of forecasts corresponding to the desired quantiles.
T. Gneiting, A. E. Raftery, A. H. Westveld and T. Goldman, Calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Monthly Weather Review 133:1098–1118, 2005.
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = c("2008010100", "2008010200"), model = "normal") tempTestForc <- quantileForecast(tempTestFit, tempTestData)
data("ensBMAtest", package = "ensembleBMA") 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") tempTestFit <- ensembleMOS(tempTestData, trainingDays = 25, dates = c("2008010100", "2008010200"), model = "normal") tempTestForc <- quantileForecast(tempTestFit, tempTestData)
Extracts a subset of an ensembleData
object corresponding
to a given date and number of training days.
trainingData(ensembleData, trainingDays, consecutive = FALSE, date)
trainingData(ensembleData, trainingDays, consecutive = FALSE, date)
ensembleData |
An |
trainingDays |
An integer specifying the number of days in the training period. |
consecutive |
If |
date |
The date for which the training data is desired. |
An ensembleData
object corresponding to the training data for
the given date relative to ensembleData
.
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, December 2008.
Available at: http://www.stat.washington.edu/research/reports/
C. Fraley, A. E. Raftery and T. Gneiting, Calibrating multi-model forecast ensembles with exchangeable and missing members using Bayesian model averaging, Monthly Weather Review 138:190-202, 2010.
ensembleMOSnormal
,
fitMOSnormal
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOSnormal(tempTrain)
data("ensBMAtest", package = "ensembleBMA") 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") tempTrain <- trainingData(tempTestData, trainingDays = 30, date = "2008010100") tempTrainFit <- fitMOSnormal(tempTrain)