statistics.rank_histogram¶
Import path: earth2studio.statistics.rank_histogram
Documentation¶
Compute the Rank Histogram for a given set of ensemble forecasts.
This statistic reduces over a single dimension, where the presumed ensemble dimension does not appear in the truth/observation tensor.
Parameters:
-
ensemble_dimension(str) –A name corresponding to a dimension to perform the ranking over. Example: 'ensemble'
-
reduction_dimensions(list[str]) –A list of dimensions over which to bin the ranks
-
number_of_bins(int | None, default:None) –The number of bins to discretize the unit interval over. Best set to ensemble_size + 1, which is set automatically when None, by default None
-
randomize_ties(bool, default:True) –When True randomize the rank in cases where multiple ensemble members are exactly equal to the observation. This produces an unbiased distribution of ranks in cases where ties occur frequently. If False, the rank will be computed as if the observation were larger than the tied ensemble members, by default True
__call__ ¶
__call__(
x: Tensor,
x_coords: CoordSystem,
y: Tensor,
y_coords: CoordSystem,
) -> tuple[Tensor, CoordSystem]
Apply metric to data x and y, checking that their coordinates
are broadcastable. While reducing over reduction_dimensions.
Parameters:
-
x(Tensor) –Input tensor of ensemble data. The rank of observation input tensor
yis determined with respect to the ensemble dimension ofx. -
x_coords(CoordSystem) –Ordered dict representing coordinate system that describes the
xtensor.reduction_dimensionsmust be in coords. -
y(Tensor) –The observation input tensor.
-
y_coords(CoordSystem) –Ordered dict representing coordinate system that describes the
ytensor.reduction_dimensionsmust be in coords.
Returns: