For a two-dimensional normal with a covariance unit and zero mean, we simply draw two one-dimensional normals.
If you want to draw a two-dimensional normal with the means (m1, m2), standard deviations (s1, s2) and the correlation rho, then draw two unit one-dimensional normals X and Y and set
u = m1 + s1 * X v = m2 + s2 * (rho X + sqrt(1 - rho^2) Y)
Then u and v are distributed as you wish.
For student T, you should draw a normal variable N and chi ^ 2 variate V. Then N / sqrt (V) has a distribution T.
To draw chi ^ 2 you have to use a package. Or look in Chapter 7, Numerical Recipes, on how to draw from the gamma distribution (xhi ^ 2 - a special case of Gamma).
source share