[R] slow loops in Monte Carlo Simulations

Witold Eryk Wolski wolski at molgen.mpg.de
Tue Sep 28 15:09:37 CEST 2004


Have you taken a look at the MCMCpack - package on cran:
"This package contains functions for posterior simulation for a number 
of statistical models. All simulation is done in compiled C++ written in 
the Scythe Statistical Library Version 1.0. All models return coda mcmc 
objects that can then be summarized using the coda package."


Nael Al Anaswah wrote:

>Hi there,
>I am running Monte Carlo Simulations in R using ordinary "while 
>(condition)" loops. Since the number of iterations is something like 
>100.000 and within each iteration a given subsample is extended 
>sequentially it takes hours to run the simulation. 
>Does anyone know if there is either a way to avoid using loops in 
>Monte Carlo Simulations or how to include possible faster "c++" 
>commands in R code?
>many thanks in advance.
>Nael Al-Anaswah
>Nael Al-Anaswah
>Department of Econometrics
>University of Muenster
>R-help at stat.math.ethz.ch mailing list
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Dipl. bio-chem. Witold Eryk Wolski         
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin           _
tel: 0049-30-83875219                   'v'
http://www.molgen.mpg.de/~wolski       /   \
mail: witek96 at users.sourceforge.net  ---W-W----
      wolski at molgen.mpg.de

More information about the R-help mailing list