.. index:: pair: struct; gpr::laplace::PsisLaplaceOptions .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options: struct gpr::laplace::PsisLaplaceOptions ======================================= .. toctree:: :hidden: Overview ~~~~~~~~ Options for the PSIS-Laplace sampler. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct PsisLaplaceOptions { // fields int :ref:`n_samples` = 16; double :ref:`k_hat_threshold` = 0.7; double :ref:`hessian_jitter_max` = 1.0e-3; uint64_t :ref:`seed` = 42; bool :ref:`deterministic_axial_grid` = false; }; .. _details-structgpr_1_1laplace_1_1_psis_laplace_options: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Options for the PSIS-Laplace sampler. Defaults match the slice sampler's M = 16 so the per-fit cache is the same shape, but the per-sample cost is roughly 5x smaller because PSIS does no doubling step-out / shrink-propose loop. Fields ------ .. index:: pair: variable; n_samples .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options_1a212b31babce5f87d0ed326170b5a789a: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_samples = 16 Number K of importance samples drawn from the Laplace proposal. Default 16 matches :ref:`SliceSamplerOptions::n_samples ` for a fair per-fit-cache comparison. Vehtari 2024 recommends K >= 32 for stable PSIS smoothing but at K = 16 the self-normalised IS estimator still has bounded variance (the smoothing matters mainly above K = 100). Reducing K to 8 was empirically a no-op on PET-MAD np=16 wall: the per-call variance loop is not the dominant cost; the per-fit assembleExactHessian (10 directional curvatures via Williams-Rasmussen 5.9 polarisation) is. .. index:: pair: variable; k_hat_threshold .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options_1aea4591bb44d6d762dc927e12799ff1f6: .. ref-code-block:: cpp :class: doxyrest-title-code-block double k_hat_threshold = 0.7 Vehtari 2024 reliability threshold on the fitted Pareto shape k_hat: > 0.7 marks the proposal as missing the posterior tail and the caller should fall back. The default matches the JMLR paper's "unreliable" cutoff exactly. .. index:: pair: variable; hessian_jitter_max .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options_1ac43d5c059fab29a5114536c2df201360: .. ref-code-block:: cpp :class: doxyrest-title-code-block double hessian_jitter_max = 1.0e-3 Cap on the Cholesky jitter floor we will add to the Hessian before factorising. The Hessian at the SCG MAP can be barely positive-definite when the dimer's BFGS landed on a flat passenger direction; bump up to this much before declaring the proposal singular. .. index:: pair: variable; seed .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options_1a7ab4a3a0c2189da4802b508956ca1ed3: .. ref-code-block:: cpp :class: doxyrest-title-code-block uint64_t seed = 42 RNG seed for sample generation. Used only when ``:ref:`deterministic_axial_grid ` == false``. .. index:: pair: variable; deterministic_axial_grid .. _doxid-structgpr_1_1laplace_1_1_psis_laplace_options_1ae7a7592e069c0bdaae5641702856d15f: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool deterministic_axial_grid = false Use a deterministic axial grid (CCD-style) instead of random IS draws. With this true, the K samples are placed at (theta_MAP, theta_MAP +/- sigma_j e_j for j = 1..p) on the principal axes of H^{-1}, where e_j is the j-th eigenvector. K = 1 + 2 p deterministic nodes np-reproducible because no per-rank seed offset, no Monte Carlo variance. Trades sampling freedom for reproducibility. Recommended for production LAPLACE_SLICE; the random IS draws (``false``) are kept for research / unit-test coverage of the PSIS smoothing path.