View source: R/unit_information_prior.R
| unit_information_prior | R Documentation |
Constructs a unit-information (weak) prior from an informative normMix
by inflating each component's standard deviation by \sqrt{n_h}.
unit_information_prior(informative_prior, n_hist)
informative_prior |
A |
n_hist |
Positive integer: historical sample size |
A normMix with inflated standard deviations.
# Start with an informative prior from historical samples via RBesT::mixfit
set.seed(1000)
fake_hist_draws <- rnorm(300, mean = -3.2, sd = 0.4)
inf_prior <- RBesT::mixfit(fake_hist_draws, type = "norm", Nc = 3)
nf_prior <- unit_information_prior(inf_prior, n_hist = 300)
# Compare SDs before/after
rbind(
informative_sd = as.numeric(inf_prior[3, ]),
unit_info_sd = as.numeric(nf_prior[3, ])
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.