cmvrnorm: cmvrnorm

Description Usage Arguments Details Value Author(s) Examples

Description

Produces one or more samples from specified multivariate normal distribution by C-plus-plus

Usage

1
cmvrnorm(n, mu, Sigma)

Arguments

n

the number of samples required. Default 1.

mu

a vector giving the means of variables.

Sigma

a positive-definite symmetric specifying the covariance matrix of variabless

Details

Get multiple variable normal distribution via Choleski decompsition and Rcpp

Value

mat a matrix of n samples of p variables on p-mvr

Author(s)

Eric xin Zhou xxz220@miami.edu

Examples

1
2
3
sigma <- matrix(c(1, 0.9, -0.3, 0.9, 1, -0.4, -0.3, -0.4, 1), ncol = 3)
mu <- c(10, 5, -3)
var(cmvrnorm(10, mu,  sigma))

xinchoubiology/RGallery documentation built on May 4, 2019, 1:06 p.m.