Skip to content

Commit

Permalink
Base KLIEP basis sigma on minimum marginal sigma (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpesonen authored Mar 23, 2021
1 parent 20db86b commit 4e17f5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elfi/methods/inference/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def _resolve_sample(self, backwards_index):
weights = sample.weights
samples = sample.samples_array
sample_sigma = np.sqrt(np.diag(sample.cov))
sigma_max = np.max(sample_sigma)
sigma_max = np.min(sample_sigma)
sample_data = dict(samples=samples, weights=weights, sigma_max=sigma_max)

return sample_data
Expand All @@ -834,7 +834,7 @@ def _densityratio_initial_sample(self):
samples = self._prior.rvs(size=n_samples, random_state=self._round_random_state)
weights = np.ones(n_samples)
sample_cov = np.atleast_2d(np.cov(samples.reshape(n_samples, -1), rowvar=False))
sigma_max = np.max(np.sqrt(np.diag(sample_cov)))
sigma_max = np.min(np.sqrt(np.diag(sample_cov)))
return dict(samples=samples,
weights=weights,
sigma_max=sigma_max)

0 comments on commit 4e17f5f

Please sign in to comment.