Skip to content

rank_histogram

Import path: earth2studio.statistics.rank_histogram

View source on GitHub

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 array.

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: DataArray, y: DataArray) -> DataArray

Apply metric to data x and y, reducing over reduction_dimensions. y must have every dimension of x except the ensemble dimension, if the metric has one, with matching coordinate values; it is transposed to x's order, not broadcast.

Parameters:

  • x (DataArray) –

    Input array of ensemble data. The rank of observation input array y is determined with respect to the ensemble dimension of x. reduction_dimensions must be in the dimensions of x.

  • y (DataArray) –

    The observation input array. Must not have the ensemble dimension.

Returns:

  • DataArray –

    Returns rank histogram array with appropriate reduced coordinates.