-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor interval scores and improve testing (#82)
* exclude type checking blocks from test coverage report * fix failing tests for weighted interval score * refactoring and fixes to interval scores * update docs for interval scores * improve testing for interval scores * run formatting
- Loading branch information
Showing
18 changed files
with
335 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,5 @@ | ||
# Interval Score | ||
|
||
## Interval or Winkler Score | ||
|
||
For a prediction interval (PI), the interval or Winkler score is given by: | ||
|
||
$$ | ||
\text{IS} = \begin{cases} | ||
(u - l) + \frac{2}{\alpha}(l - y) & \text{for } y < l \\ | ||
(u - l) & \text{for } l \leq y \leq u \\ | ||
(u - l) + \frac{2}{\alpha}(y - u) & \text{for } y > u. \\ | ||
\end{cases} | ||
$$ | ||
|
||
for an $(1 - \alpha)$PI of $[l, u]$ and the true value $y$ [@gneiting_strictly_2007, @bracher2021evaluating @winkler1972decision]. | ||
|
||
## Weighted Interval Score | ||
|
||
The weighted interval score (WIS) is defined as | ||
|
||
$$ | ||
\text{WIS}_{\alpha_{0:K}}(F, y) = \frac{1}{K+0.5}(w_0 \times |y - m| + \sum_{k=1}^K (w_k \times IS_{\alpha_k}(F, y))) | ||
$$ | ||
|
||
where $m$ denotes the median prediction, $w_0$ denotes the weight of the median prediction, $IS_{\alpha_k}(F, y)$ denotes the interval score for the $1 - \alpha$ prediction interval and $w_k$ is the according weight. The WIS is calculated for a set of (central) PIs and the predictive median [@bracher2021evaluating]. The weights are an optional parameter and default weight is the canonical weight $w_k = \frac{2}{\alpha_k}$ and $w_0 = 0.5$. For these weights, it holds that: | ||
|
||
$$ | ||
\text{WIS}_{\alpha_{0:K}}(F, y) \approx \text{CRPS}(F, y). | ||
$$ | ||
|
||
|
||
::: scoringrules.interval_score | ||
|
||
::: scoringrules.weighted_interval_score |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.