scoringrules.logs_ensemble

Contents

scoringrules.logs_ensemble#

scoringrules.logs_ensemble(obs: ArrayLike, fct: Array, m_axis: int = -1, *, bw: ArrayLike = None, backend: Backend = None) Array#

Estimate the Logarithmic score for a finite ensemble via kernel density estimation.

Gaussian kernel density estimation is used to convert the finite ensemble to a mixture of normal distributions, with the component distributions centred at each ensemble member, with scale equal to the bandwidth parameter ‘bw’.

The log score for the ensemble forecast is then the log score for the mixture of normal distributions.

Parameters:
obsarray_like

The observed values.

fctarray_like

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

m_axisint

The axis corresponding to the ensemble. Default is the last axis.

bwarray_like

The bandwidth parameter for each forecast ensemble. If not given, estimated using Silverman’s rule of thumb.

backendstr

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

Returns:
scorearray_like

The LS between the forecast ensemble and obs.

Examples

>>> import scoringrules as sr
>>> sr.logs_ensemble(obs, pred)