Reputation: 1866
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.
Upvotes: 2
Views: 1375