Closed EmreAtes closed 6 years ago
Hello Emre. Thank you for your feedback. I have the issue in the back of my mind since you posted it, but I am currently to busy with my Job and PhD to work on Nolds. I expect to be able to look into this in a month or two.
It seems it has taken a lot more than two month for me to finally find the time to respond to this issue. Unfortunately, it has been a stressful semester for me.
Regarding your issues:
lyap_r
. Something like (emb_dim - 1) * lag + 1 + max(min_tsep * 2, trajectory_len)
should do the trick, but I will have to run a few tests to confirm that. Once I do, I will add a more comprehensible error message to the function.[263, 267, 267, 267, ...]
and another vector [267, 267, 267, 267, ...]
. This leaves you with a single point, which is not enough for a meaningful line fitting. I did not yet run any test to confirm this, but it seems like a plausible explanation for the nan
-result.Thanks. I hope your PhD is going well now. I ended up using rpy2
and calling some R functions to calculate the Lyapunov exponent, but let me know if there's anything you need from me.
I just released version 0.5.1 which should adress both the issue with pandas and with the minimum required length for several algorithms.
Fun facts:
lyap_r
you need (emb_dim - 1) * lag + trajectory_len + min_tsep * 2 + 1
data points.lyap_e
the required length is emb_dim + (emb_dim - 1)/(matrix_dim - 1) + min_tsep * 2 + min_nb
I see that these requirements where not very obvious before. :wink: Now you can calculate them with the functions lyap_r_len
and lyap_e_len
and you get comprehensible warnings and errors.
I will close this issue now, but since I am not familiar with pandas, I would appreciate it if you could let me know if your example now also works when you pass the pandas object directly to lyap_r
(either here as quick comment or via mail).
Yeah, it works fine with pandas, and there are more informative warnings on the minimum input length. Thanks.
Also, I've noticed that a constant series returns -inf
now instead of nan
, but I don't know which one is supposed to be correct.
Nice, thanks for testing. :smile:
I think -inf
should be correct, since a constant series is the most un-chaotic thing you can imagine. :laughing:
I get some errors for time series of different lengths. As far as I can see, there aren't any warnings in the documentation about these.
For example, for
lag=5
andmin_tsep=10
, any time series that are shorter than 45 elements long gets the following error:However, until 54 elements, a different error is given:
For
lag=4
andmin_tsep=8
, the thresholds are 36 to 55, however 45 generates no errors. Also, for some time-series lengths, I get another error:What are the allowed timeseries lenghts?
Also, how is the lyapunov exponent defined for a timeseries which is
[263, 267, 267, 267, ...]
? Currently I get this value:Finally, kind of unrelated, when a pandas series is passed into the function, I get another error, thats why I use the
np.asarray
. I can open a separate issue for that if necessary: