sample_mvn: Sample a Multivariate Normal

Description Usage Arguments Details Value See Also Examples

Description

This function creates N samples from a multivariate normal distribution with mean equal to zero and pairwise-correlation rho.

Usage

1
sample_mvn(nvar, rho, N, seed = 0)

Arguments

nvar

An integer specifying the dimension of the multivariate normal distribution.

rho

The correlation matrix, if a single number is given then the correlation is assumed to be constant between all of the variable.

N

An integer specifying the number of samples.

seed

The seed used to generate that data set.seed.

Details

This is a basic functions that samples a standard normal and uses the Choleski decomposition to create correlated samples.

Value

samples.mvn A matrix of dimensions equal to (nvar, N) containing the samples from a MVN.

See Also

Other data generating functions: MAAR_mechanism_noindep, MAAR_mechanism, MANAR_mechanism, logistic_prob

Examples

1
sample_mvn(5, 0.3, 100)

bojinov/diagMAAR documentation built on May 22, 2019, 2:22 p.m.