nimble icon indicating copy to clipboard operation
nimble copied to clipboard

bug with `adaptInterval=1` for `RW_block`

Open paciorek opened this issue 4 months ago • 1 comments

It runs (which I was thinking it might not because of 1-d vs 2-d allocation for the samples saved for calculating the covariance), but in a simple example, there are no acceptances. @danielturek or I should look into for 1.3.0 release.

code <- nimbleCode({
    y[1:2] ~ dmnorm(z[1:2],pr[1:2,1:2])
})
m <- nimbleModel(code, inits = list(z=rep(0,2), pr=diag(2)))
m$y = rnorm(2)

conf  <- configureMCMC(m, nodes=NULL)
conf$addSampler(target='y', type='RW_block', control = list(adaptInterval=1))
mcmc <- buildMCMC(conf)
cm <- compileNimble(m)
cmcmc <- compileNimble(mcmc,project=m)
cmcmc$run(1000)
tmp=as.matrix(cmcmc$mvSamples)

paciorek avatar Oct 10 '24 19:10 paciorek