This operator uses the Local Outlie= r Factor (LOF) algorithm to find anomalies. You should use this operato= r with a window, because the operator saves all tuples in the current windo= w and uses the normal LOF-algorithm on this set of tuples. If the number of= tuples is too high, the algorithm may take a while to process the calculat= ions.

**NEIGHBORS**The number of neighbors used, sometimes call= ed k**LOFVALUE**The value from which the tuples are declared = as anomalies. Values near 1 are normal, higher values are anomalies. Standa= rd is 1.5.**attribute**Name of the attribute which should be analys= ed**GROUP**_BY Group by the given attribute, e.g. if you hav= e a context like 'on' and 'off' you want to analyse separately.**fastGrouping**Use hash code instead of tuple compare to= create group. Potentially unsafe!**ignoreEqual**Set to true, if you want to ignore, if the= re are a lot of equal values. This can lead to false positives.**deliverFirstElements**The operator starts to work when = the window contains at least the number of neighbors + 1 tuples. If you wan= t to get the first elements before this is reached, you can set this to tru= e. Default is false.

The option "ignoreEqual" is useful, if the data stream has a lot of equa= l values. If thats the case, the distance between these values is zero. If = there is one value, which is very close to these equal values and hence, th= e k nearest neighbors of this new value are all equal, the LOF will be infi= nity. That's because the average distance between the neighbors of this val= ue if 0, there even the smallest distance greater than 0 will lead to an in= finite LOF. If you set "ignoreEqual" to true, only one equal neighbor will = be considered for the calculation of the LOF value.

=20

/// Sear= ches for anomalies in temperature data #PARSER PQL #ADDQUERY temperatureWindow =3D ELEMENTWINDOW({ size =3D 100 }, System.temperature ) =20 lofAnalysis =3D LOFANOMALYDETECTION({ lofvalue =3D 2.5, neighbors =3D 5, ignoreequal =3D 'true', attribute =3D 'temp', deliverFirstElements =3D 'true' }, temperatureWindow )=20