feat: positive semi-definite estimator for the covariance implemented,

fits.covariance matrix deprecated, covariance can now handle lists of
observables.
This commit is contained in:
Fabian Joswig 2022-03-01 09:45:25 +00:00
parent 8e3e34bbea
commit 82419b7a88
5 changed files with 65 additions and 79 deletions

View file

@ -39,8 +39,8 @@ def test_covobs():
assert(np.isclose(oc.value, op.value, rtol=1e-14, atol=1e-14))
[o.gamma_method() for o in cl]
assert(pe.covariance(cl[0], cl[1]) == cov[0][1])
assert(pe.covariance(cl[0], cl[1]) == cov[1][0])
assert(pe.covariance([cl[0], cl[1]])[0, 1] == cov[0][1])
assert(pe.covariance([cl[0], cl[1]])[0, 1] == cov[1][0])
do = cl[0] * cl[1]
assert(np.array_equal(do.covobs['rAP'].grad, np.transpose([pi[1], pi[0]]).reshape(2, 1)))
@ -89,7 +89,7 @@ def test_covobs_covariance():
x = [a + b, a - b]
[o.gamma_method() for o in x]
covariance = pe.fits.covariance_matrix(x)
covariance = pe.covariance(x)
assert covariance[0, 0] == covariance[1, 1]
assert covariance[0, 1] == a.dvalue ** 2 - b.dvalue ** 2