3
$\begingroup$

I found the Rob H answer to this question very interesting and works pretty well. However, I also would like to apply this methodology to an unevenly spaced time series like the following:

          date value
 1: 2011-02-02  2408
 2: 2011-03-05  2454
 3: 2011-05-09  2502
 4: 2011-06-04  2517
 5: 2011-09-12  2570
 6: 2011-10-04  2581
 7: 2011-10-26  2595
 8: 2011-11-09  2604
 9: 2011-12-01  2629
10: 2012-01-02  3596
11: 2012-02-04  2736
12: 2012-03-07  2797
13: 2012-05-09  2880
14: 2012-05-16  2887
15: 2012-06-01  2901
16: 2012-06-29  2921
17: 2012-08-03  2945
18: 2012-08-07  1912

enter image description here

Which is the best approach to apply the tsoutliers function of Rob in this case? Or do I need to look for different methods?

$\endgroup$
6
  • 1
    $\begingroup$ Try interpolating. Although looking at the data it is pretty clear what any function would indicate as an outlier. $\endgroup$
    – mpiktas
    Jul 2, 2013 at 12:52
  • $\begingroup$ @mpiktas hi. So your suggestion would be to basically make the time series evenly spaced? Btw, since the outliers in my data are actually so "clear", which are way do you suggest? Thanks $\endgroup$
    – Michele
    Jul 2, 2013 at 12:55
  • $\begingroup$ Interpolation does not require that a time series, or any other series, is equally spaced; nor is the idea necessarily to produce an equally spaced series. $\endgroup$
    – Nick Cox
    Jul 2, 2013 at 13:00
  • $\begingroup$ @NickCox I agree but I think it can be to estimate the value of the series at equally spaced time intervals. $\endgroup$
    – Michele
    Jul 2, 2013 at 13:03
  • 1
    $\begingroup$ @Michele, interpolate with approx function. Then apply Rob's function. See the results. $\endgroup$
    – mpiktas
    Jul 2, 2013 at 13:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.