A real-time method (400, 750) for identifying an anomalous state of a system, the system including a sensor outputting time series data items relating to a property of the system, the method comprising: receiving (404, 754) a current data item from the sensor; retrieving a stored recursively calculated estimate of a previous data density for all the previous time series data items from a data structure, wherein the data density represents the total distance between data items; recursively calculating (412, 762) an estimate of a current data density for the time series data items using the current data item and said estimate of the previous data density and storing said estimate of the current data density in said data structure; retrieving a stored recursively calculated previous statistical property of the estimate of the previous data density from the data structure; recursively calculating (414, 764) at least one statistical property of the estimate of the current data density using said previous statistical property of the estimate of the previous data density and storing said at least one statistical property of the estimate of the current data density in said data structure; determining (418, 768) from the at least one statistical property whether the current data item indicates an anomalous state of the system; and outputting a signal (426, 770) to the system if it is determined that the current data item indicates an anomalous state of the system, wherein the signal is selected from: a control signal; a feedback signal; an alarm signal; a command signal; a warning signal; an alert signal; a servo signal; a trigger signal; a data capture signal; and a data acquisition signal. receiving (404, 754) a current data item from the sensor; retrieving a stored recursively calculated estimate of a previous data density for all the previous time series data items from a data structure, wherein the data density represents the total distance between data items; recursively calculating (412, 762) an estimate of a current data density for the time series data items using the current data item and said estimate of the previous data density and storing said estimate of the current data density in said data structure; retrieving a stored recursively calculated previous statistical property of the estimate of the previous data density from the data structure; recursively calculating (414, 764) at least one statistical property of the estimate of the current data density using said previous statistical property of the estimate of the previous data density and storing said at least one statistical property of the estimate of the current data density in said data structure; determining (418, 768) from the at least one statistical property whether the current data item indicates an anomalous state of the system; and outputting a signal (426, 770) to the system if it is determined that the current data item indicates an anomalous state of the system, wherein the signal is selected from: a control signal; a feedback signal; an alarm signal; a command signal; a warning signal; an alert signal; a servo signal; a trigger signal; a data capture signal; and a data acquisition signal.