Rules

Anomaly Formula: Regression-Residual

What it does:
This formula fits a simple linear regression line to your historical data and checks if the latest value deviates too much from the predicted trend. It’s useful for catching values that break away from the expected upward or downward pattern.

 

When to use it:
Use this rule when you want to track unexpected deviations from a linear trend, such as sudden drops or spikes that don’t align with how the data was moving before.

 

Examples

 

Example 1: Alert Triggered (Increased)

  • Anomaly Formula: RegressionResidual
  • Change Type: Increased
  • Threshold: 1.5
  • History: 20, 21, 22, 22, 23, 24, 24, 25, 26, 95
  • Explanation:
    • Data was slowly increasing, then suddenly jumped to 95.
    • The residual is much higher than expected.
    • ✅ Alert triggered due to high positive residual.

 

Example 2: Alert Triggered (Decreased)

  • Anomaly Formula: RegressionResidual
  • Change Type: Decreased
  • Threshold: 1.2
  • History: 20, 23, 25, 28, 30, 33, 34, 35, 36, 10
  • Explanation:
    • Trend is steadily rising, but latest value drops sharply.
    • Residual is significantly negative.
    • ✅ Alert triggered due to unexpected drop.

 

Example 3: Normal Case (Any)

  • Anomaly Formula: RegressionResidual
  • Change Type: Any
  • Threshold: 1
  • History: 58, 84, 24, 96, 666, 14, 25, 23, 125, 39, 36, 48, 282, 10, 100, 25, 25, 28, 29, 215
  • Explanation:
    • Though the history is volatile, the last point (28) is not a major residual.
    • z-score is -0.21 → Within bounds
    • ❌ No alert triggered.