Skip to content

acc

Import path: earth2studio.statistics.acc

View source on GitHub

Documentation

Statistic for calculating the anomaly correlation coefficient of two arrays 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 | ndarray | None, default: None ) –

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

Apply metric to data x and y. 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, typically the forecast or prediction array, but ACC is symmetric with respect to x and y. reduction_dimensions must be in the dimensions of x. "time" and "variable" must be in x.

  • y (DataArray) –

    Input array #2 intended to be used as validation data, but ACC is symmetric with respect to x and y. Must have the same dimensions and coordinates as x. If "lead_time" is in x, then "lead_time" must also be in y. The intention, in this case, is that users will use fetch_data to make it easier to match validation times.

Returns:

  • DataArray –

    Returns anomaly correlation coefficient array with appropriate reduced coordinates.

Note

For more information see the following references: