sccoda.model.scCODA_model.CompositionalModel.sample_hmc_da

CompositionalModel.sample_hmc_da(num_results=20000, num_burnin=5000, num_adapt_steps=None, num_leapfrog_steps=10, step_size=0.01, verbose=True)

HMC sampling with dual-averaging step size adaptation (Nesterov, 2009)

Tracked diagnostic statistics:

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

  • 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)

  • log_acc_ratio: log-acceptance ratio

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

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

Parameters
num_results : intint (default: 20000)

MCMC chain length (default 20000)

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

num_leapfrog_steps : int, NoneOptional[int] (default: 10)

HMC leapfrog steps (default 10)

step_size : floatfloat (default: 0.01)

Initial step size (default 0.01)

verbose : boolbool (default: True)

If true, a progress bar is printed during MCMC sampling

Return type

CAResultCAResult

Returns

  • result object

  • result – Compositional analysis result