bartz.mcmcloop.compute_varcount

bartz.mcmcloop.compute_varcount(p, trace, *, out_chain_axis=0)[source]

Count how many times each predictor is used in each MCMC state.

Parameters:
  • p (int) – The number of predictors.

  • trace (EvaluableTrace) – A main trace of the BART MCMC, as returned by run_mcmc.

  • out_chain_axis (int, default: 0) – Position of the chain axis in the output, whose chainless shape is (samples, p). Negative values count from the end. Ignored when trace has no chain axis.

Returns:

Int32[Array, '*trace_shape {p}']Histogram of predictor usage in each MCMC state.