mvlognormal: Multivariate lognormal random variable generator.

Description Usage Arguments Details Value Author(s) Examples

Description

Given mean (Mu), variances (Sigma) and correlation structure (R) of the distribution, mvlognormal generates multivariate lognormal random variables.

Usage

1
mvlognormal(n, Mu, Sigma, R)

Arguments

n

Sample size (default value is 1).

Mu

Mean vector of length k.

Sigma

Vector of length k containing the diagonal of covariances.

R

A k \times k matrix comprising the correlation structure of the variables on the log-scale, i.e. R = cor(log(X)).

Details

The multivariate lognormal distribution is characterized by its associated normal distribution on the log-scale - if X is lognormal, then log(X) is normal. mvlognormal uses this relationship to generate lognormal random variables. Specifying the correlation structure of the actual variable does not guarantee validity of the associated normal distribution. Hence, the function takes correlation matrix of the log-transformed normal variable to ensure existence.

Value

Matrix of dimension n \times k, where k is the length of the mean vector.

Author(s)

Deepak N. Ayyala

Examples

1
2
3
## Generate 10 samples with dimension 20.
X <- mvlognormal(n = 10, Mu = runif(20, 0, 1), 
      Sigma = rep(2, 20), R = toeplitz(0.5^(0:19)));

Example output



MethylCapSig documentation built on May 2, 2019, 9:24 a.m.