According to an embodiment of the present invention, an approach accurately detects anomalies or outliers of a time-series dataset. A method for identifying whether a particular data element of the time-series dataset is an outlier comprises predicting a value for that particular data element and obtaining a threshold value that defines, relative to the predicted value, whether an actual value of the data element is an outlier. In an aspect of a present invention embodiment, the threshold value is generated based on historic error values associated with data elements temporally preceding the particular data element of the time-series dataset.