simulates Bayesian updating of the binomial parameter π.
simulates Bayesian updating of the binomial parameter π.
Provides a simple demonstration of how the posterior distribution improves as increasing amounts of data become available. A Binomial variable with a known parametric probability is sampled, and as increasing numbers of samples become available the posterior distribution is re-evaluated and plotted.
B1propSim(p, N =100, prior = c("uniform","near_0.5","not_near_0.5","near_0","near_1"))
Arguments
p: the ``real'' binomial probability; if a number samller than 0 or one lager than 1 isentered the function will choose an arbitrary probability
N: the number of observations to accumulate
prior: one of: "uniform", "near_0.5", "not_near_0.5", "near_0", or "near_1".
Returns
none returned; the function is run for the plot it produces.
References
van Hulst, R. 2018. Evaluating Scientific Evidence. ms.