scoringrules.gksmv_ensemble#
- scoringrules.gksmv_ensemble(obs: Array, fct: Array, m_axis: int = -2, v_axis: int = -1, *, ens_w: Array = None, estimator: str = 'nrg', backend: Backend = None) Array#
Compute the multivariate Gaussian Kernel Score (GKS) for a finite ensemble.
The GKS is the kernel score associated with the Gaussian kernel
\[k(x_{1}, x_{2}) = \exp \left(- \frac{ \| x_{1} - x_{2} \| ^{2}}{2} \right),\]where :math:` | cdot |` is the euclidean norm.
Given an ensemble forecast \(F_{ens}\) comprised of multivariate members \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\), the GKS is
\[\text{GKS}(F_{ens}, y)= - \frac{1}{M} \sum_{m=1}^{M} k(\mathbf{x}_{m}, \mathbf{y}) + \frac{1}{2 M^{2}} \sum_{m=1}^{M} \sum_{j=1}^{M} k(\mathbf{x}_{m}, \mathbf{x}_{j}) + \frac{1}{2}k(y, y)\]If the fair estimator is to be used, then \(M^{2}\) in the second component of the right-hand-side is replaced with \(M(M - 1)\).
- 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.
- m_axisint
The axis corresponding to the ensemble dimension on the forecasts array. Defaults to -2.
- v_axisint
The axis corresponding to the variables dimension on the forecasts array (or the observations array with an extra dimension on m_axis). 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.
- estimatorstr
Indicates the estimator to be used.
- backendstr
The name of the backend used for computations. Defaults to ‘numba’ if available, else ‘numpy’.
- Returns:
- scorearray_like
The GKS between the forecast ensemble and obs.