What is the best way to treat outliers in a time series forecasting model? In particular, for product demand modeling?
Based on what I've read so far, the following methods can be applied:
- Using dummy variables to remove the effect of explainable spikes (e.g. holiday dummy variables)
- Identify and replace using R's tsclean
I'm still unsure about the validity of using winsorization to remove spikes in time series, as it may remove valuable information. Number 2 - using dummy variables - only works for spikes that are explainable; however, this cannot be done for spurious outliers, i.e. spikes that occur due to one-off or non-repeatable event.
Number 3 seems to be the best method. Unfortunately, I'm using Python and there doesn't seem to be a Python equivalent for tsclean.