Skip to contents

Return a DISTRIBUTION object that draw random numbers from a multivariate normal distribution using the mvrnorm function.

Usage

new_MULTINORMAL(p_mu, p_sigma, p_dimnames, tol = 1e-06, empirical = FALSE)

Arguments

p_mu

a vector of means

p_sigma

a positive-definite symmetric matrix for the covariance matrix

p_dimnames

A character that represents the name of the dimension

tol

tolerance (relative to largest variance) for numerical lack of positive-definiteness in p_sigma.

empirical

logical. If true, mu and Sigma specify the empirical not population mean and covariance matrix.

Value

An object of class DISTRIBUTION, MULTINORMAL

See also

Author

John J. Aponte

Examples

msigma <- matrix(c(1,0,0,1), ncol=2)
d1 <- new_MULTINORMAL(c(0,1), msigma)
rfunc(d1, 10)
#>          rvar1       rvar2
#> 1  -0.86844585  0.74160000
#> 2   1.01689456  1.03978988
#> 3  -0.81118937  0.63515824
#> 4   1.27445664  2.37396501
#> 5   1.74157949  0.09141219
#> 6   0.36770829  0.80035625
#> 7   0.06878527  1.41361482
#> 8  -0.14539258  1.69107694
#> 9   1.10003195 -0.62549106
#> 10 -1.21478526 -0.97994597