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
On Tue, 28 Sep 2004 13:46:04 +0200, Nael Al Anaswah
[EMAIL PROTECTED] 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
Hi!
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
The key is to assign space in advance -- e.g., compare:
N - 2
res - NULL
system.time( for(i in 1:N) res - c(res, sample(10)) )
[1] 28.62 8.91 37.79 0.00 0.00
res - vector(list,N)
system.time( for(i in 1:N) res[[i]] - sample(10) )
[1] 0.45 0.00 0.44 0.00 0.00
res - matrix(0.0, N,10)