Kernel scores
+ + ++ scoringrules.gksuv_ensemble + + +
+gksuv_ensemble(
+ observations: ArrayLike,
+ forecasts: Array,
+ /,
+ axis: int = -1,
+ *,
+ estimator: str = "nrg",
+ backend: Backend = None,
+) -> Array
+
Compute the univariate Gaussian Kernel Score (GKS) for a finite ensemble.
+The GKS is the kernel score associated with the Gaussian kernel
+Given an ensemble forecast \(F_{ens}\) comprised of members \(x_{1}, \dots, x_{M}\), +the GKS is
+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:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ ArrayLike
+ |
+
+
+
+ The observed values. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ The predicted forecast ensemble, where the ensemble dimension is by default +represented by the last axis. + |
+ + required + | +
axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble. Default is the last axis. + |
+
+ -1
+ |
+
estimator |
+
+ str
+ |
+
+
+
+ Indicates the estimator to be used. + |
+
+ 'nrg'
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ Array
+ |
+
+
+
+ The GKS between the forecast ensemble and obs. + |
+
Examples:
+ + ++ scoringrules.twgksuv_ensemble + + +
+twgksuv_ensemble(
+ observations: ArrayLike,
+ forecasts: Array,
+ v_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ axis: int = -1,
+ *,
+ estimator: str = "nrg",
+ backend: Backend = None,
+) -> Array
+
Compute the Threshold-Weighted univariate Gaussian Kernel Score (GKS) for a finite ensemble.
+Computation is performed using the ensemble representation of threshold-weighted kernel scores in +Allen et al. (2022).
+where \(F_{ens}(x) = \sum_{m=1}^{M} 1 \{ x_{m} \leq x \}/M\) is the empirical +distribution function associated with an ensemble forecast \(x_{1}, \dots, x_{M}\) with +\(M\) members, \(v\) is the chaining function used to target particular outcomes, and
+is the Gaussian kernel.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ ArrayLike
+ |
+
+
+
+ The observed values. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ The predicted forecast ensemble, where the ensemble dimension is by default +represented by the last axis. + |
+ + required + | +
v_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Chaining function used to emphasise particular outcomes. For example, a function that +only considers values above a certain threshold \(t\) by projecting forecasts and observations +to \([t, \inf)\). + |
+ + required + | +
axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble. Default is the last axis. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
twgks |
+ ArrayLike
+ |
+
+
+
+ The twGKS between the forecast ensemble and obs for the chosen chaining function. + |
+
Examples:
+ + ++ scoringrules.owgksuv_ensemble + + +
+owgksuv_ensemble(
+ observations: ArrayLike,
+ forecasts: Array,
+ w_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ axis: int = -1,
+ *,
+ backend: Backend = None,
+) -> Array
+
Compute the univariate Outcome-Weighted Gaussian Kernel Score (owGKS) for a finite ensemble.
+Computation is performed using the ensemble representation of the owCRPS in +Allen et al. (2022):
+where \(F_{ens}(x) = \sum_{m=1}^{M} 1\{ x_{m} \leq x \}/M\) is the empirical +distribution function associated with an ensemble forecast \(x_{1}, \dots, x_{M}\) with +\(M\) members, \(w\) is the chosen weight function, \(\bar{w} = \sum_{m=1}^{M}w(x_{m})/M\), +and
+is the Gaussian kernel.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ ArrayLike
+ |
+
+
+
+ The observed values. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ The predicted forecast ensemble, where the ensemble dimension is by default +represented by the last axis. + |
+ + required + | +
w_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Weight function used to emphasise particular outcomes. + |
+ + required + | +
axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble. Default is the last axis. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ ArrayLike
+ |
+
+
+
+ The owGKS between the forecast ensemble and obs for the chosen weight function. + |
+
Examples:
+ + ++ scoringrules.vrgksuv_ensemble + + +
+vrgksuv_ensemble(
+ observations: ArrayLike,
+ forecasts: Array,
+ w_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ axis: int = -1,
+ *,
+ backend: Backend = None,
+) -> Array
+
Estimate the Vertically Re-scaled Gaussian Kernel Score (vrGKS) for a finite ensemble.
+Computation is performed using the ensemble representation of vertically re-scaled kernel scores in +Allen et al. (2022):
+where \(F_{ens}(x) = \sum_{m=1}^{M} 1 \{ x_{m} \leq x \}/M\) is the empirical +distribution function associated with an ensemble forecast \(x_{1}, \dots, x_{M}\) with +\(M\) members, \(w\) is the chosen weight function, \(\bar{w} = \sum_{m=1}^{M}w(x_{m})/M\), and
+is the Gaussian kernel.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ ArrayLike
+ |
+
+
+
+ The observed values. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ The predicted forecast ensemble, where the ensemble dimension is by default +represented by the last axis. + |
+ + required + | +
w_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Weight function used to emphasise particular outcomes. + |
+ + required + | +
axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble. Default is the last axis. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ ArrayLike
+ |
+
+
+
+ The vrGKS between the forecast ensemble and obs for the chosen weight function. + |
+
Examples:
+ + ++ scoringrules.gksmv_ensemble + + +
+gksmv_ensemble(
+ observations: Array,
+ forecasts: Array,
+ /,
+ m_axis: int = -2,
+ v_axis: int = -1,
+ *,
+ 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
+where $ | \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
+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:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ Array
+ |
+
+
+
+ The observed values, where the variables dimension is by default the last axis. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ 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. + |
+ + required + | +
m_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble dimension on the forecasts array. Defaults to -2. + |
+
+ -2
+ |
+
v_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the variables dimension on the forecasts array (or the observations
+array with an extra dimension on |
+
+ -1
+ |
+
estimator |
+
+ str
+ |
+
+
+
+ Indicates the estimator to be used. + |
+
+ 'nrg'
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ Array
+ |
+
+
+
+ The GKS between the forecast ensemble and obs. + |
+
+ scoringrules.twgksmv_ensemble + + +
+twgksmv_ensemble(
+ observations: Array,
+ forecasts: Array,
+ v_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ m_axis: int = -2,
+ v_axis: int = -1,
+ *,
+ backend: Backend = None,
+) -> Array
+
Compute the Threshold-Weighted Gaussian Kernel Score (twGKS) for a finite multivariate ensemble.
+Computation is performed using the ensemble representation of threshold-weighted kernel scores in +Allen et al. (2022):
+where \(F_{ens}\) is the ensemble forecast \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\) with +\(M\) members, \(\| \cdotp \|\) is the Euclidean distance, \(v\) is the chaining function +used to target particular outcomes, and
+is the Gaussian kernel.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ Array
+ |
+
+
+
+ The observed values, where the variables dimension is by default the last axis. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ 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. + |
+ + required + | +
v_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Chaining function used to emphasise particular outcomes. + |
+ + required + | +
m_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble dimension. Defaults to -2. + |
+
+ -2
+ |
+
v_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the variables dimension. Defaults to -1. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ ArrayLike of shape (...)
+ |
+
+
+
+ The computed Threshold-Weighted Gaussian Kernel Score. + |
+
+ scoringrules.owgksmv_ensemble + + +
+owgksmv_ensemble(
+ observations: Array,
+ forecasts: Array,
+ w_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ m_axis: int = -2,
+ v_axis: int = -1,
+ *,
+ backend: Backend = None,
+) -> Array
+
Compute the multivariate Outcome-Weighted Gaussian Kernel Score (owGKS) for a finite ensemble.
+Given an ensemble forecast \(F_{ens}\) comprised of multivariate members \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\), +the GKS is
+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)\).
+Computation is performed using the ensemble representation of outcome-weighted kernel scores in +Allen et al. (2022):
+where \(F_{ens}\) is the ensemble forecast \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\) with +\(M\) members, \(\| \cdotp \|\) is the Euclidean distance, \(w\) is the chosen weight function, +\(\bar{w} = \sum_{m=1}^{M}w(\mathbf{x}_{m})/M\), and
+is the multivariate Gaussian kernel, with $ | \cdot |$ the Euclidean norm.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ Array
+ |
+
+
+
+ The observed values, where the variables dimension is by default the last axis. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ 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. + |
+ + required + | +
w_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Weight function used to emphasise particular outcomes. + |
+ + required + | +
m_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble dimension. Defaults to -2. + |
+
+ -2
+ |
+
v_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the variables dimension. Defaults to -1. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ ArrayLike of shape (...)
+ |
+
+
+
+ The computed Outcome-Weighted GKS. + |
+
+ scoringrules.vrgksmv_ensemble + + +
+vrgksmv_ensemble(
+ observations: Array,
+ forecasts: Array,
+ w_func: tp.Callable[[ArrayLike], ArrayLike],
+ /,
+ *,
+ m_axis: int = -2,
+ v_axis: int = -1,
+ backend: Backend = None,
+) -> Array
+
Compute the Vertically Re-scaled Gaussian Kernel Score (vrGKS) for a finite multivariate ensemble.
+Computation is performed using the ensemble representation of vertically re-scaled kernel scores in +Allen et al. (2022):
+where \(F_{ens}\) is the ensemble forecast \(\mathbf{x}_{1}, \dots, \mathbf{x}_{M}\) with +\(M\) members, \(w\) is the weight function used to target particular outcomes, and
+is the multivariate Gaussian kernel, with $ | \cdot |$ the Euclidean norm.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
observations |
+
+ Array
+ |
+
+
+
+ The observed values, where the variables dimension is by default the last axis. + |
+ + required + | +
forecasts |
+
+ Array
+ |
+
+
+
+ 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. + |
+ + required + | +
w_func |
+
+ Callable[[ArrayLike], ArrayLike]
+ |
+
+
+
+ Weight function used to emphasise particular outcomes. + |
+ + required + | +
m_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the ensemble dimension. Defaults to -2. + |
+
+ -2
+ |
+
v_axis |
+
+ int
+ |
+
+
+
+ The axis corresponding to the variables dimension. Defaults to -1. + |
+
+ -1
+ |
+
backend |
+
+ Backend
+ |
+
+
+
+ The name of the backend used for computations. Defaults to 'numba' if available, else 'numpy'. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
score |
+ ArrayLike of shape (...)
+ |
+
+
+
+ The computed Vertically Re-scaled Gaussian Kernel Score. + |
+