Skip to content

Commit

Permalink
improve auto-epsilon for low-res data
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Apr 1, 2021
1 parent 565e261 commit db6ed63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ChaosTools"
uuid = "608a59af-f2a3-5ad4-90b4-758bdf3122a7"
repo = "https://github.com/JuliaDynamics/ChaosTools.jl.git"
version = "1.25.1"
version = "1.25.2"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
10 changes: 7 additions & 3 deletions src/dimensions/linear_regions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,14 @@ function estimate_boxsizes(

mi, ma = minmaxima(A)
max_d = maximum(ma - mi)

min_d, _ = minimum_pairwise_distance(A)
if min_d == 0
@warn(
"Minimum distance in the dataset is zero! Probably because of having data "*
"with low resolution, or duplicate data points. Setting to `d₊/base^4` for now.")
min_d = max_d/(base^4)
end

lower = log(base, min_d)
upper = log(base, max_d)

Expand All @@ -175,12 +181,10 @@ function estimate_boxsizes(
"Automatic boxsize determination was inappropriate: `lower+w` was found ≥ than "*
"`upper+z`. Returning `base .^ range(lower, upper; length = k)`. "*
"Please adjust keywords or provide a bigger dataset.")

εs = float(base) .^ range(lower, upper; length = k)
else
εs = float(base) .^ range(lower+w, upper+z; length = k)
end
@assert issorted(εs)
return εs
end

Expand Down

0 comments on commit db6ed63

Please sign in to comment.