Solutions to the Exercises: Chapter 1
I usually set my students open-ended questions but I like to break down the tasks in order to help them structure their answers. Anyway, whatever the merits of this type of questioning, that approach has certainly influenced the exercises that I have given at the end of each chapter of ‘Bayesian analysis with Stata’ and because many of those exercises are open-ended, I […]
Mixture Models: How many components?
In a recent posting I described a Stata program for Bayesian fitting of finite mixtures of multivariate normal distributions and I used it to smooth a histogram of fish lengths. The question that I would like to address now is, how do we control the amount of smoothing? If we employ very heavy smoothing then […]
Label Switching
In my last posting (‘Mixtures of Normal Distributions’) I modelled a multi-modal distribution of fish lengths using a mixture of six normal distributions and noticed some label switching in the trace plots of the means of the components. Here is a repeat of the trace plot for the component means from a run of length 5,000. […]
Mixtures of Normal Distributions
In my last posting I started a library of Mata functions for use in Bayesian and this week I will add a function that fits mixtures of normal distribution using a Bayesian Gibbs sampling algorithm. The normal distribution is the underlying assumption for many statistical models and data are often transformed to make their distribution look normal so that […]
Creating a Mata Library
MCMC algorithms can be slow, so it is often necessary to pay particular attention to the efficiency of one’s code and usually this means programming in Mata. For this reason, the slice, griddy, ARS and ARMS samplers that are described in ‘Bayesian Analysis with Stata’ were programmed using Mata even though they can be called from either Mata […]
Recent Comments