On Jul 11, 2024, at 19:58, Cyril Milleret <cyril.m...@gmail.com> wrote:
Hi Dusit,
It is possible to save the state of the model following this vignette:
https://danielturek.github.io/public/saveMCMCstate/saveMCMCstate.html.This means that you could run the model with a small number of iterations, save the state of the model, and then continue or restart (in case of power outage) the model to run more iterations, and so on… Saving the state of the model allows you to restart it in case anytime after it stopped running.
For example:
Run a few (XXXX) iterations:
Cmcmc$run(XXXX)
Then save the state of the model and the posteriors (functions available in the vignette):
stateList <- list(modelState = getModelState(Cmodel),
mcmcState = getMCMCstate(conf, Cmcmc))
#save model state
saveRDS(stateList, file = fileName)
#save posteriors:
samples <- Cmcmc$mvSamples
save(samples, file = « samples.RData”)
And then re-run more iterations:
Cmcmc$run(XXXX)
Then if you need to restart the model, you can do it using the model state that you saved. See instructions in the vignette.
Hope this helps,
Best,
Cyril
--
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/d2f1239c-9f4c-4ed6-9a88-aa304cf43843n%40googlegroups.com.
Hi everyone,
--