MarineRoboticsGroup/dcsam

Normalization Constant Sign Bug

DanMcGann opened this issue · 1 comments

It appears that there is a minor bug in the computation of a DCFactor normalization constant.

// Compute the (negative) log of the normalizing constant
return -(factor.dim() * log(2.0 * M_PI) / 2.0) -
(log(infoMat.determinant()) / 2.0);

Specifically, the sign of the d/2 log(2 * pi) term. It would be worth it to double check my maths, but I derive that that term is positive...
image

While this does not affect the maximal component, it would cause issues if one assumes that errors are properly normalized.

Hi @DanMcGann - this is a great catch. Thanks for this! Yes, your math looks right :)

I'll push a fix for this ASAP.