qis.compute_avg_max_dd¶
- qis.compute_avg_max_dd(ds, is_max=True, q=0.1)[source]¶
Compute summary statistics of a drawdown (or run-up) series.
- Parameters:
ds (Series) – Drawdown, time-under-water or run-up Series.
is_max (bool) – If True, keep only the non-negative values (
>= 0: time under water or run-ups); if False, only the non-positive values (<= 0: drawdowns). Zeros are kept in both cases, and missing values are ignored. The default True suits time under water; applied to a drawdown series it keeps only the zeros at the peaks and returns(0, 0, 0, last), so passis_max=Falsefor drawdowns.q (float) – Quantile for the tail statistic (default 0.1 = 10th/90th percentile).
- Returns:
Tuple of (avg, quantile, extreme, last) over the kept values, except
last, which is the final value ofdsunfiltered. Foris_max=Truequantile is the upper (1-q) quantile and extreme is the max; foris_max=Falsequantile is the lower q quantile and extreme is the min. Quantiles use NumPy’s linear interpolation.- Return type:
(<class ‘float’>, <class ‘float’>, <class ‘float’>, <class ‘float’>)