arviz.bfmi

arviz.bfmi(data)[source]

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 https://arxiv.org/pdf/1604.00695v1.pdf. The current advice is that values smaller than 0.3 indicate poor sampling. However, this threshold is provisional and may change. See http://mc-stan.org/users/documentation/case-studies/pystan_workflow.html for more information.

Parameters
dataobj

Any object that can be converted to an az.InferenceData object. Refer to documentation of az.convert_to_dataset for details. If InferenceData, energy variable needs to be found.

Returns
zarray

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

Examples

Compute the BFMI of an InferenceData object

In [1]: import arviz as az
   ...: data = az.load_arviz_data('radon')
   ...: az.bfmi(data)
   ...: 
Out[1]: array([0.729448  , 0.67720456, 0.65528958, 0.71930902])