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 822.4µs 876.4µs
MC3 8.72ms 9.8ms
Hamiltonian Monte-Carlo 6.67ms 7.55ms
REC 7.11ms 7.96ms
MCHMC 55.63ms 59.52ms
MCREC 53.19ms 62.34ms

MATLAB

tests timeit
Metropolis-Hastings 6.22ms
MC3 55.13ms