I am using STL to decompose my time series data in Season, trend and residual and then by applying this(see below) on residual. I am detecting the anomaly

    resid_mu = resid.mean()
    resid_dev = resid.std()
    //anything outside lower and upper limit is anamoly
    lower = resid_mu - 3*resid_dev
    upper = resid_mu + 3*resid_dev

If I do this on 1 year of data it is giving a good result but now if I get new data say for 1 new day how can I use older decomposition data so that I have to process for 1 day only and not for 1 year+1 day.

  • $\begingroup$ What is the minimum amount of data to detect seasonality? Is one day enough? $\endgroup$ Jun 28, 2021 at 10:05
  • $\begingroup$ What is the minimum amount of data to detect seasonality? 1 week Is one day enough? I am getting incremental data daily. $\endgroup$ Jun 29, 2021 at 10:54
  • $\begingroup$ In order to make a prediction on the next day (or the next several days), your model should consider several previous days, months or even years, depending on seasonality period. You cannot make a prediction based on a single value, you need to be based on enough values (maybe values on a year for instance) to detect the seasonal behaviours. $\endgroup$ Jun 29, 2021 at 11:36


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.