qpred: Quantile function of IDR or raw forecasts

Description Usage Arguments Details Value See Also Examples

View source: R/evaluation.R

Description

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

Usage

1
2
3
4
5
6
7
qpred(predictions, quantiles)

## S3 method for class 'idr'
qpred(predictions, quantiles)

## S3 method for class '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.

Details

The quantiles are defined as lower quantiles, that is,

q(u) = inf(x: cdf(x) >= u).

Value

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

See Also

predict.idrfit, cdf, qscore

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

isodistrreg documentation built on March 22, 2021, 5:06 p.m.