TransportMaps.LaplaceApproximationRoutines

Module Contents

Functions

laplace_approximation(pi[, params, x0, tol, ders, ...])

Compute the Laplace approximation of the distribution \(\pi\).

laplace_approximation_withBounds(pi[, params, tol, ...])

Compute the Laplace approximation of the distribution \(\pi\).

TransportMaps.LaplaceApproximationRoutines.laplace_approximation(pi, params: dict | None = None, x0=None, tol=1e-05, ders=2, fungrad=False, hessact=False, hess_approx='low-rank', hess_fd_eps=1e-06, low_rank_rnd_eps=1e-05, low_rank_rnd_ovsamp=10, low_rank_rnd_pow_n=0)[source]

Compute the Laplace approximation of the distribution \(\pi\).

Parameters:
  • pi (Distribution) – distribution \(\pi\)

  • params (dict) – parameters for distribution \(\pi\)

  • tol (float) – tolerance to be used to solve the maximization problem.

  • ders (int) – order of derivatives available for the solution of the optimization problem. 0 -> derivative free, 1 -> gradient, 2 -> hessian.

  • fungrad (bool) – whether the distribution \(\pi\) provide the method Distribution.tuple_grad_x_log_pdf() computing the evaluation and the gradient in one step. This is used only for ders>=1.

  • hessact (bool) – whether the distribution \(\pi\) provides the method Distribution.action_hess_x_log_pdf() computing the action of the Hessian on a vector. This is used only for ders==2

  • hess_approx (str) – whether to compute a finite difference Hessian fd, or a low-rank approximation of it low-rank. This is used only if ders==1.

  • hess_fd_eps (float) – tolerance for finite difference Hessian

  • low_rank_rnd_eps (float) – tolerance to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood

  • low_rank_rnd_pow_n (int) – number of power iterations to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood

  • low_rank_rnd_ovsamp (int) – oversampling to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood

Returns:

(NormalDistribution) – Laplace approximation

TransportMaps.LaplaceApproximationRoutines.laplace_approximation_withBounds(pi, params=None, tol=1e-05, ders=2, disp=True, bounds=None)[source]

Compute the Laplace approximation of the distribution \(\pi\).

Parameters:
  • pi (Distribution) – distribution \(\pi\)

  • params (dict) – parameters for distribution \(\pi\)

  • tol (float) – tolerance to be used to solve the maximization problem.

  • ders (int) – order of derivatives available for the solution of the optimization problem. 0 -> derivative free, 1 -> gradient, 2 -> hessian.

  • disp (bool) – whether to display output from optimizer.

Returns:

(NormalDistribution) – Laplace approximation