R/recompile.R

Defines functions recompile.rjags.parallel recompile.rjags recompile

Documented in recompile recompile.rjags

recompile <- function(object, n.iter, refresh, progress.bar) UseMethod("recompile")


recompile.rjags <- function(object, n.iter = 100, refresh = n.iter/50, progress.bar = "text")
{
  object$model$recompile()
  adapt(object$model, n.iter = n.iter, by = refresh, progress.bar = progress.bar, end.adaptation=TRUE) 

}
  
recompile.rjags.parallel <- function(object, n.iter = 100, refresh = n.iter/50, progress.bar = "text")
{
  nchains <- length(object$model)
  for(i in 1:nchains){
    object$model[[i]]$recompile()
    adapt(object$model[[i]], n.iter = n.iter, by = refresh, progress.bar = progress.bar, end.adaptation=TRUE) 
  }
}

Try the R2jags package in your browser

Any scripts or data that you put into this service are public.

R2jags documentation built on Oct. 13, 2024, 9:07 a.m.