Function to generate a Markov chain for both continuous and discontinuous posterior distributions.
Useful links