computeR {MCARtest} | R Documentation |
A function computing the incompatibility index for sequences of correlation matrices
Description
A function solving a SDP problem to compute the incompatibility index for a sequence of
correlation matrices, as defined in Bordino and Berrett (2024).
Writes the SDP problem in standard primal form, and uses
csdp
to solve this.
Usage
computeR(patterns = list(), SigmaS = list())
Arguments
patterns |
A vector with all the patterns in |
SigmaS |
The sequence of correlation matrices |
Value
The value of , in the interval
.
The optimal for the primal problem.
The sequence of matrices as defined in Bordino and Berrett (2024).
The optimal for the dual problem.
The sequence of correlation matrices in input.
References
Bordino A, Berrett TB (2024). “Tests of Missing Completely At Random based on sample covariance matrices.” arXiv preprint arXiv:2401.05256.
Examples
d = 3
SigmaS=list() #Random 2x2 correlation matrices (necessarily consistent)
for(j in 1:d){
x=runif(2,min=-1,max=1); y=runif(2,min=-1,max=1)
SigmaS[[j]]=cov2cor(x%*%t(x) + y%*%t(y))
}
result = computeR(list(c(1,2),c(2,3), c(1,3)), SigmaS = SigmaS)
result$R
[Package MCARtest version 1.2.1 Index]