Description Usage Arguments Author(s) Examples
View source: R/plot_mcmc_bite.R
This function plots the trace and/or density of each mcmc sample.
1 2 3 |
mcmc.log |
Any mcmc sample with the saved iterations in rows and the variables in columns |
type |
Character taken in c("trace", "density"). If both are specified, they are plotted side by side in the same graphical device |
burnin |
The size of the burnin in number of iterations or the proportion of iteration you want to remove |
variable |
The name or number of the variable to plot. If is.na(variable), all columns of mcmc.log will be plotted except "iter" and "temperature" |
label |
Full variable name to be plotted |
col, bty, ... |
Other graphical parameters to parse to |
cex.est |
The magnification to be used for estimates display |
kp.burn |
Logical specifying whether the plot window should adjust to the pre-burnin values (only evaluated if "trace" in type) |
Theo Gaboriau
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Load test data
data(Anolis_traits)
data(Anolis_tree)
data(Anolis_map)
## Run a simple MCMC chain
my.jive <- make_jive(Anolis_tree, Anolis_traits[-3], model.priors = list(mean="BM", logvar="OU"))
bite_ex <- tempdir()
logfile <- sprintf("%s/my.jive_mcmc.log", bite_ex)
mcmc_bite(my.jive, log.file=logfile, sampling.freq=10, print.freq=10, ngen=1000)
## import the results in R
res <- read.csv(logfile, header = TRUE, sep = "\t")
## plot the results
plot_mcmc_bite(res, burnin = 0.2, variable = NA, cex.est = .7)
plot_mcmc_bite(res, burnin = 0.2, variable = "prior.mean", cex.est = .7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.