class gpr::laplace::PsisLaplace¶
Overview¶
PSIS-Laplace sampler: draws K samples from N(theta_MAP, H^{-1}), evaluates raw log-weights log p_target(theta_k) - log q(theta_k), and PSIS-smooths the upper tail. More…
#include <PsisLaplace.h>
class PsisLaplace {
public:
// typedefs
typedef std::function<double(const Eigen::VectorXd&)> LogTarget;
typedef std::function<Eigen::VectorXd(const Eigen::VectorXd&)> AlphaCacheFn;
// construction
PsisLaplace(PsisLaplaceOptions opts = {});
// methods
bool fit(const Eigen::VectorXd& theta_map, const Eigen::MatrixXd& hessian, const LogTarget& log_target, const AlphaCacheFn& alpha_fn, PsisLaplaceState& out);
};
Detailed Documentation¶
PSIS-Laplace sampler: draws K samples from N(theta_MAP, H^{-1}), evaluates raw log-weights log p_target(theta_k) - log q(theta_k), and PSIS-smooths the upper tail.
Typedefs¶
typedef std::function<double(const Eigen::VectorXd&)> LogTarget
Caller-supplied target: returns log p(theta | y) (matches the SliceSampler::LogTarget signature exactly so the same closures fit both paths).
typedef std::function<Eigen::VectorXd(const Eigen::VectorXd&)> AlphaCacheFn
Caller-supplied alpha cache builder. Same contract as SliceSampler::AlphaCacheFn.
Methods¶
bool fit(const Eigen::VectorXd& theta_map, const Eigen::MatrixXd& hessian, const LogTarget& log_target, const AlphaCacheFn& alpha_fn, PsisLaplaceState& out)
Draw K samples from N(theta_map, hessian^{-1}), populate out.theta_samples / alpha_samples / weights / k_hat / reliable. Returns true on success (every log_target evaluation finite, proposal Cholesky succeeded). Returns false if the proposal covariance cannot be Cholesky-factored even after jittering the Hessian by options.hessian_jitter_max.