rmultivariate_normal: rmultivariate_normal

View source: R/gen.rmultivariate_normal.R

rmultivariate_normalR Documentation

rmultivariate_normal

Description

Generate sample from a multivariate normal distribution. The generator uses a singular values decomposition to draw samples from a normal distribution in the basis of the singular vector. Consequently, the covariance matrix can be singular.

Usage

rmultivariate_normal(n, mean, cov)

Arguments

n

[integer] numbers of samples drawn

mean

[vector] mean of Normal law

cov

[matrix] covariance matrix

Value

[matrix]

Examples

mean = stats::runif( n = 2 , min = -5 , max = 5 )
cov  = ROOPSD::rspd_matrix(2)
X    = ROOPSD::rmultivariate_normal( 10000 , mean , cov )


ROOPSD documentation built on Sept. 11, 2023, 9:06 a.m.