An efficient way to generate multivariate normal distribution by Gibbs sampler? [closed]

When learning Gibbs sampler, the most used example is bivariate normal. But what if we want to simulate multivariate normal distribution? The computation (mean and variance) of conditional distribution really annoys me.

Deriving the conditional distributions of a multivariate normal distribution gives some formula to compute it. But computing conditional mean and variable of each variable is quite complicated. For example, if you want to simulate trivariate normal distribution, any good way to computing conditional mean and variance of $$x_2$$ and $$x_3$$ after you have computed that of $$x_1$$ by that formula mentioned above in that link.

closed as unclear what you're asking by Alexis, Sycorax, whuber♦Mar 31 at 21:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• What is your question? – whuber Apr 1 at 3:35
• @whuber seeking an efficient way to computing conditional mean and variance of each variable – Spaceship222 Apr 1 at 11:05
• That's usually done using ordinary least squares regression. – whuber Apr 3 at 14:23
• @whuber How if given only mean and covariance matrix？ – Spaceship222 Apr 3 at 15:42
• stats.stackexchange.com/questions/107597 might help. – whuber Apr 3 at 16:37