We propose approaches for testing implementations of Markov Chain Monte Carlo methods as well as of general Monte Carlo methods. Based on statistical hypothesis tests, these approaches can be used in a unit testing framework to, for example, check if individual steps in a Gibbs sampler or a reversible jump MCMC have the desired invariant distribution. Two exact tests for assessing whether a given Markov chain has a specified invariant distribution are discussed. These and other tests of Monte Carlo methods can be embedded into a sequential method that allows low expected effort if the simulation shows the desired behavior and high power if it does not. Moreover, the false rejection probability can be kept arbitrarily low. For general Monte Carlo methods, this allows testing, for example, if a sampler has a specified distribution or if a sampler produces samples with the desired mean. The methods have been implemented in the R-package MCUnit.
翻译:根据统计假设测试,这些方法可以在单位测试框架中使用,例如,检查Gibbs取样器或可逆跳跃MCMC的单个步骤是否具有理想的不定分布。我们讨论了两个精确的测试,用以评估某一Markov链是否具有特定的不定分布。这些以及蒙特卡洛方法的其他测试可以嵌入一个连续方法,如果模拟显示所需的行为和高功率(如果不是的话),可以允许低预期努力。此外,虚假拒绝概率可以任意保持低。对于Monte Carlo通用方法,这允许测试,例如,如果取样器有特定分布,或者取样器生产样品时使用理想平均值。这些方法已在R包装的MCUM中实施。