bayesplain.core.grid.normalize_log_density¶
- bayesplain.core.grid.normalize_log_density(log_density, grid)[source]¶
Turn an unnormalised log density on a grid into a proper density.
Subtracts the maximum before exponentiating, so densities that would otherwise underflow to zero are handled without loss of precision, then divides by the trapezoidal integral.