Eridk Poliruyt
2017-Jul-19 18:34 UTC
[R] STL - time series seasonal decomposition sensitive to data points?
Hi all, I am trying to analyse a time series data and want to make trend-season decomposition using STL approach in R. However I found the decomposition result seems to be sensitive to data points even with the robust option. More specifically, suppose I have a few years of monthly data. Using stl, I got a decomposition T1 + S1 + R1. Then I deleted the most recent two or three data points, the resulted decomposition T2 + S2 + R2 are totally different from the one with full data, especially for the beginning of time series which is weird. I would have expected that wouldn't be changed much due to the local nature of STL. May I ask for any thoughts and help on this issue? Many thanks! Best regards, Eric
Ismail SEZEN
2017-Jul-19 18:51 UTC
[R] STL - time series seasonal decomposition sensitive to data points?
> On 19 Jul 2017, at 21:34, Eridk Poliruyt <ep19772 at gmail.com> wrote: > > Hi all, > > I am trying to analyse a time series data and want to make > trend-season decomposition using STL approach in R. However I found > the decomposition result seems to be sensitive to data points even > with the robust option. > > More specifically, suppose I have a few years of monthly data. Using > stl, I got a decomposition T1 + S1 + R1. Then I deleted the most > recent two or three data points, the resulted decomposition T2 + S2 + > R2 are totally different from the one with full data, especially for > the beginning of time series which is weird. I would have expected > that wouldn't be changed much due to the local nature of STL. > > May I ask for any thoughts and help on this issue? Many thanks! > > Best regards, > EricHello Eridk, First of all, [1] might be a better place to ask a statistical questions. Second, (with my limited knowledge) STL simply assumes a steady periodicity and amplitude in the seasonal component. Your data (we don?t know what your data is) might not obey this rule and perhaps it?s not a good approach. Nevertheless, please, create an as much as minimal example to illustrate the situation, ask your question at [1] and please share a link to the question here. Thus, you increase the chance to get an urgent answer and I can also follow the answers to your question. best, ismail 1- https://stats.stackexchange.com
Jeff Newmiller
2017-Jul-19 19:03 UTC
[R] STL - time series seasonal decomposition sensitive to data points?
I think this looks like a question about statistics. I suggest you review the documentation for the functions you are using and study the references to better understand the algorithms you are using. If you think the algorithms are not behaving according to theory and the packages are part of the base R software distribution, then you should come back here with a reproducible example. [1][2][3] If you think the algorithms are misbehaving and packages you are using are contributed then you should probably correspond with the package maintainer. But most likely you just need to ask your statistics question in a statistics forum rather this R language forum. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) -- Sent from my phone. Please excuse my brevity. On July 19, 2017 11:34:38 AM PDT, Eridk Poliruyt <ep19772 at gmail.com> wrote:>Hi all, > >I am trying to analyse a time series data and want to make >trend-season decomposition using STL approach in R. However I found >the decomposition result seems to be sensitive to data points even >with the robust option. > >More specifically, suppose I have a few years of monthly data. Using >stl, I got a decomposition T1 + S1 + R1. Then I deleted the most >recent two or three data points, the resulted decomposition T2 + S2 + >R2 are totally different from the one with full data, especially for >the beginning of time series which is weird. I would have expected >that wouldn't be changed much due to the local nature of STL. > >May I ask for any thoughts and help on this issue? Many thanks! > >Best regards, >Eric > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.