Rules

Anomaly Formula: Grubbs-Test

What it does:
Grubbs’ Test is a statistical test that detects whether the latest value is a statistical outlier in a normally distributed dataset. It checks how far the latest value deviates from the mean compared to the overall spread (standard deviation).

 

When to use it:
Use GrubbsTest when you want to flag extreme outliers in data that generally follows a normal distribution. It’s useful for spotting rare spikes or drops that are unlikely to happen randomly.

 

Examples

 

Example 1: Increased Value Detected

  • Anomaly Formula: GrubbsTest
  • Change Type: Increased
  • Threshold: 0.01
  • History: 20, 21, 19, 22, 20, 21, 100
  • Explanation:
    • Latest value = 100
    • Mean ≈ 32
    • Standard deviation ≈ 30
    • G ≈ 2.27
    • Critical value ≈ 1.90
    • Since G > critical_value → ✅ Alert triggered

 

Example 2: Decrease Not Detected (Change Type Mismatch)

  • Anomaly Formula: GrubbsTest
  • Change Type: Increased
  • Threshold: 0.05
  • History: 40, 42, 41, 43, 40, 42, 5
  • Explanation:
    • Latest value = 5 (drop)
    • G > critical → yes
    • But change type = “Increased” → ❌ No alert

 

Example 3: Sharp Drop Caught with Change Type = Any

  • Anomaly Formula: GrubbsTest
  • Change Type: Any
  • Threshold: 0.05
  • History: 60, 61, 62, 59, 60, 12
  • Explanation:
    • Latest = 12
    • Mean ≈ 52.3
    • Standard deviation ≈ 20.1
    • G ≈ 2.00, Critical ≈ 1.75
    • G > critical_value → ✅ Alert triggered