# Solved – Should I use a seasonal arima or stl decomposition and model residuals only

I have a basic question in time series modeling. (using r but the question is not particularly about r)

For a time series with obvious seasonality, shall I use stl (Seasonal and Trend decomposition using Loess) to decompose it into trend, seasonal and remainder, and model the remainder part, or directly model it with a seasonal model such as seasonal arima? The end application would be either forecasting, or detecting outliers/anomalies.

One of the reason I'm asking this, aside from my confusion of which approach is theoretically/practically more sound/viable, is that building a seasonal arima model seems to be particularly slow using auto.arima for long time series, whereas if I remove seasonal effect first and use auto.arima to find a model for the remainder seems much faster.

Contents

1. Outliers

Outliers should be easily detected by plotting a box-plot. "In order to be an outlier, the data value must be larger than Q3 by at least 1.5 times the interquartile range (IQR), or. smaller than Q1 by at least 1.5 times the IQR". For a more detailed way of detecting outliers please refer to: https://stackoverflow.com/questions/24750819/outlier-detection-of-time-series-data-in-r

1. Anomalies

To detect anomalies check this RPubs, it seems quite simple to perform: https://www.rpubs.com/vmez/409672

1. STL vs seasonal adjustment of arima

From what I know, which is not a lot, the differentiating(d) term of Sarima simply the difference between consecutive observations is computed, where it accounts for the trend. The D component or seasonal differentiating is the difference between an observation and the previous observation from the same season(for monthly data it is y_t-y_t-12). These differentiation techniques are relatively simple comparing to the mathematical computations behind stl(). This thread here will answer your question better: Is stl a good technique for forecasting, instead of Arima? To sum it up: "STL can deal with phenomena such as multiple seasonalities, high-frequency seasonalities better than arima", so it basically depends on your data.

Rate this post