Commit db3aa7a2 authored by Theo Steininger's avatar Theo Steininger

added n to determinant part, too.

parent 219a9082
......@@ -98,9 +98,6 @@ class EnsembleLikelihood(Likelihood):
result_1 = np.vdot(c, first_summand_val)
result_2 = -np.vdot(c, second_summand_val)
result_1 /= n
result_2 /= n
# compute regularizing determinant of the covariance
# det(A + UV^T) = det(A) det(I + V^T A^-1 U)
log_det_1 = np.sum(np.log(B))
......@@ -108,6 +105,11 @@ class EnsembleLikelihood(Likelihood):
if sign < 0:
self.logger.error("Negative determinant of covariance!")
result_1 /= n
result_2 /= n
log_det_1 /= n
log_det_2 /= n
result = -0.5*(result_1 + result_2 + log_det_1 + log_det_2)
self.logger.info("Calculated (%s): -(%g + %g + %g + %g) = %g" %
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment