Calculate the estimated Bayesian fraction of missing information (BFMI).

BFMI quantifies how well momentum resampling matches the marginal energy distribution. For more information on BFMI, see The current advice is that values smaller than 0.3 indicate poor sampling. However, this threshold is provisional and may change. See for more information.

energy : NumPy array

Should be extracted from a gradient based sampler, such as in Stan or PyMC3. Typically, after converting a trace or fit to InferenceData, the energy will be in

z : array

The Bayesian fraction of missing information of the model and trace. One element per chain in the trace.