plot_prior: Plot prior distributions

Description Usage Arguments Examples

View source: R/plotting.R

Description

plot_prior plots one member in a prior object. plot.prior plots all members in a prior object.

Usage

1
2
3
4
5
plot_prior(i, prior, xlim = NA, natural = TRUE, npoint = 100,
  trans = NA, save = FALSE, ...)

## S3 method for class 'prior'
plot(x, save = FALSE, ps = NULL, ...)

Arguments

i

an integer or a character string indicating which parameter to plot

prior

a prior object

xlim

set the range of on x axis. This is usually the range for each parameter.

natural

default TRUE.

npoint

default to plot 100

trans

default NA. trans can be a scalar or vector.

save

whether to save the data out

...

other plotting arguments passing through dot dot dot.

x

a prior object

ps

true parameter vectors or matrix in the case of many observation units

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
p.prior <- BuildPrior(
           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))

plot_prior("a", p.prior)
plot_prior(2, p.prior)
plot(p.prior)

ggdmc documentation built on May 2, 2019, 9:59 a.m.