LoadMcmc: Load samples from a file-backed MCMC run

Description Usage Arguments Value See Also Examples

View source: R/mcmc.R

Description

LoadMcmc loads the samples from a file-backed MCMC run initiated by InitMcmc. The result is a list of big.matrix with all of the parameters that were saved in the MCMC run. Alternatively, the samples for individual parameters can be loaded by using attach.big.matrix to load the corresponding descriptor file, "ParameterName.desc," in the MCMC's backing.path directory.

Usage

1
LoadMcmc(backing.path)

Arguments

backing.path

directory path where MCMC samples were saved

Value

list of big.matrix with the MCMC samples

See Also

ToMemory, Peek, attach.big.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Run a file-backed MCMC
backing.path <- tempfile()
dir.create(backing.path)
Mcmc <- InitMcmc(1000, backing.path=backing.path)
samples <- Mcmc({
    x <- rnorm(1)
})
rm(samples)

# Load the saved samples
loaded.samples <- LoadMcmc(backing.path)
hist(loaded.samples$x[,], main="Samples", xlab="x")

overture documentation built on Aug. 11, 2019, 1:04 a.m.