Description Usage Arguments Author(s) See Also Examples
Adds points to a caterplot.
1 | caterpoints(x, parnames, horizontal = TRUE, ...)
|
x |
vector of points to add to a |
parnames |
an optional vector of parameter names. If specified, |
horizontal |
logical value that should match the argument of the same name in the original call to |
... |
further arguments passed to the function |
S. McKay Curtis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Create fake MCMC output
nc <- 10; nr <- 1000
pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep=""))
means <- rpois(10, 20)
fakemcmc <- coda::as.mcmc.list(
lapply(1:3,
function(i) coda::mcmc(matrix(rnorm(nc*nr, rep(means, each=nr)),
nrow=nr, dimnames=list(NULL,pnames)))))
posterior.medians <- apply(do.call("rbind", fakemcmc), 2, median)
## caterplot plots of the fake MCMC output
par(mfrow=c(2,2))
caterplot(fakemcmc, "alpha", collapse=FALSE)
caterpoints(runif(5, 10, 20), pch="x", col="red")
caterplot(fakemcmc, "alpha", horizontal=FALSE)
caterpoints(runif(5, 10, 20), horizontal=FALSE, pch="x", col="red")
parms <- caterplot(fakemcmc, random=3) # keep the names of plotted parameters
caterpoints(posterior.medians[parms], pch="x", col="red")
|
Loading required package: coda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.