Skip to content

acc

Import path: earth2studio.statistics.acc

View source on GitHub

Documentation

Statistic for calculating the anomaly correlation coefficient of two tensors over a set of given dimensions, with respect to some optional climatology.

Parameters:

  • reduction_dimensions (list[str]) –

    A list of names corresponding to dimensions to perform the statistical reduction over. Example: ['lat', 'lon']

  • climatology (DataSource | None, default: None ) –

    Optional (by default None) climatology to remove from tensors to create anomalies before computing the correlation coefficient.

  • weights (Tensor | None, default: None ) –

    A tensor containing weights to assign to the reduction dimensions. Note that these weights must have the same number of dimensions as passed in reduction_dimensions. Example: if reduction_dimensions = ['lat', 'lon'] then assert weights.ndim == 2.

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

Parameters:

  • x (Tensor) –

    Input tensor, typically the forecast or prediction tensor, but ACC is symmetric with respect to x and y.

  • x_coords (CoordSystem) –

    Ordered dict representing coordinate system that describes the x tensor. reduction_dimensions must be in coords. "time" and "variable" must be in x_coords.

  • y (Tensor) –

    Input tensor #2 intended to be used as validation data, but ACC is symmetric with respect to x and y.

  • y_coords (CoordSystem) –

    Ordered dict representing coordinate system that describes the y tensor. reduction_dimensions must be in coords. "time" and "variable" must be in y_coords. If "lead_time" is in x_coords, then "lead_time" must also be in y_coords. The intention, in this case, is that users will use fetch_data to make it easier to match validation times.

Returns:

  • tuple[Tensor, CoordSystem] –

    Returns anomaly correlation coefficient tensor with appropriate reduced coordinates.

Note

For more information see the following references: