contord {GenOrd} | R Documentation |
Correlations of discretized variables
Description
The function computes the correlation matrix of the k
variables, with given marginal distributions, derived discretizing a k
-variate standard normal variable with given correlation matrix
Usage
contord(marginal, Sigma, support = list(), Spearman = FALSE)
Arguments
marginal |
a list of |
Sigma |
the correlation matrix of the standard multivariate normal variable |
support |
a list of |
Spearman |
if |
Value
the correlation matrix of the discretized variables
Author(s)
Alessandro Barbiero, Pier Alda Ferrari
See Also
Examples
# consider 4 discrete variables
k <- 4
# with these marginal distributions
marginal <- list(0.4,c(0.3,0.6), c(0.25,0.5,0.75), c(0.1,0.2,0.8,0.9))
# generated discretizing a multivariate standard normal variable
# with correlation matrix
Sigma <- matrix(0.5,4,4)
diag(Sigma) <- 1
# the resulting correlation matrix for the discrete variables is
contord(marginal, Sigma)
# note all the correlations are smaller than the original 0.6
# change Sigma, adding a negative correlation
Sigma[1,2] <- -0.15
Sigma[2,1] <- Sigma[1,2]
Sigma
# checking whether Sigma is still positive definite
eigen(Sigma)$values # all >0, OK
contord(marginal, Sigma)