Skip to contents

Betancourt's estimator of how well the momentum resampling of an HMC or NUTS sampler explores the energy distribution, \(\sum_{n \ge 1} (E_n - E_{n-1})^2 / \sum_n (E_n - \bar E)^2\); values below 0.3 flag poor exploration. Identical to the Python arm morie.fn.bfmi.bayesian_fmi.

Usage

bayesian_fmi(energy)

Arguments

energy

Numeric vector of Hamiltonian energies, one per iteration (at least three).

Value

A list with bfmi, adequate (bfmi >= 0.3), energy_var (divisor n - 1) and transition_var (mean squared transition, divisor n - 1).

References

Betancourt, M. (2016). Diagnosing suboptimal cotangent disintegrations in Hamiltonian Monte Carlo. arXiv:1604.00695.

Examples

bayesian_fmi(c(1, 3, 2, 5, 4))$bfmi
#> [1] 1.5