Learn R Programming

isodistrreg (version 0.1.0)

qpred: Quantile function of IDR or raw forecasts

Description

Evaluate the the quantile function of IDR predictions or of unprocessed forecasts in a data.frame.

Usage

qpred(predictions, quantiles)

# S3 method for idr qpred(predictions, quantiles)

# S3 method for data.frame qpred(predictions, quantiles)

Arguments

predictions

either an object of class idr (output of predict.idrfit), or a data.frame of numeric variables. In the latter case, quantiles are computed using the empirical distribution of the variables in predictions.

quantiles

numeric vector of desired quantiles.

Value

A matrix of forecasts for the desired quantiles, one column per quantile.

Details

The quantiles are defined as lower quantiles, that is, $$ q(u) = inf(x: cdf(x) >= u). $$

See Also

predict.idrfit, cdf, qscore

Examples

Run this code
# NOT RUN {
data("rain")

## Postprocess HRES forecast using data of 3 years

X <- rain[1:(3 * 365), "HRES", drop = FALSE]
y <- rain[1:(3 * 365), "obs"]

fit <- idr(y = y, X = X)

## Compute 95%-quantile forecast given that the HRES forecast is
## 2.5 mm, 5 mm or 10 mm

predictions <- predict(fit, data = data.frame(HRES = c(2.5, 5, 10)))
qpred(predictions, quantiles = 0.95)
# }

Run the code above in your browser using DataLab