discrete_cont: Compute the tetrachoric correlation matrix for a multivariate standard normal distribution
Description
This function calculates the intermediate correlation matrix of a multivariate
standard normal distribution in Step 2 of the algorithm. If the resulting matrix
is not positive definite, the nearest positive definite matrix is returned and
a warning is issued.
No return values; called it to check parameter inputs
Arguments
marginal
a list of \(k\) elements, where \(k\) is the number of variables.
The \(i\)-th element of marginal is the vector of the cumulative probabilities defining the marginal distribution of the \(i\)-th component of the multivariate variable. If the \(i\)-th component can take \(k_i\) values, the \(i\)-th element of marginal will contain \(k_i-1\) probabilities (the \(k_i\)-th is obviously 1 and shall not be included).
Sigma
the target correlation matrix of the discrete variables
support
a list of \(k\) elements, where \(k\) is the number of variables. The \(i\)-th element of support is the vector containing the ordered values of the support of the \(i\)-th variable. By default, the support of the \(i\)-th variable is \(1,2,...,k_i\)
Spearman
A logical flag indicating whether Spearman correlation should be used
epsilon
tolerance of the algorithm convergence
maxit
maximum iterations of the algorithm to correct PD matrix
References
Ferrari and Barbiero 2012 (<https://doi.org/10.1080/00273171.2012.692630>)