Anomaly Formula: Amount By Average

 

What it does:
This rule compares your most recent usage to the average value of all previous usages. If the difference between the most recent value and the average exceeds your defined threshold, and it matches the direction you’re monitoring (increase, decrease, or any), then it’s considered an anomaly.

 

When to use it:
Use this formula when you want to track deviations from your typical usage over time. It helps you catch significant shifts from your average behavior, such as unexpected spikes or drops.

 


Mathematical Formula:

 

Let:

 L = Latest Value
 A = Average of previous values
 T = Threshold
 D = |L − A| (absolute difference)

 

Anomaly Condition:

D = |L − A| ≥ 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 → D ≥ T and direction matches Change Type
☑️ Skipped → D ≥ T, but direction does not match Change Type
✅ Normal → D < T

 

 


Examples:

 

Example 1

Change Type: Increased
Threshold: 30
History: 100, 120, 110

  • If Latest Value = 125
    Result: Normal ✅
    Explanation:
       Average: (100 + 120 + 110) ÷ 3 = 110
       Change: 125 − 110 = 15
       Absolute Difference (15) < Threshold (30)

 

  • If Latest Value = 145
    Result: Anomaly Detected ❌
    Explanation:
      Average: 110
    Change: 145 − 110 = 35
    Absolute Difference (35) ≥ Threshold (30)

 

  •  If Latest Value = 80
    Result: Skipped ☑️
    Explanation:
      Average: 110
      Change: 80 − 110 = −30
      Absolute Difference (30) ≥ Threshold (30)
      But direction = Decrease → does not match “Increased”

Example 2
Change Type: Decreased
Threshold: 20
History: 300, 280, 290

  • If Latest Value = 275
    Result: Normal ✅
    Explanation:
      Average: (300 + 280 + 290) ÷ 3 = 290
      Change: 275 − 290 = −15
      Absolute Difference (15) < Threshold (20)

 

  • If Latest Value = 250
    Result: Anomaly Detected ❌
    Explanation:
      Average: 290
      Change: 250 − 290 = −40
      Absolute Difference (40) ≥ Threshold (20)

 

  • If Latest Value = 310
    Result: Skipped ☑️
    Explanation:
      Average: 290
      Change: 310 − 290 = 20
      Absolute Difference (20) ≥ Threshold (20)
      But direction = Increase → does not match “Decreased”

Example 3
Change Type: Any
Threshold: 25
History: 200, 210, 190

  • If Latest Value = 220
    Result: Normal ✅
    Explanation:
      Average: (200 + 210 + 190) ÷ 3 = 200
      Change: 220 − 200 = 20
      Absolute Difference (20) < Threshold (25)

 

  • If Latest Value = 240
    Result: Anomaly Detected ❌
    Explanation:
      Average: 200
      Change: 240 − 200 = 40
      Absolute Difference (40) ≥ Threshold (25)