Skip to content

Commit

Permalink
adds test with lorenz dataset for corr_dim
Browse files Browse the repository at this point in the history
  • Loading branch information
CSchoel committed Oct 29, 2023
1 parent c8cf511 commit 5962f0e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion nolds/test_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,22 @@ def test_corr_dim(self):
cd = nolds.corr_dim(data, 4, fit="poly")
self.assertAlmostEqual(cd, 0.5, delta=0.15)
# TODO test example for cd > 1
def test_corr_dim_logistic(self):

def test_lorenz(self):
# NOTE: The settings of n, discard, lag, emb_dim, and rvals were determined
# experimentally to find the smallest dataset that yields the results reported
# by Grassberger and Procaccia (1983).
discard = 5000
n = 5000
lag = 5
emb_dim = 5
data = datasets.lorenz_euler(n + discard, 10, 28, 8/3, start=(1,1,1), dt=0.012)
x = data[discard:,1]
rvals = nolds.logarithmic_r(1, np.e, 1.1) # determined experimentally
cd = nolds.corr_dim(x, emb_dim, fit="poly", rvals=rvals, lag=5, debug_plot=True)
self.assertAlmostEqual(cd, 2.05, delta=0.1)

def test_logistic(self):
# TODO replicate tests with logistic map from grassberger-procaccia
pass

Expand Down

0 comments on commit 5962f0e

Please sign in to comment.