Consider a Normal-Normal Bayesian model for mean parameter \(\mu\) with a N(mean, sd^2) prior on \(\mu\) and a Normal likelihood for the data. Given information on the prior (mean and sd) and data (the sample size n, mean y_bar, and standard deviation sigma), this function summarizes the mean, mode, and variance of the prior and posterior Normal models of \(\mu\).

summarize_normal_normal(mean, sd, sigma = NULL, y_bar = NULL, n = NULL)

Arguments

mean

mean of the Normal prior

sd

standard deviation of the Normal prior

sigma

standard deviation of the data, or likelihood standard deviation

y_bar

sample mean of the data

n

sample size of the data

Value

data frame

Examples

summarize_normal_normal(mean = 2.3, sd = 0.3, sigma = 5.1, y_bar = 128.5, n = 20)
#>       model     mean     mode        var        sd
#> 1     prior  2.30000  2.30000 0.09000000 0.3000000
#> 2 posterior 10.46828 10.46828 0.08417476 0.2901289