0

I'm detecting outliers in a periodic time series constructed as so:

install.packages("outliers")
time_series_obj = ts(time_series_data, frequency = SOME_VALUE)
fitted_time_series_data <- stl(time_series_obj, "periodic", robust=TRUE)
outliers <- which(fitted_time_series_data$weights<1e-8)

The outlier detection is too sensitive for my needs, and I only want to keep the most extreme outliers. (Changing the weight filter has very little effect.) I would like the sensitivity to be configurable (e.g. filter out all outliers with a remainder that has an absolute value greater than k standard deviations or some similar approach).

Brian Schmitz
  • 1,023
  • 1
  • 10
  • 19
  • Which function above is from `outliers`? What standard deviation do you want to filter on exactly? You didn't provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so it's difficult to know exactly what your are experiencing. – MrFlick Jun 07 '14 at 04:47

1 Answers1

0

The package tsoutliers provides a procedure for the detection of some types of outliers in time series. In this package, the sensitivity can be configured by setting the critical value used in the t-tests.

javlacalle
  • 1,029
  • 7
  • 15