B1propSim function

simulates Bayesian updating of the binomial parameter π\pi.

simulates Bayesian updating of the binomial parameter π\pi.

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.

Author(s)

Robert van Hulst

Examples

B1propSim(p = 0.44, prior = "near_0.5")
  • Maintainer: Robert van Hulst
  • License: GPL (>= 2)
  • Last published: 2018-05-15

Useful links