Hi, Normal-Wishart is usually used as the conjugate prior for parameters: (mu, Sigma), of a multivariate Normal distribution. Now I need to draw samples from a Normal-Wishart distribution.

I know how to draw samples from a multivariate Normal or Wishart distribution. But I do not know how to draw mu and Sigma simultaneously from a Normal-Wishart distribution. Anyone can help?

asked Jun 30 '11 at 02:09

Tao%20Zhuang's gravatar image

Tao Zhuang
16227


2 Answers:

First draw the wishart, then the normal. See for the normal-gamma distribution on wikipedia:

Generation of random variates is straightforward:

Sample τ from a gamma distribution with parameters α and β Sample x from a normal distribution with mean μ and variance 1 / (λτ)

Just replace the hyperparameters and you're set.

answered Jun 30 '11 at 03:37

Alexandre%20Passos's gravatar image

Alexandre Passos ♦
2554154278421

First draw Sigma according to its marginal posterior distribution. Then draw mu according to its posterior distribution conditioned on Sigma. Just as you said, problem solved. Thanks.

(Jun 30 '11 at 06:49) Tao Zhuang

In the Machine Learning Summer School 2007, Yee Why Teh had a tutorial on DP processes, and he used a Gaussian with Wishart Priors. He has the code hosted here (Look for MLSS2007)

answered Jun 30 '11 at 03:10

Leon%20Palafox's gravatar image

Leon Palafox ♦
40857194128

Thanks for your answer. I checked Teh's code. Seems to me it uses the same method as Passos said, in this file: bnpdemo/distributions/@Gaussian/rand.m. Problem solved, thanks.

(Jun 30 '11 at 06:53) Tao Zhuang
Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.