Closed danielturek closed 3 months ago
The title says it all.
Minimal reproducible example below:
library(nimble) code <- nimbleCode({ for(i in 1:3) { x[i] ~ dnorm(0, 1) } }) Rmodel <- nimbleModel(code, inits = list(x=1:3)) Rmcmc <- buildMCMC(Rmodel) compiledList <- compileNimble(list(model=Rmodel, mcmc=Rmcmc)) Cmcmc <- compiledList$mcmc set.seed(0) Rmcmc$run(1) as.list(Rmcmc$mvSamples) ## $x ## [,1] [,2] [,3] ## [1,] 1.262954 -0.3262334 1.329799 set.seed(0) Cmcmc$run(1) as.list(Cmcmc$mvSamples) ## INCORRECT ## $x ## [,1] ## [1,] 1.262954
Trivial issue with as.list.CmodelValues getting the wrong length because the one-element modelValues is ending up as a vector rather than a one-element list. Fixing directly on devel.
as.list.CmodelValues
The title says it all.
Minimal reproducible example below: