setRestartSettings {AnaCoDa} | R Documentation

## Set Restart Settings

### Description

`setRestartSettings` sets the needed information (what the file is called, how often the file should be written) to write information to restart the MCMC algorithm from a given point.

### Usage

    setRestartSettings(mcmc, filename, samples, write.multiple = TRUE)

### Arguments

`mcmc` | MCMC object that will run the model fitting algorithm.
`filename` | Filename for the restart files to be written.
`samples` | Number of samples that should occur before a file is written.
`write.multiple` | Boolean that determines if multiple restart files are written. Default value is TRUE.

### Details

`setRestartSettings` writes a restart file every set amount of samples that occur. Also, if write.multiple is true, instead of overwriting the previous restart file, the sample number is prepended onto the file name and multiple rerstart files are generated for a run.

### Value

This function has no return value.

### Examples

    ## set restart settings for checkpointing

    samples <- 2500
    thinning <- 50
    adaptiveWidth <- 25

    ## estimate all parameter types
    mcmc <- initializeMCMCObject(samples = samples, thinning = thinning,
                                 adaptive.width=adaptiveWidth, est.expression=TRUE,
                                 est.csp=TRUE, est.hyper=TRUE, est.mix = TRUE)

    # prompts the mcmc to write a restart file every 100 samples during the run.
    setRestartSettings(mcmc = mcmc, filename = "test_restart", samples = 100)

    # prompts the mcmc to write a restart file every 100 samples during the run,
    # but will overwrite it each time.
    setRestartSettings(mcmc = mcmc, filename = "test_restart", samples = 100,
                       write.multiple = FALSE)

[Package AnaCoDa version 0.1.3.0 Index]