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 […]
Setting a Wishart prior
When I started this blog I decided to try and post once a week for the first few months and so I has to plan ahead. I found that there were many topics that I wanted to cover that involved multivariate normal models for which the conjugate prior on the precision matrix is a Wishart distribution. Now I have […]
Correlation between Viral Loads: Part 2
In my previous posting, I discussed a coursework that I set my students on the use of Stata’s –ml– command and I suggested that a Bayesian analysis of the same problem using Stata would raises a few interesting issues. Now I would like to start to address those points. To recap briefly, the idea of […]
Correlation between Viral Loads: Part 1
In Leicester we run a masters course in Medical Statistics and each year our students get a two-day course on fitting models by maximum likelihood using Stata’s -ml- command. For the last few years I have taught this course and so I have been on the lookout for examples based on real data that I can use as exercises […]
Running WinBUGS from Stata on a Mac
My only experience of running WinBUGS from within Stata is under Windows and Linux, but Tom Palmer, who was one of the authors of the original Stata Journal article on this topic http://www.stata-journal.com/sjpdf.html?articlenum=st0115, recently sent me instructions on how it can be done on a Mac. If you think that those instructions might be helpful […]
Keeping good records
No properly managed statistical analysis would use results that were calculated interactively because of the difficulty of reproducing them when you do not have a written record of exactly what was done. For this reason, Stata users usually store their commands in do files. When running WinBUGS from within Stata we need to create four […]
Why I don’t use WinBUGS priors
In the WinBUGS help system there are a number of worked examples that have been very influential in shaping the way that people perform Bayesian analysis. Those examples use very vague priors, such as a normal distribution with a mean of zero and standard deviation of a thousand. Many people have learned to use Bayesian […]
Recent Comments