Posterior Sampling Stopping Criteria¶
Class providing stopping criteria for Bayesian posterior sampling simulations—conditions that terminate the MCMC run before the convergence criterion is satisfied. Implementations might stop after a fixed number of steps, upon reaching a target log-likelihood, when an external signal is received, or when a user-defined condition on the simulation state is met. The stop method is queried at each sampling step and returns true when the stopping condition is triggered, allowing the sampler to exit cleanly.
Default implementation: posteriorSampleStoppingCriterionNever
Methods¶
stop→logicalReturns true if the posterior sampling should terminate immediately given the current simulation state, allowing the sampler to exit cleanly before reaching the maximum step count.
class(posteriorSampleStateClass), intent(inout) :: simulationState
posteriorSampleStoppingCriterionCorrelationLength¶
This type will cause the simulation to stop when at least a number of correlation lengths (as specified in the [stopAfterCount] parameter) have accrued post-convergence.
Parameters
[stopAfterCount]— The number of correlation lengths to continue after convergence before stopping.
posteriorSampleStoppingCriterionNever¶
A posterior sampling stopping criterion class that always returns false, allowing the sampler to run for the full maximum number of steps without terminating early based on any stopping condition.
(Default implementation)
posteriorSampleStoppingCriterionStepCount¶
This type will cause the simulation to stop when at least a number of steps (as specified by [stopAfterCount]) have accrued post-convergence.
Parameters
[countSteps]— The number of steps after which to declare the simulation as converged.[stopAfterCount]— The number of steps to continue after convergence before stopping.