powered by
Define the simulation function to generate failure probability with Beta prior distributions as conjugate prior to binomial distributions (for binomial RDT).
pi_MCSim_beta(M, seed, a, b)
Simulation sample size
Random seed for random sample
Shape parameter 1 for beta distribution
Shape parameter 2 for beta distribution
Vector of failure probability sample values
pi_MCSim_dirichlet
Other Prior distribution generation functions: pi_MCSim_dirichlet()
pi_MCSim_dirichlet()
# NOT RUN { pi <- pi_MCSim_beta(M = 1000, seed = 10, a = 1, b = 1) # }
Run the code above in your browser using DataLab