benchmarks: Benchmark R and Rcpp functions.

Description Examples

Description

Use R package microbenchmark to compare the performance of C functions (rwMetropolisR) and Cpp functions (rwMetropolisC).

Examples

1
2
3
4
5
## Not run: 
ts <- microbenchmark(rwC1 = rwMetropolisC(sigma[1], x0, N), rwC2 = rwMetropolisC(sigma[2], x0, N), rwC3 = rwMetropolisC(sigma[3], x0, N), rwC4 = rwMetropolisC(sigma[4], x0, N), rw1 = rwMetropolisR(sigma[1], x0, N), rw2 = rwMetropolisR(sigma[2], x0, N), rw3 = rwMetropolisR(sigma[3], x0, N), rw4 = rwMetropolisR(sigma[4], x0, N))
knitr::kable(summary(ts)[, c(1,3,5,6)])

## End(Not run)

zheng017/SC19062 documentation built on Jan. 2, 2020, 12:53 a.m.