Re: [R] MCMC gradually slows down

2009-11-08 Thread Jens Malmros
t;- numeric(n) > > and then see how fast it works. > > On Sun, Nov 8, 2009 at 2:11 PM, Jens Malmros wrote: >> Hello, >> >> I have written a simple Metropolis-Hastings MCMC algorithm for a >> binomial parameter: >> >> MHastings = function(n,p0,d){ &g

[R] MCMC gradually slows down

2009-11-08 Thread Jens Malmros
Hello, I have written a simple Metropolis-Hastings MCMC algorithm for a binomial parameter: MHastings = function(n,p0,d){ theta = c() theta[1] = p0 t =1 while(t<=n){ phi = log(theta[t]/(1-theta[t])) phisim = phi + rnorm(1,0,d)