Anomaly Formula: Percentage By Average
What it does:
This rule compares the latest value with the average of all previous values in your usage history. If the percentage difference from the average meets or exceeds your defined threshold, and the direction matches your selected change type, the rule triggers an anomaly alert.
When to use it:
Use this formula when you want to detect changes that deviate significantly from your historical norm. It’s helpful for identifying gradual increases, drops, or outliers relative to your usual usage.
Mathematical Formula:
Let:
• L = Latest Value
• A = Average of historical values (excluding latest)
• T = Threshold (as a percentage)
• %Δ = Percentage Change
• %Δ = (|L − A| / A) × 100
Anomaly Condition:
%Δ ≥ T
Direction Validation (based on Change Type):
• If Change Type = Increased, condition is valid only if L > A
• If Change Type = Decreased, condition is valid only if L < A
• If Change Type = Any, direction check is not required
Outcomes:
❌ Anomaly Detected → %Δ ≥ T and direction matches Change Type
☑️ Skipped → %Δ ≥ T, but direction does not match Change Type
✅ Normal → %Δ < T
Examples:
Example 1
Change Type: Increased
Threshold: 15%
History: 100, 120, 130
- If Latest Value = 130
Result: Normal ✅
Explanation:
A = 116.67
%Δ = (130 − 116.67) / 116.67 × 100 = 11.43%
Percentage Change (11.43%) < Threshold (15%)
- If Latest Value = 140
Result: Anomaly Detected ❌
Explanation:
A = 116.67
%Δ = (140 − 116.67) / 116.67 × 100 = 20%
Percentage Change (20%) ≥ Threshold (15%)
- If Latest Value = 100
Result: Skipped ☑️
Explanation:
A = 116.67
%Δ = |100 − 116.67| / 116.67 × 100 = 14.29%
Percentage Change (14.29%) < Threshold (15%)
Also direction = Decrease → does not match “Increased”
Example 2
Change Type: Decreased
Threshold: 10%
History: 400, 420, 460
- If Latest Value = 430
Result: Normal ✅
Explanation:
A = (400 + 420 + 460) / 3 = 426.67
%Δ = (430 − 426.67) / 426.67 × 100 = 0.78%
Percentage Change (0.78%) < Threshold (10%)
- If Latest Value = 380
Result: Anomaly Detected ❌
Explanation:
A = 426.67
%Δ = (426.67 − 380) / 426.67 × 100 = 10.96%
Percentage Change (10.96%) ≥ Threshold (10%)
- If Latest Value = 470
Result: Skipped ☑️
Explanation:
A = 426.67
%Δ = (470 − 426.67) / 426.67 × 100 = 10.15%
Percentage Change (10.15%) ≥ Threshold (10%)
But direction = Increase → does not match “Decreased”
Example 3
Change Type: Any
Threshold: 20%
History: 700, 750, 720
- If Latest Value = 730
Result: Normal ✅
Explanation:
A = (700 + 750 + 720) / 3 = 723.33
%Δ = (730 − 723.33) / 723.33 × 100 = 0.92%
Percentage Change (0.92%) < Threshold (20%)
- If Latest Value = 880
Result: Anomaly Detected ❌
Explanation:
A = 723.33
%Δ = (880 − 723.33) / 723.33 × 100 = 21.63%
Percentage Change (21.63%) ≥ Threshold (20%)