Learn R Programming

SimCorMultRes (version 1.4.0)

rnorta: Simulating Continuous Random Vectors using the NORTA Method

Description

Utility function to simulate continuous random vectors with predefined marginal distributions via the NORTA method.

Usage

rnorta(R = R, cor.matrix = cor.matrix, distr = "normal")

Arguments

R
integer indicating the sample size.
cor.matrix
matrix indicating the correlation matrix of the multivariate normal distribution employed in the NORTA method.
distr
character string indicating the desired univariate marginal distributions. Options include "normal", "logistic", "extreme" or "cauchy".

Value

Returns R random vectors of size equal to the row dimension of cor.matrix and marginal distributions distr.

Details

Checks are made to ensure that cor.matrix is a positive definite correlation matrix. This is determined by the eigenvalues.

References

Cario, M. C. and Nelson, B. L. (1997) Modeling and generating random vectors with arbitrary marginal distributions and correlation matrix. Technical Report, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, Illinois.

Li, S. T. and Hammond, J. L. (1975) Generation of pseudorandom numbers with specified univariate distributions and correlation coefficients. IEEE Transacions on Systems, Man and Cybernetics, 5, 557--561.

Examples

Run this code
## An example with marginal distributions the standard logistic.
set.seed(1)
## The latent correlation matrix
latent.cor <- toeplitz(c(1, rep(0.8, 3)))
logit.sim <- rnorta(R = 1000, cor.matrix = latent.cor, distr = "logistic")

## The following code illustrates the NORTA method.
set.seed(1)
norm.sim <- rsmvnorm(1000, latent.cor)
all(logit.sim==qlogis(pnorm(norm.sim)))

Run the code above in your browser using DataLab