R/model.update.R

"modelUpdate" <-
function(numUpdates, thin = 1, overRelax = FALSE)
#   Update the each chain in OpenBUGS model numUpdates * thin time
{
    if(!is.numeric(numUpdates))
        stop("numUpdates ", "must be numeric")
    numUpdates <- as.integer(numUpdates)
    if(!is.numeric(thin))
        stop("thin ", "must be numeric")
    thin <- as.integer(thin)
    if(!is.logical(overRelax))
        stop("overRelax ", "must be logical") 
    command <- paste("BugsEmbed.UpdateGuard",
        ";BugsEmbed.thin := ", thin,
        ";BugsEmbed.overRelax := ", as.integer(overRelax),
        ";BugsEmbed.updates := ", numUpdates,
        ";BugsEmbed.Update")
    .CmdInterpreter(command)
    if(getOption("BRugsVerbose")) 
        buffer()
}

Try the BRugs package in your browser

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

BRugs documentation built on May 31, 2023, 7:19 p.m.