# Correlated multivariable gaussian random number generation

## Main Question or Discussion Point

$$\mathrm{prob} \propto \mathrm{e}^{-\frac{(a -x_1)^2}{2 \sigma^2}} \mathrm{e}^{-\frac{(x_1 -x_2)^2}{2 \sigma^2}} \mathrm{e}^{-\frac{(x_2 -x_3)^2}{2 \sigma^2}} \mathrm{e}^{-\frac{(x_3 -b)^2}{2 \sigma^2}}$$

a and b are known real constants.
Is there a way to generate $$x_1$$, $$x_2$$, $$x_3$$ independently using a single gaussian random-number generator 3 times, then transforming them somehow?

I'm almost certain this appears in statistics or applied math textbooks but I don't know what to look for.

Related Set Theory, Logic, Probability, Statistics News on Phys.org
Is there a way to generate $$x_1$$, $$x_2$$, $$x_3$$ independently using a single gaussian random-number generator 3 times, then transforming them somehow?
Yes there is.

First you need to rewrite your PDF as a standard http://en.wikipedia.org/wiki/Multivariate_normal_distribution" [Broken] $\Sigma^{1/2}$ of $\Sigma$.

Then you can generate samples using

$$x = \Sigma^{1/2} y + \mu$$

where $y$ is a 3-vector of single Gaussian (zero mean, variance=1) random numbers.

Last edited by a moderator: