sccoda.model.other_models.SimpleModel.sample_nuts

SimpleModel.sample_nuts(num_results=10000, num_burnin=5000, num_adapt_steps=None, max_tree_depth=10, step_size=0.01, verbose=True)

HMC with No-U-turn (NUTS) sampling. This method is untested and might yield different results than expected.

Tracked diagnostic statistics:

  • target_log_prob: Value of the model’s log-probability

  • leapfrogs_taken: Number of leapfrog steps taken by the integrator

  • diverging: Marks samples as diverging (NOTE: Handle with care, the spike-and-slab prior of scCODA usually leads to many samples being flagged as diverging)

  • energy: HMC “Energy” value for each step

  • log_accept_ratio: log-acceptance ratio

  • step_size: The step size used by the algorithm in each step

  • reached_max_depth: Whether the NUTS algorithm reached the maximum sampling depth in each step

  • is_accepted: Whether the proposed sample was accepted in the algorithm’s acceptance step

Parameters
num_results : intint (default: 10000)

MCMC chain length (default 10000)

num_burnin : intint (default: 5000)

Number of burnin iterations (default 5000)

num_adapt_steps : int, NoneOptional[int] (default: None)

Length of step size adaptation procedure

max_tree_depth : intint (default: 10)

Maximum tree depth (default 10)

step_size : floatfloat (default: 0.01)

Initial step size (default 0.01)

verbose : floatfloat (default: True)

If true, a progress bar is printed during MCMC sampling

Return type

CAResultCAResult

Returns

  • result object

  • result – Compositional analysis result