computeR.reg: A function computing the regularised incompatibility index...

View source: R/computeR.reg.R

computeR.regR Documentation

A function computing the regularised incompatibility index for collections of correlation matrices.

Description

A function solving a SDP problem to compute the regularised incompatibility index R_z() for a collection of correlation matrices, as defined in (7) in \insertCiteBB2024;textualMCARtest. Writes the SDP problem in standard primal form, and uses csdp to solve this.

Usage

computeR.reg(patterns = list(), SigmaS = list(), alpha)

Arguments

patterns

A vector with all the patterns in \mathbb{S}

SigmaS

The sequence of correlation matrices \Sigma_\mathbb{S}

alpha

The regularisation parameter, which satisfies alpha = 1/z.

Value

The value of R_z(), in the interval [0,1].

The optimal X_\mathbb{S} for the primal problem.

The sequence of matrices X_\mathbb{S}^{0} as defined in \insertCiteBB2024;textualMCARtest.

The optimal \Sigma for the dual problem.

The sequence of correlation matrices \Sigma_\mathbb{S} in input.

References

\insertRef

BB2024MCARtest

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))
}

c = 1
for(i in 1:d){
cand = min(eigen(SigmaS[[i]])$values)
if (cand < c){
  c = cand
 }
}

computeR.reg(list(c(1,2),c(2,3), c(1,3)), SigmaS = SigmaS, alpha = 1/c)$R
computeR.reg(list(c(1,2),c(2,3), c(1,3)), SigmaS = SigmaS, alpha = 2)$R

MCARtest documentation built on June 26, 2025, 5:08 p.m.