acc¶
- HydroErr.HydroErr.acc(simulated_array: ndarray[tuple[Any, ...], dtype[floating | integer]] | Sequence[int | float], observed_array: ndarray[tuple[Any, ...], dtype[floating | integer]] | Sequence[int | float], replace_nan: float | None = None, replace_inf: float | None = None, remove_neg: bool = False, remove_zero: bool = False) floating[Any]¶
Compute the the anomaly correlation coefficient (ACC).
\[ACC=\frac{1}{n}\frac{\sum_{i=1}^{n}(S_i-\overline{S})(O_i-\overline{O})}{\sigma_o\sigma_s}\]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 – An array of simulated data from the time series.
observed_array – An array of observed data from the time series.
replace_nan – 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 – 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 – 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 – 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.
- Return type:
The anomaly correlation coefficient.
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.