.. index:: pair: struct; gpr::laplace::SliceSamplerOptions .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options: struct gpr::laplace::SliceSamplerOptions ======================================== .. toctree:: :hidden: Overview ~~~~~~~~ Options for the doubling slice sampler. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct SliceSamplerOptions { // fields int :ref:`n_samples` = 16; int :ref:`n_burnin` = 4; double :ref:`initial_width` = 0.5; int :ref:`max_doublings` = 10; int :ref:`max_shrinks` = 32; uint64_t :ref:`seed` = 42; }; .. _details-structgpr_1_1laplace_1_1_slice_sampler_options: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Options for the doubling slice sampler. Defaults are tuned for p=4 hyperparameters with a unimodal log-concave NLML target (the Gaussian likelihood + non-degenerate kernel + bounded-prior regime in ``gpridge``). Fields ------ .. index:: pair: variable; n_samples .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1a99eb732dc7180c365a75d661fffd82a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_samples = 16 Total number of posterior samples to retain after burn-in. At p = 4 the marginal posterior is sharply peaked once SCG converges, so M = 16 captures the spread well; the per-fit-burst cost is M \* ~5 Cholesky each, which on PET-MAD (n_obs \* (D + 1) ~ 500) is the dominant per-outer-iter cost. Keep small unless the bench shows the cached slice spread is undersampled. .. index:: pair: variable; n_burnin .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1af60bf55e44b3500d87213a457fdae492: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_burnin = 4 Number of leading samples to discard for chain warm-up. .. index:: pair: variable; initial_width .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1a77841f29d39df552943551fa3fecb85e: .. ref-code-block:: cpp :class: doxyrest-title-code-block double initial_width = 0.5 Initial step-out width in theta-space (units: nat-log of hyperparameter). Doubled at each step-out iteration. The default 0.5 corresponds to roughly +/- 1.5x in raw kernel parameters, which is wide enough to escape the local Laplace well without overshooting into pathological regions. .. index:: pair: variable; max_doublings .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1a96f2bc3b1df277a9c052ef21b78d9327: .. ref-code-block:: cpp :class: doxyrest-title-code-block int max_doublings = 10 Cap on doubling iterations (Neal 2003 calls this ``p``). After ``:ref:`max_doublings ``` doublings the interval is treated as "wide enough" even if the slice is not fully bracketed. .. index:: pair: variable; max_shrinks .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1a99b401d4c7bd2f443f1e44f2c9d15ef2: .. ref-code-block:: cpp :class: doxyrest-title-code-block int max_shrinks = 32 Cap on shrink-and-propose attempts per slice step. After ``:ref:`max_shrinks ``` rejections the step is aborted and the chain stays at theta_curr (functionally equivalent to a stuck step). .. index:: pair: variable; seed .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_options_1ab725187aa57d7f93a69f7faa447c5294: .. ref-code-block:: cpp :class: doxyrest-title-code-block uint64_t seed = 42 RNG seed for reproducibility. The same seed across MPI ranks gives an identical chain (sampling runs only on rank 0).