Using

`R`

to perform STL decomposition,`s.window`

controls how rapidly the seasonal component can change. Small values allow more rapid change. Setting the seasonal window to be infinite is equivalent to forcing the seasonal component to be periodic (i.e., identical across years).

My questions:

If I have a monthly time series (that is frequency equal to 12), what criteria should be used to set

`s.window`

?Is there any link between that and the time series frequency?

**Answer**

- The question is not about whether it is a monthly or a weekly data, but about how quickly the seasonality evolves. If you think the seasonal pattern is constant through time, you should set this parameter to a big value, so that you use the entire data to perform your analysis.

If on the other way round, the seasonal pattern evolves quickly, reduce this parameter to use only the recent data so that your analysis is not affected by old seasonal pattern that are not relevant anymore - This parameter is not linked to the time series frequency.

I also want recommend to read the original paper that explains all this very clearly

STL: A Seasonal-Trend Decomposition Procedure Based on Loess.

**Attribution***Source : Link , Question Author : Lisa Ann , Answer Author : sfjac*