Advanced API

MCMC Samplers

surmise.create_sampler(sampler, expert_mode)[source]

Construct a sampler function for direct use by surmise calibrators. The following example demonstrates its use.

sample_with_PTLMC = surmise.create_sampler("PTLMC", expert_mode=False)
results = sample_with_PTLMC(
    logpost_func=log_posterior,
    draw_func=draw_from_start_distribution,
    scipy_stats_rng=np.random.default_rng(RAND_SEED),
    specification=ptlmc_spec
)

For typical use cases, samplers are created automatically under-the-hood on behalf of users. Therefore, there is generally no need to explicitly create or access samplers. This function is in the surmise public interface only as an advanced feature for use by developers and power users.

Parameters:
Returns:

The desired sampler function.