I have been trying to learn the Bayesian simulation based methods of posterior approximation. Although the theories are now quite clear but I am seeking for some examples with R codes so that I can practice and implement to my own work.
I am particularly looking for the examples with R codes of the non-iterative and iterative Monte Carlo methods. Mainly-
- Importance sampling
- Rejection sampling
- Metropolis algorithm
- Metropolis-Hastings algorithm
- Gibbs sampler
So, is it possible to find examples with R codes of these methods of simulation somewhere collectively? I mean it is a kind of heuristic learning, so basically I need some tutorial or some blog or website where the examples are properly described with corresponding R codes.
Edit: I am sorry I forgot to mention, I was actually looking for creating functions in R for these sampling methods to know the basic of these algorithms. Not looking for any packaged software.