Learn R Programming

cbsem (version 1.0.0)

rValeMaurelli: rValeMaurelli Simulate data from a multivariate nonnormal distribution such that 1) Each marginal distribution has a specified skewness and kurtosis 2) The marginal variables have the correlation matrix R

Description

rValeMaurelli Simulate data from a multivariate nonnormal distribution such that 1) Each marginal distribution has a specified skewness and kurtosis 2) The marginal variables have the correlation matrix R

Usage

rValeMaurelli(n, R, Fcoef)

Arguments

n

number of random vectors to be generated

R

desired correlation matrix of transformed variables

Fcoef

either vector with coefficents for the Fleishman transform to be applied to all variables or (nrow(R),3) matrix with different coefficients

Value

X (n,nrow(R)) data matrix

Examples

Run this code
# NOT RUN {
R <- matrix(c(1, 0.5, 0.3, 0.5 ,1, 0.2 , 0.3, 0.2 , 1),3,3)
coef <-  matrix(c( 0.90475830, 0.14721082, 0.02386092,0.78999781,0.57487681,
                            -0.05473674,0.79338100, 0.05859729, 0.06363759 ),3,3,byrow=TRUE) 
V <- rValeMaurelli(50, R, coef) 

# }

Run the code above in your browser using DataLab