AnomalyDetection icon indicating copy to clipboard operation
AnomalyDetection copied to clipboard

using anomalydetection for a time series data package but there is an error i am getting

Open sarojhange opened this issue 10 years ago • 1 comments

PFB the dataset: weekly data for a metrics. Want to detect anomalies in this time series. The error I get is : Error in if (data_sigma == 0) break : missing value where TRUE/FALSE needed 1 2013-01-01 59.94 2 2013-01-08 59.65 3 2013-01-15 61.56 4 2013-01-22 58.37 5 2013-01-29 58.07 6 2013-02-05 57.31 7 2013-02-12 58.53 8 2013-02-19 63.22 9 2013-02-26 60.21 10 2013-03-05 59.09 11 2013-03-12 57.19 12 2013-03-19 55.97 13 2013-03-26 59.96

sarojhange avatar Aug 19 '15 15:08 sarojhange

I got the same errors too. Have you solved the problem yet? @sarojhange

The error is

anomous_points<-AnomalyDetectionTs(table1,max_anoms=0.1,

  •                    direction = "pos",alpha = 0.05,
    
  •                    threshold = "None",
    
  •                    e_value = FALSE,
    
  •                    piecewise_median_period_weeks = 4,
    
  •                    longterm = TRUE,plot=TRUE,verbose = TRUE)
    
    1 / 4032 completed 2 / 4032 completed 3 / 4032 completed Error in if (data_sigma == 0) break : missing value where TRUE/FALSE needed

The structure of my data:

str(table1) 'data.frame': 169921 obs. of 2 variables: $ time : POSIXlt, format: ... $ traffic.out: num 8.78e+08 8.87e+08 8.77e+08 8.67e+08 8.57e+08 ...

The head six raws of my data: head(table1) time traffic.out 1 2015-04-01 00:00:00 878347968 2 2015-04-01 00:01:00 887359296 3 2015-04-01 00:02:00 877318720 4 2015-04-01 00:03:00 867278144 5 2015-04-01 00:04:00 857237568 6 2015-04-01 00:05:00 847196992

I looked into the function detect_anoms(),in line 89,there's comment about variable 'data_sigma': '# protect against constant time series',

brightbird avatar Aug 26 '15 08:08 brightbird