Skip to content

Commit

Permalink
Merge pull request #314 from farr/linear-dep-fix
Browse files Browse the repository at this point in the history
Scale-invariant Test for Linear Dependence
  • Loading branch information
dfm authored Oct 17, 2019
2 parents 1904ea5 + 45e72a6 commit 9467f7a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions emcee/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,9 @@ def sample(
state = State(initial_state, copy=True)
if np.shape(state.coords) != (self.nwalkers, self.ndim):
raise ValueError("incompatible input dimensions")
if (not skip_initial_state_check) and np.isclose(
np.linalg.det(
np.cov(state.coords, rowvar=False).reshape(
(self.ndim, self.ndim)
)
),
0,
):
if (not skip_initial_state_check) and np.linalg.cond(
np.atleast_2d(np.cov(state.coords, rowvar=False))
) > 1e8:
warnings.warn(
"Initial state is not linearly independent and it will not "
"allow a full exploration of parameter space",
Expand Down

0 comments on commit 9467f7a

Please sign in to comment.