pinball: Calculate the pinball loss between actual and the predicted...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

pinball calculates the goodness of fit between an actual quantity, e.g. electricity demand, and a predicted quantile of that quantity.

Usage

1
pinball(y_act, y_pred, qu, dosum = 1)

Arguments

y_act

a single number or numerical vector of actual quantities

y_pred

the predicted quantile of that quantity

qu

the target quantile 0 < qu < 1

dosum

when 1, return the pinball loss as a single number

Value

a vector of pinball values, or their sum, depending on value of dosum

Examples

1
2
3
4
5
6
7
## Not run: 
act = rep(2700, 3)
pred = rep(2671, 3)
ploss = pinball( act, pred, 0.1)
# should return 8.7

## End(Not run)

tvwallace/gefcom17Model documentation built on Jan. 23, 2021, 12:48 a.m.