Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I am trying to estimate parameters of a two dimensional Normal distribution using Gibbs sampling. While it was very easy transform the posterior equation for mean vector to a single dimension normal function for sampling, I am not able to same for sigma(covariance).

Do I need to use the Wishart distribution as prior and then convert the posterior into a single dimensional gamma function ?

share|improve this question

1 Answer

The Wishart distribution is the conjugate prior for the likelihood that comes from assuming a normally distributed error term for the linear regression model. You have to assume that either the covariance matrix is an inverted-wishart or the precision matrix (i.e., the inverse of the covariance matrix) is a wishart distribution.

As far as sampling is concerned it is possible to sample directly from the wishart and even from the multivariate normal. Thus, I do not think it is needed to sample from univariate normals or univariate gammas. Look around in the software you are using to see if it has samplers for the multivariate normal and the wishart.

share|improve this answer
I derived the posterior expression as the product of Normal likelihood function and Wishart prior. I sampled precision matrix from this posterior expression, but not getting the correct output. I am generating the samples from wishrnd command in matlab, by using the degree of freedom and the scale matrix of the posterior. – Saurabh Saxena Nov 27 '10 at 19:13
It would be useful if you could update your question with the model setup, the assumptions about priors and the corresponding posteriors. – user28 Nov 27 '10 at 22:34
There was a bug in my code, its working now. – Saurabh Saxena Nov 28 '10 at 19:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.