Detects statistical anomalies in liquidity metrics using Z-score, IQR, and time-series analysis techniques
Identify unusual patterns, outliers, and statistical anomalies in liquidity data that may indicate data quality issues, operational problems, or emerging risks.
Calculate standard deviations from mean:
Detect outliers using quartile-based boundaries:
Identify trend and seasonal anomalies:
Track deviations from rolling average:
Retrieve at least 90 days of historical values for the metric being analyzed.
Run multiple anomaly detection methods and compare results.
Assign severity scores (1-10) based on:
Check for:
Produce human-readable explanation with:
{
"anomalies_detected": <count>,
"critical_alerts": [
{
"metric": "<metric_name>",
"date": "<date>",
"value": <number>,
"expected_range": [<lower>, <upper>],
"deviation_magnitude": <number>,
"severity_score": <1-10>,
"detection_methods": [<list>],
"possible_causes": [<list>],
"recommended_actions": [<list>]
}
]
}
lookback_days: Historical window (default: 90)z_threshold: Z-score cutoff (default: 3.0)iqr_multiplier: IQR boundary multiplier (default: 1.5)min_severity_score: Alert threshold (default: 7)See references/statistical_methods.md for detailed formulas and implementation notes.