Package for fast monte carlo simulation

I am currently using Microsoft R Open, which makes my matrix operations very fast. I still need a R package for fast monte carlo simulation. In general, I need a fast random number generator (actually I am not sure if using Microsoft R Open makes R base random number generator more performant); I also need a fast way of writing for loops. I use foreach package for fast for loops, but haven't test if it is good for monte carlo simulation.

PS: I am not considering writing my code in Rcpp.

In Efficient R programming, the authors recommend using the parallel package for fast Monte Carlo:
https://csgillespie.github.io/efficientR/efficient-performance.html#top-5-tips-for-efficient-performance

Thanks for your reply. What is the relation between parallel and foreach?

Also, is there any fast random number generator?

I'm not sure. Just giving you the pieces of info I know.

Looks like there are some answers on SO and elsewhere re random number generators, but fast is always relative so ¯(°_o)/¯:

https://rdrr.io/cran/dqrng/man/dqrng-functions.html

1 Like

Thanks. I have installed them both.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.