rmvnorm function

Generate data from the multivariate Normal distribution

Generate data from the multivariate Normal distribution

Random generation function from the multivariate Normal distribution with mean equal to meanmean and covariance matrix sigmasigma.

rmvnorm( n = 10, mean = rep( 0, length = ncol( sigma ) ), sigma = diag( length( mean ) ) )

Arguments

  • n: Number of observations.
  • mean: Mean vector, default is rep(0,length=ncol(sigma))rep( 0, length = ncol( sigma ) ).
  • sigma: positive definite covariance matrix, default is diag(length(mean))diag( length( mean ) ).

Returns

A numeric matrix with rows equal to nn and columns equal to length(mean)length( mean ).

Author(s)

Reza Mohammadi a.mohammadi@uva.nl

See Also

bdgraph.sim, rwish, rgwish

Examples

mean <- c( 5, 20 ) sigma <- matrix( c( 4, 2, 2, 5 ), 2, 2 ) # covariance matrix sample <- rmvnorm( n = 500, mean = mean, sigma = sigma ) plot( sample )