acc

HydroErr.HydroErr.acc(simulated_array, observed_array, replace_nan=None, replace_inf=None, remove_neg=False, remove_zero=False)

Compute the the anomaly correlation coefficient (ACC).

../_images/ACC.png

Range: -1 ≤ ACC ≤ 1. -1 indicates perfect negative correlation of the variation pattern of the anomalies, 0 indicates complete randomness of the variation patterns of the anomalies, 1 indicates perfect correlation of the variation pattern of the anomalies.

Notes: Common measure in the verification of spatial fields. Measures the correlation between the variation pattern of the simulated data compared to the observed data.

Parameters:
  • simulated_array (one dimensional ndarray) – An array of simulated data from the time series.
  • observed_array (one dimensional ndarray) – An array of observed data from the time series.
  • replace_nan (float, optional) – If given, indicates which value to replace NaN values with in the two arrays. If None, when a NaN value is found at the i-th position in the observed OR simulated array, the i-th value of the observed and simulated array are removed before the computation.
  • replace_inf (float, optional) – If given, indicates which value to replace Inf values with in the two arrays. If None, when an inf value is found at the i-th position in the observed OR simulated array, the i-th value of the observed and simulated array are removed before the computation.
  • remove_neg (boolean, optional) – If True, when a negative value is found at the i-th position in the observed OR simulated array, the i-th value of the observed AND simulated array are removed before the computation.
  • remove_zero (boolean, optional) – If true, when a zero value is found at the i-th position in the observed OR simulated array, the i-th value of the observed AND simulated array are removed before the computation.
Returns:

The anomaly correlation coefficient.

Return type:

float

Examples

>>> import HydroErr as he
>>> import numpy as np
>>> sim = np.array([5, 7, 9, 2, 4.5, 6.7])
>>> obs = np.array([4.7, 6, 10, 2.5, 4, 7])
>>> he.acc(sim, obs)
0.8008994694029383

References

  • Langland, Rolf H., and Ryan N. Maue. “Recent Northern Hemisphere Mid-Latitude Medium-Range Deterministic Forecast Skill.” Tellus A: Dynamic Meteorology and Oceanography 64, no. 1 (2012): 17531.
  • Miyakoda, K., G. D. Hembree, R. F. Strickler, and I. Shulman. “Cumulative Results of Extended Forecast Experiments I. Model Performance for Winter Cases.” Monthly Weather Review 100, no. 12(1972): 836–55.
  • Murphy, Allan H., and Edward S. Epstein. “Skill Scores and Correlation Coefficients in Model Verification.” Monthly Weather Review 117, no. 3 (1989): 572–82.