Markov Chain Monte Carlo - Nice R Code

#artificialintelligence 

This topic doesn't have much to do with nicer code, but there is probably some overlap in interest. However, some of the topics that we cover arise naturally here, so read on! MCMC is simply an algorithm for sampling from a distribution. The term stands for "Markov Chain Monte Carlo", because it is a type of "Monte Carlo" (i.e., a random) method that uses "Markov chains" (we'll discuss these later). MCMC is just one type of Monte Carlo method, although it is possible to view many other commonly used methods as simply special cases of MCMC.