bartz.mcmcstep.make_p_nonterminal¶
- bartz.mcmcstep.make_p_nonterminal(d, alpha=0.95, beta=2.0)[source]¶
Prepare the
p_nonterminalargument toinit.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 possiblebeta (
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.