bartz.stochtree.TreatmentEffectForestParams¶
- class bartz.stochtree.TreatmentEffectForestParams(*, num_trees=100, alpha=0.25, beta=3.0, min_samples_leaf=5, keep_vars=None, drop_vars=None, max_depth=5, sample_sigma2_leaf=False, sigma2_leaf_init=None, sigma2_leaf_shape=3.0, sigma2_leaf_scale=None, delta_max=0.9, sample_intercept=True, tau_0_prior_var=None)[source]¶
Mirror of stochtree’s
treatment_effect_forest_paramsdict, restricted to the keys bartz handles.- sample_sigma2_leaf: bool = False¶
Whether to sample the leaf variance with an inverse-gamma prior, or hold it fixed at
sigma2_leaf_init.
- sigma2_leaf_init: float | Float[Array, ''] | Float[ndarray, ''] | None = None¶
Initial leaf variance. If
None, matches stochtree’s defaults ofvar(resid_train) / (2 * num_trees)for continuous andsquare(delta_max / (q * phi(0))) / num_treesfor probit, withq = Phi^-1(0.84135) ≈ 1.
- sigma2_leaf_scale: float | Float[Array, ''] | Float[ndarray, ''] | None = None¶
Twice the scale parameter of the inverse-gamma prior on the leaf variance. If
None, defaults tovar(resid_train) / (2 * num_trees)for continuous and1 / (2 * num_trees)for probit.
- delta_max: float | Float[Array, ''] | Float[ndarray, ''] = 0.9¶
Maximum plausible treatment effect on the probability scale, setting the default
sigma2_leaf_initfor probit.
- sample_intercept: bool = True¶
Whether to sample a global treatment effect intercept
tau_0, included in the treatment effect.
- tau_0_prior_var: float | Float[Array, ''] | Float[ndarray, ''] | None = None¶
Variance of the normal prior on
tau_0. IfNone,var(resid_train).
- drop_vars: Sequence[str] | Sequence[int] | Shaped[ndarray, 'k_drop'] | Integer[Array, 'k_drop'] | Series | None = None¶
Names (for dataframes) or indices of covariates the trees may not split on. Ignored if
keep_varsis set.