2

When using the stl function in R, I understand loess is used in order to 'smooth' seasonal sub-series to find the seasonal component. The window used in order to do this is given with the s.window command.

I believe that loess uses a symmetric window, i.e. if I specify s.window=24 where this represents a days worth of hourly data, it splits this using points before and after the one in question. As far as I can tell, the loess aspect of the code is taken from Fortran and I have no idea how to amend this so that it only uses points BEFORE the one that we are interested in. I.e. it uses data from the past and not the future.

However, I am interested in this specifically in the calculation of the trend and remainders. The default in the stl function is t.window=NULL which uses the function nextodd(ceiling((1.5*period) / (1-(1.5/s.window)))) to determine the window. I assume this also uses a symmetric window and wondered if anybody could suggest how this could be altered so that it only uses past data to determine the trend, seasonal and remainder profiles.

sym246
  • 1,836
  • 3
  • 24
  • 50
  • You should read the associated paper. –  Jan 04 '16 at 23:04
  • I could not find a paper related to this. The only information I found describes the method used, not how to change it. – sym246 Jan 05 '16 at 08:02
  • Really? `?stl`, section `References`. –  Jan 05 '16 at 08:03
  • Oh you mean that. I've already read that. That was the first thing I did – sym246 Jan 05 '16 at 08:08
  • Yes I meant that, what else? Waste of time. Good luck. –  Jan 05 '16 at 08:09
  • There is another paper I found cited on another question similar to mine, but it also does not have the information I was looking for. I thought it would be obvious that I had read the associated paper you were referring to. Oh well. – sym246 Jan 05 '16 at 08:11

0 Answers0