bartz.mcmcstep.make_p_nonterminal

bartz.mcmcstep.make_p_nonterminal(d, alpha=0.95, beta=2.0)[source]

Prepare the p_nonterminal argument to init.

It is calculated according to the formula:

P_nt(depth) = alpha / (1 + depth)^beta, with depth 0-based

Parameters:
  • d (int) – The maximum depth of the trees (d=1 means tree with only root node)

  • alpha (float | Float[Array, ''] | Float[ndarray, ''], default: 0.95) – The a priori probability of the root node having children, conditional on it being possible

  • beta (float | Float[Array, ''] | Float[ndarray, ''], default: 2.0) – The exponent of the power decay of the probability of having children with depth.

Returns:

Float32[Array, '{d}-1']An array of probabilities, one per tree level but the last.