# How to choose the best time window using structural times series with loess

My question is about the Cleveland et al. 1990 paper STL: A Seasonal-Trend Decomposition Procedure Based on Loess. The full citation is:

• Cleveland, RB, Cleveland, WS, McRae, JE, and Terpenning, I. 1990. STL: A seasonal-trend decomposition approach using Loess. Journal of Official Statistics, v.6(1).

The paper briefly discusses a visual diagnostic method for identifying the right level of seasonal smoothing. Specifically, the parameter $n_s$ controls how much data is used to smooth the seasonal component. If we use a small value for this parameter then only the most recent observations will be used in determining how much variation to assign to the seasonal component. If we use a larger value then more of the observations will be used to smooth the seasonal component. The general advice is that if you think the seasonal process changes quickly then use a smaller value for $n_s$ and if you think the seasonal process evolves slowly then use a larger value.

My question is: what if I don't know how quickly or slowly the seasonality changes and I want the data to tell me this?

Cleveland et al. discuss what they call a Seasonal-Diagnostic plot. In these plots the seasonal component of the model for each sub-series is differenced from it's mean and displayed as a line. Then, again for each sub-series, the seasonal component plus the error component is differenced from the seasonal mean and displayed as points around the line.

My specific question is, for any two of these plots (comparing different values of $n_s$) how can I determine which $n_s$ is better?

I have included two Seasonal-Diagnostic plots for reference. They all use the stlplus() function in R to decompose a monthly time-series. I use the plot_seasonal() to produce the plots. The first plot uses the value 13 for the parameter s.window which corresponds to $n_s$ in the original paper. This small value allows the seasonality to change rapidly. The second plot uses s.window=49 which allows the seasonal component to change and uses several years of data to determine the smoothed seasonal component.

From looking at these diagnostic plots, what should I conclude about the nature of seasonality in my data. Is it better captured with a constant seasonal term, a relatively large smoothing parameter (49) or a small smoothing parameter (13)? I can also post code and data if that is helpful, please advise.