A simple explanation of rejection sampling in R
The central quantity in Bayesian inference, the posterior, can usually not be calculated analytically, but needs to be estimated by numerical integration, which is typically done with a Monte-Carlo algorithm. The three main algorithm classes for doing so are Rejection sampling Markov-Chain Monte Carlo (MCMC) sampling Sequential Monte Carlo (SMC) sampling I have previously given…