cmat.star: Computes the correlation of intermediate multivariate normal...

Description Usage Arguments Value See Also Examples

View source: R/cmat.star.R

Description

The function computes an intermediate correlation matrix which leads to the target correlation matrix after ordinalization of the samples generated from a multivariate normal distribution with the intermediate correlation matrix.

Usage

1
cmat.star(plist, CorrMat, no.ord, no.norm)

Arguments

plist

A list of probability vectors corresponding to each ordinal variable. The i-th element of plist is a vector of the cumulative probabilities defining the marginal distribution of the i-th ordinal component of the multivariate variables. If the i-th ordinal variable has k categories, the i-th vector of the plist will contain k-1 probability values. The k-th element is implicitly 1.

CorrMat

The target correlation matrix which must be positive definite and within the valid limits.

no.ord

Number of ordinal variables in the data.

no.norm

Number of normal variables in the data.

Value

An intermediate correlation matrix of size (no.ord + no.norm) \times (no.ord + no.norm)

See Also

validate.target.cormat

Examples

1
2
3
4
5
6
7
	Sigma = diag(4)
	Sigma[lower.tri(Sigma)] = c(0.42, 0.78, 0.29, 0.37, 0.14, 0.26)
	Sigma = Sigma + t(Sigma)
	diag(Sigma)=1

	marginal = list( c(0.2, 0.5), c(0.4, 0.7, 0.9))
	cmat.star(marginal, Sigma, 2, 2) 

Example output

Loading required package: mvtnorm
Loading required package: corpcor
Loading required package: Matrix
Loading required package: GenOrd
Loading required package: MASS
          [,1]      [,2]      [,3]      [,4]
[1,] 1.0000000 0.5394212 0.8971344 0.3331014
[2,] 0.5394212 1.0000000 0.4070374 0.1537324
[3,] 0.8971344 0.4070374 1.0000000 0.2600000
[4,] 0.3331014 0.1537324 0.2600000 1.0000000

OrdNor documentation built on March 6, 2021, 1:08 a.m.