-
Notifications
You must be signed in to change notification settings - Fork 35
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
re-open PR #83 #86
re-open PR #83 #86
Conversation
@efosong I've added you to a team in JuliaDynamics so you can push at ChaosTools (and thus this PR directly). Sorry for the mistake but there is some work to be done here before you can get the issue bounty. Writing a docstring is an absolute must for example (as well as passing tests, which I am working on now). |
Okay, now tests pass (at least locally on my machine). They take quite some time, but this is expected given how many computations are necessary for the result. I will spend some time implementing tests for the logistic map until we get the documentation pushed. |
Thanks @Datseris 🙂 I'll write some documentation some time during the week. I tried to write some discrete tests based on the Hénon map (as well as the "standard map") . It seemed to require a rather large number of iterations, which seems reasonable for discrete time systems, but I didn't really get any results I was happy with when I plotted them. In some cases, I got convergence which I guess invalidates the 'limit cycle' based analysis in the paper so the results were a bit weird. I should've written this down what I observed when I was testing these, but didn't. |
@efosong can you please write down exactly what parameters you used for the Henon tests? For the standard map the method we are implementing here doesn't work. The standard map does not have attracting sets. |
I am testing with the henon map, whose behavior is pretty much established in the literature. The parameter Now I run the code: ds = Systems.henon()
a_reg = 0.8; a_cha = 1.4; a_reg2 = 1.0
for a in (a_reg, a_reg2, a_cha)
set_parameter!(ds, 1, a)
chaos_type, ν, C = predictability(ds; T_max = 40000)
println("type = ", chaos_type, ". ν, C = ", round.((ν, C);digits=3))
end (on the branch of this PR) and I get the results:
So the algorithm fails completely in the case of regular behavior. The NaN result shows that there has to be some problem with the implementation of the algorithm. But the result is also that a period-4 motion is "Partially Predictable Chaos" instead of "Laminar" behavior. This can't be correct, right? @hwernecke when coming up with the algorithm, have you tested it with discrete systems? Is it our implementation that is at fault, or does it in general not perform well for discrete systems? |
When developing the test we focused on continuous systems (ODE) with periodic and chaotic motion and only checked fixed point and discrete systems (maps) briefly. But now that you report the issue I remember what the problem is (sorry, could have happened earlier...). Discrete Systems
Fixed points At a fixed point (and I only consider stable, i.e. attracting ones) the dynamics is characterized by a negative Lyapunov exponents, the largest of which is For the test that means:
Two ways out:
I hope that helps to overcome the misery of fixed points. And again: I am sorry that I completely forgot about this issue... |
@hwernecke perfect, thank you very much for your reply. I am happy because this is also what I have been thinking as the answer to this "problem". From my perspective the best way forward is to simply deduce the result for discrete systems based on @efosong I will take care of the internals of the function to handle discrete systems or very small exponents. In the meantime, can you please work on the docstring? There is also one more thing remaining as a test: to bring in one more continuous system to check. We could use either of the systems Hendrik suggested in his comments in #83 , or we could also use the second system that Hendrik uses in the paper (which is a bit simpler than the neural model). Then this PR is done! |
@Datseris I've added a docstring. I tried to copy the style of some of the other docstrings. Please can you take a look and tell me if you think it's clear/any changes need to be made? I'm also trying to implement the 3 neuron network in Wernecke et al 2018. I think I have it working, but I think my choice of initial conditions is quite different to the paper and perhaps causing it to converge to a different attractor. @hwernecke please can you let me know how you initialised x and b in this paper? In particular I'm trying to replicate figure 4 and get qualitatively similar behaviour but slightly different results --- my initialisation is random, but if you chose the initial conditions deliberately it would be good to know so I can be more confident in my comparison. I could put a pull request in to add this model as a predefined system (with an arbitrary number of neurons) if you'd like @Datseris. |
Awesome. Sure, I'm on it!
Definitely, seems like a plan! |
@efosong you have done a wonderful job here. The code is clear, understandable and transparent. The documentation string is excellent (I only did some minor changes, mostly to account for the above discussion; we return LAM for negative exponents), and the method seems to work fine for the Lorenz tests. Your contribution is now certainly enough for you to get the bounty. Of course, if you want to contribute tests for the neural system, this will be welcomed. But I just want to point out that you don't have to if you don't want to! Let me know if you still want to do this, otherwise I'll merge. (I am now writing tests for the Henon map!) |
To be in line withy the rest of the documentation of DYnamicalSystems
It is not defined for SimpleATsit
Just a word of caution: I've changed "laminar" to "regular" throughout. In every other place in DynamicalSystems.jl documentation I use the word regular instead of laminar, so it is nice to have it fitting more. |
Thanks @Datseris and @hwernecke for helping with this (my first open source) PR. @Datseris: I think I might add tests for this neuron model at some point, but perhaps that can be added in a separate PR some time in the future so I can get this PR checked off my Todo list. If you're happy to merge the pull request now, then please do it 🙂 I ran into a little trouble with using my model with a At some point in the future I also hope to add some parallelisation as @SebastianM-C suggested, but this will come in another PR. I might also take a look at some of the other issues at some point (e.g. #77, #84) and hopefully I'll be able to contribute a bit more independently for those ones! |
@efosong I am very happy to see that you are considering to contribute more!
If you open an issue at DynamicalSystemsBase with a MWE (or if you PR the system you defined you can mention the error there) I can help you with it. |
@efosong don't forget to request the bounty! |
@efosong Your plot looks great! |
We continue here directly from #83 , I made a mistake and merged the previous one...
Closes #68