overture (version 0.4-0)

Peek: Load samples from a partial MCMC run

Description

Peek allows the samples from a file-backed MCMC to be loaded in another R session while the MCMC is still in progress. By using Peek, the chain's convergence can be monitored before the MCMC chain has finished running.

Usage

Peek(backing.path)

Arguments

backing.path

directory path of an in-progress MCMC

Value

list of big.matrix with samples from the partial MCMC run

See Also

InitMcmc, LoadMcmc, big.matrix

Examples

Run this code
# NOT RUN {
SampleSomething <- function() {
    Sys.sleep(0.1)
    rnorm(1)
}

backing.path <- tempfile()
dir.create(backing.path)
print(backing.path)

SlowMcmc <- InitMcmc(1000, backing.path=backing.path)
SlowMcmc({
    x <- SampleSomething()
})

### In another R process, while the MCMC is still running...
samples.so.far <- Peek(backing.path)
samples.so.far$x[,]
# }

Run the code above in your browser using DataLab