TransportMaps.LaplaceApproximationRoutines
¶
Module Contents¶
Functions¶
|
Compute the Laplace approximation of the distribution \(\pi\). |
|
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 forders>=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 forders==2
hess_approx (str) – whether to compute a finite difference Hessian
fd
, or a low-rank approximation of itlow-rank
. This is used only ifders==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