Skip to contents

This function simulates random vectors from the multivariate normal distribution.

Usage

SimMVN(n, mu, sigma_l)

Arguments

n

Positive integer. Number of replications.

mu

Numeric vector. Mean vector (\(\boldsymbol{\nu}\)).

sigma_l

Numeric matrix. Cholesky factorization (t(chol(sigma))) of the variance-covariance matrix \(\boldsymbol{\Sigma}\).

Value

Returns a list of random vectors.

Author

Ivan Jacob Agaloos Pesigan

Examples

n <- 10
mu <- c(0, 0, 0)
sigma_l <- t(chol(0.001 * diag(3)))
SimMVN(n = n, mu = mu, sigma_l = sigma_l)
#> [[1]]
#> [1]  0.01834558  0.01113590 -0.06179864
#> 
#> [[2]]
#> [1] -0.036221215 -0.004993000  0.004195649
#> 
#> [[3]]
#> [1] 0.05200811 0.01056376 0.01108836
#> 
#> [[4]]
#> [1] 0.018110223 0.006361179 0.005058385
#> 
#> [[5]]
#> [1]  0.02579201 -0.03922788  0.01735349
#> 
#> [[6]]
#> [1] 0.01468496 0.02095482 0.01274581
#> 
#> [[7]]
#> [1]  0.029038781  0.007515091 -0.004008343
#> 
#> [[8]]
#> [1]  0.06372791 -0.03531067  0.01063186
#> 
#> [[9]]
#> [1] -0.033914896  0.003523242 -0.034511046
#> 
#> [[10]]
#> [1]  0.008503482 -0.050140839 -0.080797255
#>