"""
Constants for StatisticalAnalyzer (windows, recency thresholds, confidence formula).
"""

# Concentration: full HHI uses this many days of history
CONCENTRATION_WINDOW_DAYS = 180

# Recency decay: last_order_days_ago -> weight
RECENCY_WEIGHT_7_DAYS = 1.0
RECENCY_WEIGHT_30_DAYS = 0.5
RECENCY_WEIGHT_60_DAYS = 0.2
RECENCY_WEIGHT_OLDER = 0.0

# Confidence formula: min(1.0, raw_conf / CONFIDENCE_NORMALIZER)
# raw_conf = log1p(orders) * (CONFIDENCE_HHI_OFFSET + (hhi * CONFIDENCE_HHI_FACTOR))
CONFIDENCE_NORMALIZER = 3.0
CONFIDENCE_HHI_OFFSET = 0.5
CONFIDENCE_HHI_FACTOR = 0.5
