Skip to contents

Given the desired quantile pairs, create a function wrapping accuracy() which passes those quantile pairs to it.

Usage

make_accuracy(quant_pairs)

Arguments

quant_pairs

See ?accuracy

Value

A function wrapping accuracy() with the given quantile pairs

Examples

fc <- create_forecast(list(
  time=1:3,
  vals=list(c(4,7,8), c(5,6,7), c(4,6,6))
))
obs <- data.frame(time=1:3, val_obs=5:7)

acc <- make_accuracy(c(5,95))
acc(fc, obs)
#> Scoring accuracy using quantile pairs c(5, 95)
#> Used 3 time points to calculate accuracy
#> [1] 0.6666667

plot_forecast(fc, obs, score=make_accuracy(c(25,75)))
#> Scoring accuracy using quantile pairs c(25, 75)