A linear time method for the detection of collective and point anomalies