pykelihood.metrics.

quantile_score#

quantile_score(distribution, data, quantile)#

Quantile score.

Probability weighted score evaluating the difference between the fitted quantile and the observed one.

\[\begin{split}QS = \begin{cases} q \cdot (y - F^{-1}(q)) & \text{if } y \geq F^{-1}(q), \\ (1 - q) \cdot (F^{-1}(q) - y) & \text{otherwise}, \end{cases}\end{split}\]

where \(F^{-1}(q)\) is the fitted inverse cumulative distribution function at quantile \(q\).

Parameters:
  • distribution (Distribution) – pykelihood.Distribution object.

  • data (Obs) – Data of type Obs.

  • quantile (float) – Quantile of interest.

Raises:

ValueError – If quantile is not between 0 and 1.