DetectAnomalies

DetectAnomalies(node, dciId, startTime, endTime, threshold) ⇒ ScoredDciValue

Detect anomalies for DCI within given period

Table 1. Parameters

node

Node

Node object

dciId

Integer

DCI id

startTime

Integer

Period start time

endTime

Integer

End time is optional (default is current time)

threshold

Number

Threshold is optional (default is 0.75)

Return

Returns null on error and an array of ScoredDciValue on success. Each element contains the original DCI value, its timestamp, and an anomaly score between 0.0 (normal) and 1.0 (highly anomalous). Values with a score above the threshold parameter are considered anomalies.

The threshold parameter (default 0.75) controls sensitivity: lower values detect more anomalies (higher sensitivity), higher values detect only the most significant deviations.

+

// Detect anomalies in last 24 hours with default threshold (0.75)
anomalies = DetectAnomalies($node, dciId, time() - 86400);

// Use lower threshold for higher sensitivity
anomalies = DetectAnomalies($node, dciId, time() - 86400, time(), 0.50);
if (anomalies != null)
{
    for (v : anomalies)
        println("Score: " .. v.score .. " Value: " .. v.value .. " Time: " .. v.timestamp);
}