statsmodels/statsmodels — pull request #1484 by jseabold (2014-03-15 06:45:46+00:00)
Title: ENH: Add naive seasonal decomposition function

This adds a function seasonal_decompose that does a naive seasonal decomposition. It's pretty much the same as R's `decompose` function as far as functionality goes. I doubt anyone would ever want to use this in practice vs. model-based approaches, but it's ok for a quick look I suppose, and it gets the ball rolling a bit more. It needs a namespace decision. I'm thinking `tsa.seasonal`. It's not right/obvious in the filters namespace really. I also need to add a note and example to the release docs.

I expect that the first commit will be more contentious. I renamed arfilter -> `convolution_filter` and I added a true `arfilter` as `recursive_filter`. Unfortunately, they don't handle missing data well because of https://github.com/scipy/scipy/issues/3454. I probably won't tackle that on this PR. I also didn't add any tests for these because I ran out of steam, and I just wan't sure what you were after for the 2d cases. I think `recursive_filter` will need to consider many cases 2d x, 2d filt, and/or 2d init. I think it'd be trivial to add some tests. E.g., just do the same thing over and over again in different dimensions. I'm just not seeing it in the code yet. It also needs to handle pandas-in pandas-out and dates with the wrapper functions.