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.040770037 -0.026217983  0.008281761
#> 
#> [[2]]
#> [1] -0.04008987  0.04394645 -0.02669320
#> 
#> [[3]]
#> [1] 0.005175554 0.004878003 0.014484618
#> 
#> [[4]]
#> [1]  0.005608641  0.028381893 -0.022871889
#> 
#> [[5]]
#> [1] 0.014337823 0.021865137 0.007149303
#> 
#> [[6]]
#> [1] -0.021604931 -0.001307357 -0.048671658
#> 
#> [[7]]
#> [1] -0.02821143  0.00963608  0.04793082
#> 
#> [[8]]
#> [1] -0.006411421  0.002284498  0.064332877
#> 
#> [[9]]
#> [1] 0.006097939 0.064089228 0.018345579
#> 
#> [[10]]
#> [1] -0.06179864 -0.04235275 -0.03622121
#>