Skip to main content
← Lab

lognojac

confirmedupstream bugPython · pomegranateSystems & data structuresJuly 25, 2026

the question

Does pomegranate's LogNormal.log_probability include the change-of-variables Jacobian?

what came out

pomegranate's LogNormal.log_probability returns the parent Normal log-density of log x without subtracting the Jacobian log x, so it differs from scipy.lognorm.logpdf by exactly +log x, integrates to 1.87 not 1, and flips a GeneralMixtureModel hard assignment. Fix: subtract X.log().sum(dim=-1).

method & receipts

  • Result: confirmed
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/lognojac