Skip to content

drpangloss.inference

Functions

hessian_matrix(objective, x)

Return the Hessian matrix of objective evaluated at x.

regularized_inverse(matrix, ridge=1e-10)

Return a numerically stabilized inverse with diagonal ridge regularization.

laplace_covariance(objective, x, ridge=1e-10)

Return Laplace covariance from the Hessian of a negative log-likelihood objective.

fisher_matrix(objective, x, ridge=0.0)

Approximate local Fisher matrix using the Hessian of objective at x.

fisher_projection(fmat, eps=1e-12)

Return projection matrix mapping unit-normal latent vectors to parameter steps.

If u ~ N(0, I), then x = x0 + P @ u has local covariance approximately F^{-1} for Fisher matrix F.