The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The bayesrules package has a set of functions that support exploring Bayesian models from three conjugate families: Beta-Binomial, Gamma-Poisson, and Normal-Normal. The functions either help with plotting (prior, likelihood, and/or posterior) or summarizing the descriptives (mean, mode, variance, and sd) of the prior and/or posterior.
We use the Beta-Binomial model to show the different set of functions and the arguments.
plot_beta(alpha = 3, beta = 13, mean = TRUE, mode = TRUE)
#> Warning in geom_segment(aes(x = mean, y = 0, xend = mean, yend = dbeta(mean, : All aesthetics have length 1, but the data has 2 rows.
#> ℹ Please consider using `annotate()` or provide this layer with data containing
#> a single row.
#> Warning in geom_segment(aes(x = mode, y = 0, xend = mode, yend = stats::dbeta(mode, : All aesthetics have length 1, but the data has 2 rows.
#> ℹ Please consider using `annotate()` or provide this layer with data containing
#> a single row.In addition, plot_binomial_likelihood() helps users
visualize the Binomial likelihood function and shows the maximum
likelihood estimate.
plot_binomial_likelihood(y = 3, n = 15, mle = TRUE)
#> Warning in geom_segment(aes(x = max, xend = max, y = 0, yend = dbinom(success, : All aesthetics have length 1, but the data has 2 rows.
#> ℹ Please consider using `annotate()` or provide this layer with data containing
#> a single row.The two other functions plot_beta_binomial() and
summarize_beta_binomial() require both the prior parameters
and the data for the likelihood.
plot_beta_binomial(alpha = 3, beta = 13, y = 5, n = 10,
prior = TRUE, #the default
likelihood = TRUE, #the default
posterior = TRUE #the default
)For Gamma-Poisson and Normal-Normal models, the set of functions are
similar but the arguments are different for each model. Arguments of the
Gamma-Poisson functions include the shape and
rate of the Gamma prior and sum_y and
n arguments related to observed data which represent the
sum of observed data values and number of observations respectively.
plot_gamma_poisson(
shape = 3,
rate = 4,
sum_y = 3,
n = 9,
prior = TRUE,
likelihood = TRUE,
posterior = TRUE
)For the Normal-Normal model functions, the prior Normal model has the
mean and sd argument. The observed data has
sigma, y_bar, and n which
indicate the standard deviation, mean, and sample size of the data
respectively.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.