Skip to content

Commit

Permalink
sigma estimate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Oct 6, 2023
1 parent fa301ff commit b1f9afd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/apsg/plotting/_stereogrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ def calculate_density(self, features, **kwargs):
# k = estimate_k(features)
# sigma = np.sqrt(2 * n / (k - 2))
# Totally empirical as estimate_k is problematic
sigma = np.sqrt(2 * n / (np.log(n) - 2)) / 3
k = 2 * (1.0 + n / sigma**2)
else:
k = 2 * (1.0 + n / sigma**2)
if n < 10:
sigma = 3
else:
sigma = np.sqrt(2 * n / (np.log(n) - 2)) / 3
k = 2 * (1.0 + n / sigma**2)
# method = kwargs.get("method", "exp_kamb")
trim = kwargs.get("trimzero", True)
sigmanorm = kwargs.get("sigmanorm", True)
Expand Down

0 comments on commit b1f9afd

Please sign in to comment.