- xskillscore.threshold_brier_score(observations, forecasts, threshold, issorted=False, member_dim='member', dim=None, weights=None, keep_attrs=False)
Calculate the Brier scores of an ensemble for exceeding given thresholds.
threshold (scalar or 1d scalar) – Threshold values at which to calculate exceedence Brier scores.
issorted (bool, optional) – Optimization flag to indicate that the elements of ensemble are already sorted along axis.
member_dim (str, optional) – Name of ensemble member dimension. By default, ‘member’.
dim (str or list of str, optional) – Dimension over which to compute mean after computing
threshold_brier_score. Defaults to None implying averaging over all dimensions.
weights (xr.DataArray with dimensions from dim, optional) – Weights for weighted.mean(dim). Defaults to None, such that no weighting is applied.
keep_attrs (bool) – If True, the attributes (attrs) will be copied from the first input to the new one. If False (default), the new object will be returned without attributes.
thresholdis a scalar, the result will have the same shape as observations. Otherwise, it will have an additional final dimension corresponding to the threshold levels. Not implemented yet.)
- Return type
>>> observations = xr.DataArray(np.random.normal(size=(3,3)), ... coords=[('x', np.arange(3)), ... ('y', np.arange(3))]) >>> forecasts = xr.DataArray(np.random.normal(size=(3,3,3)), ... coords=[('x', np.arange(3)), ... ('y', np.arange(3)), ... ('member', np.arange(3))]) >>> threshold = [.2, .5, .8] >>> xs.threshold_brier_score(observations, forecasts, threshold) <xarray.DataArray (threshold: 3)> array([0.27160494, 0.34567901, 0.18518519]) Coordinates: * threshold (threshold) float64 0.2 0.5 0.8
- Gneiting, T. and Ranjan, R. Comparing density forecasts using threshold-
and quantile-weighted scoring rules. J. Bus. Econ. Stat. 29, 411-422 (2011). http://www.stat.washington.edu/research/reports/2008/tr533.pdf