bartz.mcmcloop.MainTrace¶
- class bartz.mcmcloop.MainTrace(has_chains, mesh, grow_prop_count, grow_acc_count, prune_prop_count, prune_acc_count, mean_tree_life, error_cov_inv, sum_trees_prior_cov_inv, theta, log_likelihood, log_trans_prior, leaf_tree, var_tree, split_tree, offset, leaf_unit, varprob)[source]¶
MCMC trace with trees and diagnostic values.
- grow_prop_count: Int32[Array, '*chains_and_samples']¶
The number of grow proposals made during one full MCMC cycle.
- grow_acc_count: Int32[Array, '*chains_and_samples']¶
The number of grow moves accepted during one full MCMC cycle.
- prune_prop_count: Int32[Array, '*chains_and_samples']¶
The number of prune proposals made during one full MCMC cycle.
- prune_acc_count: Int32[Array, '*chains_and_samples']¶
The number of prune moves accepted during one full MCMC cycle.
- mean_tree_life: Float32[Array, '*chains_and_samples']¶
The average over the trees in use of
bartz.mcmcstep.Forest.tree_life, NaN if there are none.
- error_cov_inv: Float32[Array, '*chains_and_samples'] | Float32[Array, '*chains_and_samples k k']¶
The inverse error covariance (scalar for univariate, matrix for multivariate). Identity in binary regression.
- sum_trees_prior_cov_inv: Float32[Array, '*chains_and_samples'] | Float32[Array, '*chains_and_samples k k']¶
The inverse prior covariance of the sum of trees (scalar for univariate, matrix for multivariate), see
bartz.mcmcstep.Forest.sum_trees_prior_cov_inv. Constant if it is fixed.
- theta: Float32[Array, '*chains_and_samples'] | None¶
The concentration parameter of the Dirichlet prior on the variable split probabilities, or
Noneif it was not sampled.
- log_likelihood: Float32[Array, '*chains_and_samples num_trees'] | None¶
The log likelihood ratio of the proposed move on each tree, or
None.
- log_trans_prior: Float32[Array, '*chains_and_samples num_trees'] | None¶
The log transition and prior Metropolis-Hastings ratio of the proposed move on each tree, or
None.
- leaf_tree: Float[Array, '*chains_and_samples num_trees max_num_leaves'] | Float[Array, '*chains_and_samples num_trees k max_num_leaves']¶
The leaf values, in units of
leaf_unit, laid out as inbartz.grove.TreeHeaps, zero in the elements not in use.
- var_tree: UInt[Array, '*chains_and_samples num_trees max_num_leaves']¶
The decision axes.
- split_tree: UInt[Array, '*chains_and_samples num_trees max_num_leaves']¶
The decision boundaries.
- offset: Float32[Array, ''] | Float32[Array, 'k']¶
Constant shift added to the scaled sum of trees.
- leaf_unit: Float32[Array, ''] | Float32[Array, 'k']¶
The storage unit of the leaf values. Predictions are
offset + leaf_unit * (sum of leaf values over trees).
- varprob: Float32[Array, '*chains_and_samples p'] | VarprobInState | None¶
The probability of choosing each variable for a decision rule, normalized over variables,
Nonewhen variable selection is off, orVarprobInStatewhen it is constant.