-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surrogates for irregular time series #12
Comments
Yes, that is correct. Random shuffle surrogates (which only preserve the amplitude distribution of the data) or random block shuffle surrogates (preserves short-term correlations, but breaks long-term correlations) would work on irregularly spaced data, but anything more complicated than that needs deeper consideration. If using Having an implementation of their method would be a great idea, and definitely within the scope of the package. From a brief glance of the paper, it doesn't look like too much work to implement. But maybe you already have a rough implementation ready? |
I don't have an implementation. |
This certainly looks useful, though. Thanks for bringing the method to my attention! I'm busy with other things at the moment, but might get some time in a few weeks to implement it. In the meanwhile, I'll keep the issue open, in case someone else wants to chime in. |
I've started using TimeseriesSurrogates.jl and this method is useful for me as well. |
I am wondering, whether we could provide the surrogate methods which are based on fourier transform for irregular time series by using the non-equdistant fourier transform https://github.com/tknopp/NFFT.jl. |
I think conceptually it makes sense. But why not go for the method directly suggested in [1]? Is it easier to use the NFFT? But in any case, I think this is worth a PR no matter which of the two approaches you follow. Be aware that we are currently changing the API of TimeseriesSurrogates.jl. |
Hi Felix, I also think this is well-worth a PR, regardless of the method in [1]. If you can prepare a working implementation, please go ahead!
No problem, we can just adjust the code to the new API once the implementation is ready! |
Hi @felixcremer , we are planning to release 1.0 of TimeseriesSurrogates.jl soon. Do you have any working code that you can push for a PR and we help you get it in? We are also thinking of writing a JOSS paper about TimeseriesSurrogates a short while after the release, maybe you can also get in if you contribute a method here. |
I have a nearly working version of the RandomFourier method based on nufft from the FastTransforms package. I am going to tidy it up today and will open a pull request so that we can push this further this week. Are there any tests, to make sure, that the surrogates we construct have the correct properties?
This sounds very interesting. |
In fact testing is an issue we are like you a bit unsure... We do not know exactly how to do "proper testing", since many of the "hypothesis testing" things that are discussed in the papers are rather subjective and not so much something you could do unit tests on. One thing we should consider is sufficient numeric similarity between methods that retain autocorrelations. Notice that me and @kahaaga in general test the methods with the systems showed in the papers before merging, and don't merge if we can't replicate a paper. So in a way you are "safe" if you are using the methods here, even if they don't have unit tests. |
p.s.: 1.0 is out, but we will wait a bit on the paper to have some more methods merged in. |
For For now, you can just check this for a few well-behaved example time series (stationary, with at least some form of periodicity) and we can add the examples to the "example applications" docs page.
Nice! Looking forward to see what you've come up with! Don't worry about having it in a perfect state, as long as the algorithm does roughly what it promises. Once you make the PR, we can make any necessary adjustments to the code. If we get a working implementation of this going for But let's focus on the |
Unfortunately, I was too optimistic with that. I have a rough draft ready, but unfortunately, I can't force the inverse non-uniform fourier transform to return a real valued time series and it doesn't have the nice symmetry properties, so that we can't use only one half of the frequencies for the shuffle to then mirror them to get a nice symmetric transform, which yields a real valued time series. I also had a look at the IAAFT and there we could use a nufft to get the periodogram, but in the end this is conceptionally similar to the algorithm based on lombscargle described by Schmitz and Schreiber, that I started implementing that one. |
hehe, tough life is tough right? :D |
We can have a look at that at a later stage. For now, it is just amazing that we can use irregularly sampled data at all. Nice job! |
According to [1] iaaft and aaft are not working for irregular time series, because these methods are based on the Fourier transform.
They propose an alternative to it using the LombScargle periodogram.
Are surrogates for irregular time series in the scope of this package?
Are there algorithms for surrogates in irregular data?
[1] Testing for nonlinearity in unevenly sampled time series
Andreas Schmitz and Thomas Schreiber
https://journals.aps.org/pre/pdf/10.1103/PhysRevE.59.4044
The text was updated successfully, but these errors were encountered: