The tests provided by MCMCTesting
are frequentist hypothesis tests for testing the correctness of MCMC kernels.
In particular, it compute the p-value for the null hypothesis that the MCMC kernel has the correct stationary distribution against the alternative hypothesis that it doesn't.
Currently, MCMCTesting
provide three different tests originally proposed by Gandy and Scott1:
- [Simple Two-Sample Test](@ref twosample)
- [Two-Sample Test with an Additional Gibbs Step](@ref twosamplegibbs)
- [Exact Rank Test](@ref exactrank)
The two-sample tests are generally applicable. On the other hand, the exact rank test assumes that the MCMC kernel is reversible. Therefore, it can specifically be used to test reversibility.
The user needs to implement the following function specializations for the model
and kernel
subject to the test.
sample_joint
markovchain_transition
Some tests might be require additional interfaces to be implemented. For an overview of how to implement these interfaces, refer to the [tutorial](@ref tutorial).
The model
and kernel
are then passed to MCMCTesting
through the following struct:
TestSubject
Each of the test internally run simulations and compute a single p-value through the following routine:
mcmctest
seqmcmctest
(Algorithm 31) sequentially calls mcmctest
to increase the power and ensure a low false rejection rate.
Furthermore, the p-values from each component of the statistics are combined through multiple hypothesis adjustment.
seqmcmctest