Here's my ssatrend.m program. It is based on SSA routines from Eric Breitenberger. So, an acknowledgement goes to him.
SSA is short for singular spectrum analysis, which is a kind of temporal EOF or PCA analysis. The idea of the code is to find the non-linear trend (or smooth) of the input series when you account for oscillatory signals. It first decomposes the signal using SSA. This usually leads to a series of oscillatory components, a trend plus some noise. this code throws away everything except the trend. The trend component is commonly referred to the "nonlinear trend". For many input series the resulting nonlinear trend is very close to what you would get from a triangular bartlett filter. ## A Work in progress...Please be aware that this is a work in progress. In particular, you should be aware that:- Data boundaries have an effect on the smoothed series. You should examine the code to see how I deal with it and whether another approach might be better for your data. (Note, In the new code i have made it easy to add new boundary treatment methods.)
- A new method for calculating the confidence intervals is being used. It needs further testing.
**Please beware**.
## New confidence interval calculationThe method used to calculate the confidence intervals for the padding period has been changed (yet again). The idea is that I can test how successful the padding method is on the series itself. I do that through bootstrapping. This must be an robust method, provided that the embedding is small compared to the length of the series (and that the measurement noise is white). But it remains to be tested.Another improvement i've added is that i've added the possibility to use more complicated noise models for the 'measurement noise'. Note, however, that these complicated noise models may be incompatible with the bootstrap uncertainties (i have to look into that). I've also cleaned the code a bit to improve readability and added 'triangular filter' help-comment. There were some blog-comments on climateaudit etc. about ssatrend padding uncertainties being wrong. However, the comments were all over the place on multiple blogs, so I had no energy to find out what they were talking about. Instead I made this bootstrapping improvement, which I have had in mind to do for a long time. An important design criteria for me is that the confidence interval calculation is non-parametric, so that it is generalizable to non-normal non-iid noise and that it can handle the extrapolation uncertainties. ## DISCLAIMERUse at your own risk. There are probably errors in it - please email me any comments and ideas on how to improve. The code was originally never intended for distribution, because I never felt that it was finished. Please spend a little time understanding the code before applying it. |