twitter / AnomalyDetection

Anomaly Detection with R
GNU General Public License v3.0
3.56k stars 779 forks source link

AnomalyDetectionVec Vector needs to be periodic? #54

Closed terrytangyuan closed 9 years ago

terrytangyuan commented 9 years ago

I got this error when running AnomalyDetectionVec():

Error in stl(ts(data[[2L]], frequency = num_obs_per_period), s.window = "periodic",  : 
              series is not periodic or has less than two periods

which is triggered from running this stl(ts(c(2,4,5,5,4,3)), s.window = "periodic")

It looks like this vector needs to be periodic? Any workaround for this? Let me know and I might be able to help you make changes in the code.

Thanks, Yuan

terrytangyuan commented 9 years ago

See this link for an alternative approach. http://stackoverflow.com/questions/2535740/avoiding-seasonality-assumption-for-stl-or-decompose-in-r?rq=1