This operator compares the occurrence frequency of tuples (using the equal-method of the tuples) in two different windows. The first window (on port 0) has to be bigger or equal in size than the second window (on port 1). The relative occurrence frequency of the incoming tuple in the small and the big window is compared. If it's significant different (with the tolerance the user chose) an anomaly tuple will be generated.
The frequency-value: A value smaller than 1 means, that the tuple occurred less frequent (seldom) in the small window (compared to the big window). A value bigger than 1 means, that the tuple occurred more often in the small window.
Parameters
- negativeTolerance The tolerance to the negative side (if less tuples of type 'a' occur in the small window in comparisson to the big window). Standard is 0.3, which means 30% less is allowed
- positiveTolerance The tolerance to the positive side (if more tuples of type 'a' occur in the small window in comparisson to the big window). Standard is 0.3, which means 30% more is allowed
- deliverFirstElements Normally the operator starts to compare the frequencies when the big window is at least as big as the small window. With this option set to true, the comparison will start with the first tuple reaching this operator. Default is false.
Example
#PARSER PQL #ADDQUERY bigWindow = ELEMENTWINDOW({ size = 2000 }, System.state ) smallWindow = ELEMENTWINDOW({ size = 500 }, System.state ) frequencyAnalysis = FREQUENCYCOMPARE({ negativetolerance = 0.4, positivetolerance = 0.4, deliverfirstelements = 'true' }, bigWindow, smallWindow )