pytyche.bcf.hurdle.proposals

Hurdle BCF grow/prune proposals and forest initialisation.

These are internal helpers used by the joint hurdle MCMC loop.

Classes

HurdleMove(grow, node, left, right, ...)

Per-tree GROW/PRUNE move metadata for the parallel-LML fast path.

class pytyche.bcf.hurdle.proposals.HurdleMove(grow, node, left, right, log_ratio_struct, allowed, log_u)[source]

Bases: NamedTuple

Per-tree GROW/PRUNE move metadata for the parallel-LML fast path.

Mirrors bartz’s Moves Module but as a JAX-pytree NamedTuple so it threads through vmap and lax.scan carries naturally.

Carries the proposal direction (grow), the heap indices of the node and its two children, the structural + proposal log-ratio for Metropolis-Hastings, a gating bit (allowed), and the U(0,1] draw used for the accept comparison.

Parameters:
  • grow (Array)

  • node (Array)

  • left (Array)

  • right (Array)

  • log_ratio_struct (Array)

  • allowed (Array)

  • log_u (Array)

grow: Array

Alias for field number 0

node: Array

Alias for field number 1

left: Array

Alias for field number 2

right: Array

Alias for field number 3

log_ratio_struct: Array

Alias for field number 4

allowed: Array

Alias for field number 5

log_u: Array

Alias for field number 6