Skip to content

Commit

Permalink
Add weighted versions of the Gaussian kernel score (#77)
Browse files Browse the repository at this point in the history
* fix lint issues in gaussian kernel score

* fix lint issues in gaussian kernel score test

* fix lint issues in gaussian kernel score test

* fix lint issues in multivariate gaussian kernel score test

* add threshold-weighted univariate gaussian kernel score

* add threshold-weighted univariate gaussian kernel score

* add tests for threshold weighted univariate gaussian kernel score

* add outcome-weighted gaussian kernel scores

* add multivariate threshold weighted gaussian kernel score

* re-add univariate weighted gaussian kernel scores

* re-add univariate weighted gaussian kernel scores

* fix bug in weighted gaussian kernel scores for torch backend

* fix bug in weighted multivariate gaussian kernel scores

* fix bug in weighted multivariate gaussian kernel scores
  • Loading branch information
sallen12 authored Oct 8, 2024
1 parent c2f9923 commit 1039564
Show file tree
Hide file tree
Showing 10 changed files with 1,052 additions and 29 deletions.
16 changes: 15 additions & 1 deletion docs/api/kernels.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Kernel scores

::: scoringrules.gks_ensemble
::: scoringrules.gksuv_ensemble

::: scoringrules.twgksuv_ensemble

::: scoringrules.owgksuv_ensemble

::: scoringrules.vrgksuv_ensemble

::: scoringrules.gksmv_ensemble

::: scoringrules.twgksmv_ensemble

::: scoringrules.owgksmv_ensemble

::: scoringrules.vrgksmv_ensemble
16 changes: 14 additions & 2 deletions scoringrules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@
)
from scoringrules._kernels import (
gksuv_ensemble,
twgksuv_ensemble,
owgksuv_ensemble,
vrgksuv_ensemble,
gksmv_ensemble,
twgksmv_ensemble,
owgksmv_ensemble,
vrgksmv_ensemble,
)

from scoringrules.backend import backends, register_backend
Expand Down Expand Up @@ -159,8 +165,6 @@
"rps_score",
"log_score",
"rls_score",
"gksuv_ensemble",
"gksmv_ensemble",
"error_spread_score",
"energy_score",
"owenergy_score",
Expand All @@ -170,6 +174,14 @@
"owvariogram_score",
"twvariogram_score",
"vrvariogram_score",
"gksuv_ensemble",
"twgksuv_ensemble",
"owgksuv_ensemble",
"vrgksuv_ensemble",
"gksmv_ensemble",
"twgksmv_ensemble",
"owgksmv_ensemble",
"vrgksmv_ensemble",
"interval_score",
"weighted_interval_score",
]
4 changes: 2 additions & 2 deletions scoringrules/_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def vrenergy_score(
) -> "Array":
r"""Compute the Vertically Re-scaled Energy Score (vrES) for a finite multivariate ensemble.
Computation is performed using the ensemble representation of the twES in
Computation is performed using the ensemble representation of the vrES in
[Allen et al. (2022)](https://arxiv.org/abs/2202.12732):
\[
Expand All @@ -196,7 +196,7 @@ def vrenergy_score(
\]
where $F_{ens}$ is the ensemble forecast $\mathbf{x}_{1}, \dots, \mathbf{x}_{M}$ with
$M$ members, and $v$ is the chaining function used to target particular outcomes.
$M$ members, and $w$ is the weight function used to target particular outcomes.
Parameters
Expand Down
Loading

0 comments on commit 1039564

Please sign in to comment.