Criteria to set STL s.window width

Using R to perform STL decomposition, s.window con­trols how rapidly the sea­sonal com­po­nent can change. Small val­ues allow more rapid change. Set­ting the sea­sonal win­dow to be infi­nite is equiv­a­lent to forc­ing the sea­sonal com­po­nent to be peri­odic (i.e., iden­ti­cal across years).

My questions:

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

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


  1. 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
  2. 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.

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

Leave a Comment