Description Usage Arguments Value Examples
Consider a Beta-Binomial Bayesian model for parameter π with a Beta(alpha, beta) prior on π 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.
1 2 3 4 5 6 7 8 9 |
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 |
a ggplot
1 2 | plot_beta_binomial(alpha = 1, beta = 13, y = 25, n = 50)
plot_beta_binomial(alpha = 1, beta = 13, y = 25, n = 50, posterior = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.