prior_post_plot: Graphs prior and posterior probabilities

Description Usage Arguments Value Author(s) Examples

View source: R/prior_post_plot.R

Description

Graphs prior and posterior probabilities from a discrete Bayesian model

Usage

1
  prior_post_plot(d, Color = "orange")

Arguments

d

data frame where the first column are the model values, and columns named Prior and Posterior

Color

fill color for the bars

Value

Constructs a comparative plot of the prior and posterior distributions using separate panels.

Author(s)

Jim Albert

Examples

1
2
3
4
5
6
7
df <- data.frame(p=c(.1, .3, .5, .7, .9),
                 Prior=rep(1/5, 5))
y <- 5
n <- 10
df$Likelihood <- dbinom(y, prob=df$p, size=n)
df <- bayesian_crank(df)
prior_post_plot(df, "red")

bayesball/TeachBayes documentation built on Jan. 5, 2020, 1:47 a.m.