readMCMC | R Documentation |
Read raw MCMC samples, return cooked (burnt & sliced) ones
readMCMC(
file = "Results_Cooking.txt",
burnFactor = 0,
slimFactor = 1,
sep = "",
reportFile = NULL,
panelPerCol = 10,
panelHeight = 3,
panelWidth = 23/panelPerCol
)
file |
Character, full path to MCMC file. |
burnFactor |
Numeric, burn factor. 0.1 means the first 10 are discarded. |
slimFactor |
Integer, slim factor. 10 means that only one iteration every 10 is kept. |
sep |
Character, separator used in MCMC file. |
reportFile |
Character, full path to pdf report file, not created if NULL |
panelPerCol |
Integer, max number of panels per column |
panelHeight |
Numeric, height of each panel |
panelWidth |
Numeric, width of each panel |
A data frame containing the cooked mcmc samples.
# Create Monte Carlo samples and write them to file
n=4000
sim=data.frame(p1=rnorm(n),p2=rlnorm(n),p3=runif(n))
workspace=tempdir()
write.table(sim,file=file.path(workspace,'MCMC.txt'),row.names=FALSE)
# Read file, burn the first half and keep every other row
M=readMCMC(file=file.path(workspace,'MCMC.txt'),burnFactor=0.5,slimFactor=2)
dim(M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.