sccoda.model.other_models.SimpleModel.sample_hmc

SimpleModel.sample_hmc(num_results=20000, num_burnin=5000, num_adapt_steps=None, num_leapfrog_steps=10, step_size=0.01)

Hamiltonian Monte Carlo (HMC) sampling in tensorflow 2.

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)

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

Return type

CAResultCAResult

Returns

  • results object

  • result – Compositional analysis result