Learn R Programming

ggdmc (version 0.1.3.9)

plot_priors: Plot Prior Probability Density

Description

Plot each the prior density distribution for each EAM parameter and then plot them all together in a canvas.

Usage

plot_priors(p.prior, save.dat = FALSE, ...)

Arguments

p.prior
a prior parameter list, created usually by prior.p.dmc
save.dat
a boolean switch for save data frame, if the user wants to modifiy the plotting parameter
...
other arguments

Examples

Run this code
pop.prior <- prior.p.dmc(
             dists = rep("tnorm", 7),
             p1=c(a=2,  v.f1=4, v.f2=3, z=0.5,sv=1, sz=0.3, t0=0.3),
             p2=c(a=0.5,v.f1=.5,v.f2=.5,z=0.1,sv=.3,sz=0.1,t0=0.05),
             lower=c(0,-5, -5, 0, 0, 0, 0),
             upper=c(5, 7,  7, 1, 2, 1, 1))

view(pop.prior)
plot_priors(pop.prior)
d <- plot_priors(pop.prior, save.dat=TRUE)

require(ggplot2)
p2 <- ggplot(d, aes(x = xpos, y = ypos)) + geom_line() +
      facet_wrap(~gpvar, scales="free") + theme_bw(base_size =14)

Run the code above in your browser using DataLab