Learn R Programming

evidence (version 0.8.10)

B1propSim: simulates Bayesian updating of the binomial parameter \(\pi\).

Description

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.

Usage

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".

Value

none returned; the function is run for the plot it produces.

References

van Hulst, R. 2018. Evaluating Scientific Evidence. ms.

Examples

Run this code
# NOT RUN {
B1propSim(p = 0.44, prior = "near_0.5")
# }

Run the code above in your browser using DataLab