Learn R Programming

ensembleMOS (version 0.8.2)

pars: Forecast distribution parameters

Description

Computes the parameters of the forecast distribution resulting for univariate ensemble forecasting models.

Usage

pars(fit, ensembleData, dates=NULL, …)

Arguments

fit

A model fit to ensemble forecasting data, obtained using fitMOS or ensembleMOS.

ensembleData

An ensembleData object that includes ensemble forecasts, verification observations and possibly dates. Missing values (indicated by NA) are allowed. This need not be the data used for the model fit, although it must include the same ensemble members.

dates

The dates for which the parameters will be computed. These dates must be consistent with fit and ensembleData. The default is to use all of the dates in fit. The dates are ignored if fit originates from fitMOS, which also ignores date information.

Included for generic function compatibility.

Value

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.

Details

These methods are generic, and can be applied to all ensemble forecasting models.

See Also

ensembleMOS, fitMOS

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab