Time Comparisons

All samplers run for 1024 iterations.

C++

X <- bench::mark(
    "Metropolis-Hastings" = {samplr::sampler_mh(1, "norm", c(0,1), sigma_prop=1)},
    "MC3" = {samplr::sampler_mc3(1, "norm", c(0,1), sigma_prop=1)},
    "Hamiltonian Monte-Carlo" = {samplr::sampler_hmc(1, "norm", c(0,1))},
    "REC" = {samplr::sampler_rec(1, "norm", c(0,1))},
    "MCHMC" = {samplr::sampler_mchmc(1, "norm", c(0,1), )},
    "MCREC" = {samplr::sampler_mcrec(1, "norm", c(0,1))},
    check = FALSE, iterations = 50
)
#> Warning: Some expressions had a GC in every iteration; so filtering is
#> disabled.
knitr::kable(as.data.frame(X[,c("expression", "min", "median")]))
expression min median
Metropolis-Hastings 1.42ms 1.45ms
MC3 13.6ms 14.26ms
Hamiltonian Monte-Carlo 10.33ms 10.77ms
REC 10.7ms 11.21ms
MCHMC 72.49ms 75.5ms
MCREC 75.22ms 78.16ms

MATLAB

tests timeit
Metropolis-Hastings 6.22ms
MC3 55.13ms