Bayesian Analysis with Stata
Subscribe
Posted by John in Bayesian Analysis with Stata on May 22, 2014
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 […]
Posted in Uncategorized | Tagged mixture model; Bayesian analysis; smoothing
Posted by John in Bayesian Analysis with Stata on May 18, 2014
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. […]
Posted in Uncategorized | Tagged mixture models; Bayesian analysis; label switching |
Posted by John in Bayesian Analysis with Stata on May 9, 2014
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 […]
Posted in Uncategorized | Tagged Bayesian mixture model, Mata |
Posted by John in Bayesian Analysis with Stata on May 2, 2014
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 […]
Posted in Uncategorized | Tagged Mata; random numbers; library
Posted by John in Bayesian Analysis with Stata on April 11, 2014
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 […]
Posted in Uncategorized | Tagged prior, stata, winbugs, Wishart |
Posted by John in Bayesian Analysis with Stata on April 4, 2014
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 […]
Posted in Uncategorized | Tagged Gibbs sampling, stata
Posted by John in Bayesian Analysis with Stata on March 28, 2014
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 […]
Posted in Uncategorized | Tagged biostatistics, Gibbs sampling, maximum likelihood, stata, teaching
Posted by John in Bayesian Analysis with Stata on March 24, 2014
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 […]
Posted in Uncategorized | Tagged Mac, stata, winbugs |
Posted by John in Bayesian Analysis with Stata on March 21, 2014
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 […]
Posted in Uncategorized | Tagged stata, winbugs
Posted by John in Bayesian Analysis with Stata on March 14, 2014
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 […]
Posted in Uncategorized | Tagged bayesian, priors, winbugs
Recent Comments