View source: R/plot.PriorsmcmcComposite.R
plot.PriorsmcmcComposite | R Documentation |
Create a ggplot graph with prior.
The function makes minimal effort to decorate the plot.
## S3 method for class 'PriorsmcmcComposite'
plot(x, parameter = 1, ...)
x |
The priors to show |
parameter |
The name or rank of prior to show |
... |
Not used |
plot.PriorsmcmcComposite plot a prior
A ggplot object
Marc Girondot marc.girondot@gmail.com
Other mcmcComposite functions:
MHalgoGen()
,
as.mcmc.mcmcComposite()
,
as.parameters()
,
as.quantiles()
,
merge.mcmcComposite()
,
plot.mcmcComposite()
,
setPriors()
,
summary.mcmcComposite()
## Not run:
library("HelpersMG")
par <- c(a0=10, a1=2, b2=20, b1=-1)
rules <- rbind(data.frame(Name="^a", Min=0, Max="x*2"),
data.frame(Name="^b", Min=0, Max=100))
p <- setPriors(par=par, se=NULL, density="dgamma", rules=rules)
plot(p, parameter="a0")
q <- plot(p, parameter="b1")
q + geom_line(color = "red") + theme_bw() +
theme(plot.margin=unit(c(2,1,1,1), 'cm'),
panel.border = element_blank(),
axis.line.x.bottom = element_line(colour = "black"),
axis.line.y.left = element_line(colour = "black")) +
labs(title="Parameter: b1") + theme(plot.title = element_text(hjust = 0.5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.