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
    $\begingroup$ The stlplus package for R has a plot_seasonal function that can be used to generate a cycle-subseries plot in order to visually calibrate s.window. The original paper that RockScience linked to contains information on how to use that plot. $\endgroup$
    – cuttlefish
    Jun 9, 2017 at 15:03
  • $\begingroup$ @cttlfsh Thank you for pointing this out. When I try to follow the link to the paper, it's not found. Would you be able to quote us its title and authors so that readers could track it down? $\endgroup$
    – whuber
    Jun 9, 2017 at 15:21

1 Answer 1

  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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.