scoringrules.vres_ensemble

Contents

scoringrules.vres_ensemble#

scoringrules.vres_ensemble(obs: Array, fct: Array, w_func: Callable[[ArrayLike], ArrayLike], *, ens_w: Array = None, m_axis: int = -2, v_axis: int = -1, backend: Backend = None) Array#

Compute the Vertically Re-scaled Energy Score (vrES) for a finite multivariate ensemble.

Computation is performed using the ensemble representation of the vrES in [Allen et al. (2022)](https://arxiv.org/abs/2202.12732):

\[\begin{split}\begin{split} \mathrm{vrES}(F_{ens}, \mathbf{y}) = & \frac{1}{M} \sum_{m = 1}^{M} \| \mathbf{x}_{m} - \mathbf{y} \| w(\mathbf{x}_{m}) w(\mathbf{y}) - \frac{1}{2 M^{2}} \sum_{m = 1}^{M} \sum_{j = 1}^{M} \| \mathbf{x}_{m} - \mathbf{x}_{j} \| w(\mathbf{x}_{m}) w(\mathbf{x_{j}}) \\ & + \left( \frac{1}{M} \sum_{m = 1}^{M} \| \mathbf{x}_{m} \| w(\mathbf{x}_{m}) - \| \mathbf{y} \| w(\mathbf{y}) \right) \left( \frac{1}{M} \sum_{m = 1}^{M} w(\mathbf{x}_{m}) - w(\mathbf{y}) \right), \end{split}\end{split}\]

where \(F_{ens}\) is the ensemble forecast \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\) with \(M\) members, and \(w\) is the weight function used to target particular outcomes.

Parameters:
obsarray_like

The observed values, where the variables dimension is by default the last axis.

fctarray_like

The predicted forecast ensemble, where the ensemble dimension is by default represented by the second last axis and the variables dimension by the last axis.

w_funccallable, array_like -> array_like

Weight function used to emphasise particular outcomes.

m_axisint

The axis corresponding to the ensemble dimension. Defaults to -2.

v_axisint or tuple of int

The axis corresponding to the variables dimension. Defaults to -1.

ens_warray_like

Weights assigned to the ensemble members. Array with one less dimension than fct (without the v_axis dimension). Default is equal weighting. Weights are normalised so that they sum to one across the ensemble members.

backendstr

The name of the backend used for computations. Defaults to ‘numba’ if available, else ‘numpy’.

Returns:
vres_ensemblearray_like

The computed Vertically Re-scaled Energy Score.