Skip to content

Commit

Permalink
Trigger fully correlated variables for corr2D very close to one (#75)
Browse files Browse the repository at this point in the history
* Trigger fully correlated variables for corr2D equals one at 1e-8 accuracy

* fix white line

* Catch nearly perfect anti-correlations

Co-authored-by: chris <chris@ringeval.com>
  • Loading branch information
eatdust and chris committed Dec 17, 2021
1 parent 141962e commit 89522a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions getdist/mcsamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,9 +1657,9 @@ def get2DDensityGridData(self, j, j2, num_plot_contours=None, get_density=False,
has_prior = parx.has_limits or pary.has_limits

corr = self.getCorrelationMatrix()[j2][j]
if corr == 1:
if abs(abs(corr) - 1.0) <= 1e-8:
logging.warning('Parameters are 100%% correlated: %s, %s', parx.name, pary.name)
corr = self.max_corr_2D
corr = np.sign(corr) * self.max_corr_2D

logging.debug('Doing 2D: %s - %s', parx.name, pary.name)
logging.debug('sample x_err, y_err, correlation: %s, %s, %s', parx.err, pary.err, corr)
Expand Down

0 comments on commit 89522a7

Please sign in to comment.