[R] R - need more memory, or rejection sampling algorithm doesn't work?

ekwaters ekwaters at unimelb.edu.au
Tue Mar 3 06:39:27 CET 2009

Hi all,

I am trying to run rejection sampling for the quantity z11 in the function
below.  Unfortunately I can't simplify the function further so that z11 only
appears once. 

Whenever I run the algorithm, R looks as if it is running it (no error
messages or anything), but then nothing happens for minutes...how long
should it take to run something like this in R? I have tried in in both
linux and windows.

I realise standard rejection sampling is pretty cumbersome, so I have also
tried to run a Gibbs sampler doing rejection sampling instead of the form of
the algorithm here, with the same result. R thinks about starting to run it,
then freezes.

Is this a memory issue, or an issue with the algorithm?

> count=0
> k=1
> f=matrix(NA,1000)





{f(k)=z11; k=k+1}

THe GIbbs sampler I tried looks as follows:

> p11=matrix(0.5,2000)

for(i in 2000)
{p11[i]=u; z=1}

View this message in context: http://www.nabble.com/R---need-more-memory%2C-or-rejection-sampling-algorithm-doesn%27t-work--tp22302800p22302800.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list