From 55d5d9726aef265626c9f61e2d1bcf072c88ec57 Mon Sep 17 00:00:00 2001 From: Ignacio del Amo <86604724+PythagoreanCult@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:23:46 +0000 Subject: [PATCH 1/2] Quantile based change To improve the stability of the correlation sum based local dimension estimation, I changed the distmin and distmax to be the 10th and 90th quantile of the distances within the set. I added a line to use the quantile function from the statistics package --- src/corrsum_based/correlationsum_vanilla.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corrsum_based/correlationsum_vanilla.jl b/src/corrsum_based/correlationsum_vanilla.jl index 34fc4e8..74ea95c 100644 --- a/src/corrsum_based/correlationsum_vanilla.jl +++ b/src/corrsum_based/correlationsum_vanilla.jl @@ -1,6 +1,7 @@ import ProgressMeter using Distances: evaluate, Euclidean, pairwise, Metric +using Statistics:quantile export correlationsum, boxed_correlationsum export grassberger_proccacia_dim @@ -255,8 +256,7 @@ function local_correlation_sum(X, ζ, k = 8; norm = Euclidean(), q = 2) end function _generate_boxsizes(k::Int, dists) - dmax = maximum(dists) - dmin = partialsort!(dists, 2) # second smallest + dmin, dmax = quantile(dists, [0.1, 0.9]) # second smallest base = MathConstants.e lower = log(base, dmin) upper = log(base, dmax) From cafef659bc6fda1bb191a62ab4b3576c070008f1 Mon Sep 17 00:00:00 2001 From: Ignacio del Amo <86604724+PythagoreanCult@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:08:42 +0000 Subject: [PATCH 2/2] Erased wrong description Description that no longer applys erased --- src/corrsum_based/correlationsum_vanilla.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corrsum_based/correlationsum_vanilla.jl b/src/corrsum_based/correlationsum_vanilla.jl index 74ea95c..d5e953c 100644 --- a/src/corrsum_based/correlationsum_vanilla.jl +++ b/src/corrsum_based/correlationsum_vanilla.jl @@ -256,7 +256,7 @@ function local_correlation_sum(X, ζ, k = 8; norm = Euclidean(), q = 2) end function _generate_boxsizes(k::Int, dists) - dmin, dmax = quantile(dists, [0.1, 0.9]) # second smallest + dmin, dmax = quantile(dists, [0.1, 0.9]) base = MathConstants.e lower = log(base, dmin) upper = log(base, dmax)