plot_beta_binomial: Plot a Beta-Binomial Bayesian Model
Description
Consider a Beta-Binomial Bayesian model for parameter \(\pi\) with
a Beta(alpha, beta) prior on \(\pi\) and Binomial likelihood with n trials
and y successes. Given information on the prior (alpha and data) and data (y and n),
this function produces a plot of any combination of the corresponding prior pdf,
scaled likelihood function, and posterior pdf. All three are included by default.
Usage
plot_beta_binomial(
alpha,
beta,
y = NULL,
n = NULL,
prior = TRUE,
likelihood = TRUE,
posterior = TRUE
)
Arguments
alpha, beta
positive shape parameters of the prior Beta model
y
observed number of successes
n
observed number of trials
prior
a logical value indicating whether the prior model should be plotted
likelihood
a logical value indicating whether the scaled likelihood should be plotted
posterior
a logical value indicating whether posterior model should be plotted