Skip to content

Commit

Permalink
0-distances bug fxed
Browse files Browse the repository at this point in the history
  • Loading branch information
hkraemer committed Mar 18, 2021
1 parent 4a0e460 commit 5f23258
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/source/pecuzal_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ def uzal_cost_pecuzal(Y, Y_trial, Tw, K = 3, theiler = 1, norm = 'euclidean', ec
# increased

dist = compute_L_decrease(E2, E2_trial, eps2, eps2_trial, cnt+1, NN)
if math.isnan(dist):
raise Exception('Computed 0-distances. You might use model-data, thus try to add minimal additive noise to the signal you wish to embed and try again.')

if dist > dist_former and dist_former<0:
break
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pecuzal_embedding",
version="1.3.0",
version="1.3.1",
author="K.H.Kraemer",
author_email="[email protected]",
description="PECUZAL automatic embedding of uni- and multivariate time series",
Expand Down
3 changes: 3 additions & 0 deletions src/pecuzal_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ def uzal_cost_pecuzal(Y, Y_trial, Tw, K = 3, theiler = 1, norm = 'euclidean', ec
# increased

dist = compute_L_decrease(E2, E2_trial, eps2, eps2_trial, cnt+1, NN)
if math.isnan(dist):
raise Exception('Computed 0-distances. You might use model-data, thus try to add minimal additive noise to the signal you wish to embed and try again.')

if dist > dist_former and dist_former<0:
break
else:
Expand Down
3 changes: 3 additions & 0 deletions tests/pecuzal_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ def uzal_cost_pecuzal(Y, Y_trial, Tw, K = 3, theiler = 1, norm = 'euclidean', ec
# increased

dist = compute_L_decrease(E2, E2_trial, eps2, eps2_trial, cnt+1, NN)
if math.isnan(dist):
raise Exception('Computed 0-distances. You might use model-data, thus try to add minimal additive noise to the signal you wish to embed and try again.')

if dist > dist_former and dist_former<0:
break
else:
Expand Down

0 comments on commit 5f23258

Please sign in to comment.