Hello all. I have a question about resetting monitors after an object has been compiled. I believe I am following the instructions correctly, but in so doing, I keep crashing R.
Here is the code that worked to create and run the initial model:
Rmodel <- nimbleModel(code=code, constants=consts, data=data, dimensions = dimensions,calculate=T, check=T, inits=I1)
conf <- configureMCMC(Rmodel, monitors=parms, control = list(adaptInterval = MCMCcontrol$nadapt), thin = MCMCcontrol$nthin, useConjugacy = TRUE)
Rmcmc <- buildMCMC(conf)
Cmodel<-compileNimble(Rmodel)
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)
out <- runMCMC(Cmcmc, niter = MCMCcontrol$niter, nburnin = MCMCcontrol$nburn, thin=MCMCcontrol$nthin, nchains=MCMCcontrol$nchains,setSeed = seq(1:nchains), inits = I1, progressBar = TRUE, samplesAsCodaMCMC = TRUE)
To reset the monitors, I first redefined “parms”, the vector of variable names to monitor. The second step (shown below) appeared to work correctly:
conf$setMonitors(parms).
The next step reliably crashes R:
Rmcmc <- buildMCMC(conf).
What am I missing?
Thank you!
Rebecca
I think the problem has to do with the fact that I am trying to run nimble after reopening a saved R workspace. All of the objects I expect to be there are indeed present in the workspace. But I get the following errors if I don’t change anything and just try to rerun the model.
When I try Cmcmc$run(niter), I get the following error:
Error in .Call("CALL_MCMC_run", niter, reset, resetMV, time, progressBar, : C symbol name "CALL_MCMC_run" not in load table
When I try this,
out <- runMCMC(Cmcmc, niter = MCMCcontrol$niter, nburnin = MCMCcontrol$nburn, thin=MCMCcontrol$nthin, nchains=MCMCcontrol$nchains, setSeed = seq(1:nchains), inits = I1, progressBar = TRUE, samplesAsCodaMCMC = TRUE)
I get this error:
Error in .Call(NULL, <pointer: (nil)>, 1L) : first argument must be a string (of length 1) or native symbol reference
Is there a way to rerun a nimble model from a saved workspace without going through the configureMCMC step again? (That is the time consuming part for my model.)
Thank you!
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/BY5PR09MB51541919FD6848753C374560D4B59%40BY5PR09MB5154.namprd09.prod.outlook.com.
|
This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding. |
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/3eabe843-2c4b-483a-9df7-684c092ffb71n%40googlegroups.com.