

   SSiimmuullaattee ffrroomm aa MMuullttiivvaarriiaattee NNoorrmmaall DDiissttrriibbuuttiioonn

        mvrnorm(n=1, mu, Sigma, tol = 1e-6)

   AArrgguummeennttss::

          n: the number of samples required.

         mu: a vector giving the means of the variables.

      Sigma: a positive-definite symmetric matrix specifying
             the covariance matrix of the variables.

        tol: tolerance (relative to largest variance) for
             numerical lack of positive-definiteness in
             `Sigma'.

   DDeessccrriippttiioonn::

        Produces one or more samples from the specified multi-
        variate normal distribution.

   DDeettaaiillss::

        The matrix decomposition is done via `eigen'; although
        a Choleski decomposition might be faster, the eigende-
        composition is stabler.  The help for `rnorm' has an
        alternative version using `svd', which seems a strange
        choice for a positive-definite symmetric matrix (and
        has no check for positive-definiteness).  In S-Plus 4.0
        this is replaced by function `rmvnorm'.

   VVaalluuee::

        If `n = 1' a vector of the same length as `mu', other-
        wise an `n' by `length(mu)' matrix with one sample in
        each row.

   SSiiddee EEffffeeccttss::

        Causes creation of the dataset `.Random.seed' if it
        does not already exist, otherwise its value is updated.

   RReeffeerreenncceess::

        B. D. Ripley (1987) Stochastic Simulation.  Wiley. Page
        98.

   SSeeee AAllssoo::

        `rnorm'

   EExxaammpplleess::

        > Sigma <- matrix(c(10,3,3,2),2,2)
        > Sigma
             [,1] [,2]
        [1,]   10    3
        [2,]    3    2
        > var(mvrnorm(n=1000, rep(0, 2), Sigma))
                 [,1]     [,2]
        [1,] 9.906492 3.030130
        [2,] 3.030130 2.020929

