Slice sampling Matlab demo

So far we’ve had a look at rejection sampling and importance sampling. Here we take a quick look at slice sampling, although rather than implementing it ourselves, we will use the built in Matlab slicesample function. Using our parameter estimation example, we will use slice sampling to estimate the mean and sigma of some samples from …

Importance sampling Matlab demo

Importance sampling is related to rejection sampling, which I looked at in the last post. Here is a short demo. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters …

Rejection sampling Matlab demo

I’ve been using MCMC, but I’ve wanted to flesh out my knowledge and explore the space of sampling approaches a little more. One very simple, yet inefficient method, is rejection sampling. Here is a little Matlab example I put together after seeing how easy it was. This file contains bidirectional Unicode text that may be interpreted …