Skip to content

Commit

Permalink
Fix symmetric normal sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinpfoertner committed Aug 28, 2020
1 parent b7c131f commit fe0a411
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/probnum/random_variables/_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,9 @@ def _symmetric_kronecker_identical_factors_sample(
size=size_sample, random_state=self.random_state
)

# Cholesky decomposition
eps = 10 ** -12 # damping needed to avoid negative definite covariances
cholA = scipy.linalg.cholesky(
self._cov.A.todense() + eps * np.eye(n), lower=True
)

# Appendix E: Bartels, S., Probabilistic Linear Algebra, PhD Thesis 2019
samples_scaled = linops.Symmetrize(dim=n) @ (
linops.Kronecker(A=cholA, B=cholA) @ stdnormal_samples
self.cov_cholesky @ stdnormal_samples
)

# TODO: can we avoid todense here and just return operator samples?
Expand Down

0 comments on commit fe0a411

Please sign in to comment.