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
16115


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 ♦
1896744214334

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
31265471107

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

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×2
×2
×2

Asked: Jun 30 '11 at 02:09

Seen: 1,296 times

Last updated: Jun 30 '11 at 06:57

powered by OSQA

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