Decode known latent signal distributed across 3 matrices with SiMLR and RGCCA. For each run, we:

Under the above simulation, a better method will more reliably explain the underlying true latent signal.

The key metrics will compare the ability to predict the known latent signal in testing data based on the embeddings derived in an unsupervised dimensionality reduction step. This is one of the primary ways in which SiMLR may be used to study high-dimensional datasets.

The main metric will be the R\(^2\) value between the model fit and the true latent signal in the test data. Higher values (averaged over simulations) are associated with better performance.

The simulation study has several parameter the user may explore to gain more insight. Default options corrupt each matrix by an amount drawn from a random uniform distribution. We also add modality-specific covariation via a smoothing operation. This operation also dampens signal.

Note: every run re-simulates the input data, re-runs SiMLR and RGCCA and compares the findings to the same applied to permuted data. In a real example, you would only run SiMLR and RGCCA on permuted data in each loop.

set.seed( 808 )
library( ANTsR )
library( RGCCA )
# library( smoother )
doA = TRUE
smoothRows <- function( x ) {
  window = sample( 25:150, 1 )
  nr = nrow( x )
  nc = ncol( x )
  xout = x * 0
  for ( k in 1:nr ) {
    vex = x[k,]
    xout[ k, ] = vex # smoother::smth.gaussian( vex, window=window, tails=TRUE )
  }
  antsrimpute( xout )
}

doCorruption = TRUE
if ( ! exists( "energyType" ) ) energyType = 'cca'
nComp = 4   # n components
if ( ! exists( "nsims" ) ) nsims = 120
nits = 100    # n-iterations
nz = 0       # simulated signal parameter - not sensitive to this choice
nzs = 1.5    # simulated signal parameter - not sensitive to this choice
nzs2 = 1     # simulated signal parameter - not sensitive to this choice
nna = rep( NA, nsims )
# this data frame will hold the results and allow us to answer questions about how noise impacts the outcome
simdatafrm = data.frame(
    symRSQ = nna,
    rgccaRSQ = nna,
    sgccaRSQ = nna,
    prmRSQ = nna,
    corrupt1 = nna,
    corrupt2 = nna,
    corrupt3 = nna,
    nTrueEmbeddings = nna,
    nForSim = nna
    )
################################################################################
for ( sim in c(1:nsims)  ) {
  set.seed( sim )
  smaller = rnorm( 1, 0.8, 0.2 )
  nsub = round( 400 * smaller ) # number of subjects
  npix = c( nsub*4, nsub*2, nsub * 8 ) # size of matrices are wildly different
  ntrain = 0.8 * round( nsub )
  train = sample( c( rep(T, ntrain ) ,rep(F, nsub - ntrain )) ) # train and test split
  test = !train
  nEmbeddings = nk = sample( 5:25, 1 )# for latent signal
    # the outcome's first column is the latent signal that we are seeking
    mixmats  = diag( nk )
    outcome = scale( matrix(runif( nsub * nk, nz, nzs2 ),ncol=nk) )
    # the 3 matrices below represent modality specific distributions
    view1tx = scale(matrix( rnorm( npix[1]  * nk, nz, nzs ), nrow=nk ))
    view2tx = scale(matrix( rnorm( npix[2]  * nk, nz, nzs*1.5 ), nrow=nk ))
    view3tx = scale(matrix( rnorm( npix[3]  * nk, nz, nzs*0.8 ), nrow=nk ))
    # below we mix the independent basis matrices with the true signal
    outcomex = outcome
    # throw some difference in here - so really just the first column is the latent signal
    reo=2:nk
    outcomex[,reo]=sample(outcomex[,reo])
    # here, we resample the diagonal matrix to provide some variability about
    # where the signals appear across different modalities
    # we also smooth to provide some modality specific covariation
    smoosig = abs( rnorm( 3, 6, 1.5 ) ) # draw from a distribution of smoothing parameters
    if ( doA ) mixmat = as.matrix( smoothImage( as.antsImage( mixmats[sample(1:nrow(mixmats)),] %*% view1tx) , smoosig[3] ) ) else mixmat = smoothRows( mixmats[sample(1:nrow(mixmats)),] %*% view1tx )
    # mix in the real signal --- repeat the same procedures for all 3 views of data
    mat1 = (outcomex %*% mixmat )
    outcomex=outcome
    outcomex[,reo]=sample(outcomex[,reo])
    if ( doA ) mixmat = as.matrix( smoothImage( as.antsImage( mixmats[sample(1:nrow(mixmats)),] %*% view2tx), smoosig[2] ) ) else mixmat = smoothRows( mixmats[sample(1:nrow(mixmats)),] %*% view2tx )
    mat2 = (outcomex %*% mixmat )
    outcomex = outcome
    outcomex[,reo] = sample(outcomex[,reo])
    if ( doA ) mixmat = as.matrix( smoothImage( as.antsImage( mixmats[sample(1:nrow(mixmats)),] %*% view3tx),  smoosig[1] ) ) else mixmat = smoothRows( mixmats[sample(1:nrow(mixmats)),] %*% view3tx )
    mat3 = (outcomex %*% mixmat )
    # small additive noise for each matrix
    mat1 = mat1 + matrix( rnorm( prod(dim(mat1)), 0, 0.25 ), nrow=nsub)
    mat2 = mat2 + matrix( rnorm( prod(dim(mat2)), 0, 0.25 ), nrow=nsub)
    mat3 = mat3 + matrix( rnorm( prod(dim(mat3)), 0, 0.25 ), nrow=nsub)

    if ( doCorruption ) {
      # corrupt a portion of matrices - with random amounts of corruption each simulation
      ruinRate = runif(3,0.1,0.9)
      corrSDs = abs( rnorm( 3, 10, 10 ) )
      corrMNs = rnorm( 3, 0, 10 )
      corrInds = round(npix[3] * ruinRate[3] ):npix[3]
      mat3[ ,corrInds] = matrix( rnorm( prod(dim(mat3[ , corrInds])), corrMNs[3], corrSDs[3] ), nrow=nsub)
      corrInds = round(npix[2] * ruinRate[2] ):npix[2]
      mat2[ ,corrInds] = matrix( rnorm( prod(dim(mat2[ , corrInds])), corrMNs[2], corrSDs[2] ), nrow=nsub)
      corrInds = round(npix[1] * ruinRate[1] ):npix[1]
      mat1[ ,corrInds] = matrix( rnorm( prod(dim(mat1[ , corrInds])), corrMNs[1], corrSDs[1] ), nrow=nsub)
      }

    # automate the regularization selection using up to 50 neighbors for each matrix
    inmats = list( vox = mat1[train,], vox2 = mat2[train,], vox3 = mat3[train,] )
    regs = regularizeSimlr( list( mat1[train,], mat2[train,], mat3[train,] ),
                            rep( 50, 3 ), sigma = rep( 10.0, 3 ) )

    result = simlr(
      inmats,
      smoothingMatrices = regs,
      energyType = energyType,
      initialUMatrix = nComp,
      verbose = FALSE,
      iterations = nits,
      mixAlg = mixingMethod  ) # allows different methods to be compared

    p1 = mat1 %*% abs(result$v[[1]]); colnames(p1) = paste0("PC",1:ncol(p1))
    p2 = mat2 %*% abs(result$v[[2]]); colnames(p2) = paste0("PC",1:ncol(p1))
    p3 = mat3 %*% abs(result$v[[3]]); colnames(p3) = paste0("PC",1:ncol(p1))

    nnn = 1:nComp
    temp=data.frame( outc = outcome[,1], sym1=p1[,nnn], sym2=p2[,nnn], sym3=p3[,nnn] )
    mdlsym=lm( outc~.,data=temp[train,])
    dfPred = data.frame( true_test_outcome = temp$outc[test], predicted_outcome = predict(mdlsym,newdata=temp[test,]))
    mdlsymPred = lm( true_test_outcome ~ predicted_outcome, data=dfPred )
    rsqsym = cor( temp$outc[test], predict(mdlsym,newdata=temp[test,]) )^2
    rsqsym

    if ( sim == 1  ) {
      library( rtemis )
      rtlayout(1, 3, byrow = TRUE, autolabel = TRUE)
      rtemis::mplot3.xy( temp[test,]$sym1.PC1, temp[test,]$sym2.PC1,  main='SiMLR: PC1_1 vs PC2_1', se.fit = TRUE, fit='lm'  )
#      rtemis::mplot3.xy( temp[test,]$sym2.PC1, temp[test,]$sym3.PC1,  main='SiMLR: PC2_1 vs PC3_1', se.fit = TRUE, fit='lm'   )
      rtemis::mplot3.xy( temp[test,]$sym3.PC1, temp[test,]$sym3.PC3,  main='SiMLR: PC3_1 vs PC3_3', se.fit = TRUE, fit='lm'   )
#      rtemis::mplot3.xy( temp[test,]$sym2.PC3, temp[test,]$sym1.PC4,  main='SiMLR: PC2_3 vs PC1_4', se.fit = TRUE, fit='lm'   )
      rtemis::mplot3.xy( dfPred$true_test_outcome, dfPred$predicted_outcome, main='SiMLR: Test Data', se.fit = TRUE, fit='lm' )

    }

    # compare to permuted data
    s1 = sample( 1:nsub)
    s2 = sample( 1:nsub)
    s3 = sample( 1:nsub)
    pmat1=mat1[s1,]
    pmat2=mat2[s2,]
    pmat3=mat3[s3,]
    inmats = list( vox = pmat1[train,], vox2 = pmat2[train,], vox3 = pmat3[train,] )
    resultp = simlr(
      inmats,
      smoothingMatrices = regs,
      energyType = energyType,
      initialUMatrix = nComp,
      verbose = F, iterations=5, mixAlg=mixingMethod  )

    p1p = pmat1 %*% abs(resultp$v[[1]])
    p2p = pmat2 %*% abs(resultp$v[[2]])
    p3p = pmat3 %*% abs(resultp$v[[3]])

    temp=data.frame( outc = outcome[,1], p1p[,nnn], p2p[,nnn], p3p[,nnn]   )
    mdlprm=lm( outc~.,data=temp[train,])
    rsqprm = cor( temp$outc[test], predict(mdlprm,newdata=temp[test,]) )^2

    # compare to RGCCA - follow the recommended SABSCOV formulation
    myrgcca = rgcca( # this initializes with SVD
          A = list( mat1[train,],mat2[train,],mat3[train,]),
          C = 1 - diag( 3 ),
          tau = rep( 1, 3 ), # for rgcca
          scheme = 'centroid',
          ncomp = rep( nComp, 3 ),
          scale = TRUE,
          verbose = FALSE )
    prgcca = cbind(
      mat1 %*% myrgcca$a[[1]][,nnn],
      mat2 %*% myrgcca$a[[2]][,nnn],
      mat3 %*% myrgcca$a[[3]][,nnn] )
    temp=data.frame( outc = outcome[,1], prgcca[,1:(max(nnn)*3)] )
    mdlrgcca=lm( outc~.,data=temp[train,])
    rsqrgcca = cor( temp$outc[test], predict(mdlrgcca,newdata=temp[test,]) )^2

    # compare to SGCCA - follow suggested glioma example in documentation
    myrgcca = sgcca( # this initializes with SVD
          A = list( mat1[train,],mat2[train,],mat3[train,]),
          scheme = "centroid",
          ncomp = rep( nComp, 3 ),
          scale = TRUE,
          c1 = rep( 0.5, 3 ), # use something like simlr
          verbose = FALSE )

    prgcca = cbind(
      mat1 %*% myrgcca$a[[1]][,nnn],
      mat2 %*% myrgcca$a[[2]][,nnn],
      mat3 %*% myrgcca$a[[3]][,nnn] )
    temp=data.frame( outc = outcome[,1], prgcca[,1:(max(nnn)*3)] )
    mdlrgcca=lm( outc~.,data=temp[train,])
    rsqsgcca = cor( temp$outc[test], predict(mdlrgcca,newdata=temp[test,]) )^2

  simdatafrm[sim,] = c(
    rsqsym,
    rsqrgcca,
    rsqsgcca,
    rsqprm, ruinRate, nk, nsub )
  print( paste("Simulation:",sim,"rsqsym",rsqsym, "rsqsgcca", rsqsgcca))
  print( simdatafrm[sim,] )
  cat("<<<<********>>>>\n")
  }
## [1] "Simulation: 1 rsqsym 0.218311850275613 rsqsgcca 0.018726097942524"
##      symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 1 0.2183119 0.08271954 0.0187261 0.0001014616 0.6097639 0.1657645 0.2102564
##   nTrueEmbeddings nForSim
## 1              18     270
## <<<<********>>>>
## [1] "Simulation: 2 rsqsym 0.601418572272779 rsqsgcca 0.595573100376879"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 2 0.6014186 0.1663712 0.5955731 0.003939401 0.4274195 0.8341307 0.503782
##   nTrueEmbeddings nForSim
## 2               7     248
## <<<<********>>>>
## [1] "Simulation: 3 rsqsym 0.4908291352135 rsqsgcca 0.449030498392422"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 3 0.4908291 0.3909184 0.4490305 0.006277064 0.3815088 0.8738479 0.3846142
##   nTrueEmbeddings nForSim
## 3              23     243
## <<<<********>>>>
## [1] "Simulation: 4 rsqsym 0.388185135142655 rsqsgcca 0.504529295978701"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 4 0.3881851 0.2380919 0.5045293 0.00822199 0.3743984 0.2930968 0.7249775
##   nTrueEmbeddings nForSim
## 4              21     337
## <<<<********>>>>
## [1] "Simulation: 5 rsqsym 0.514036372450115 rsqsgcca 0.553934741260822"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 5 0.5140364 0.4183328 0.5539347 0.01952523 0.4553291 0.5243792 0.7343283
##   nTrueEmbeddings nForSim
## 5              14     253
## <<<<********>>>>
## [1] "Simulation: 6 rsqsym 0.557169776137472 rsqsgcca 0.566153587511158"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 6 0.5571698 0.5761825 0.5661536 0.01671523 0.6356254 0.5923085 0.7961964
##   nTrueEmbeddings nForSim
## 6              20     342
## <<<<********>>>>
## [1] "Simulation: 7 rsqsym 0.596165428332571 rsqsgcca 0.655560290093703"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 7 0.5961654 0.5894104 0.6555603 0.008977619 0.5721252 0.4228447  0.64963
##   nTrueEmbeddings nForSim
## 7              20     503
## <<<<********>>>>
## [1] "Simulation: 8 rsqsym 0.63245044987272 rsqsgcca 0.641991566398773"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 8 0.6324504 0.5973998 0.6419916 0.0001035369 0.850412 0.5317252 0.3854239
##   nTrueEmbeddings nForSim
## 8              16     313
## <<<<********>>>>
## [1] "Simulation: 9 rsqsym 0.597188509004603 rsqsgcca 0.709779240852967"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 9 0.5971885 0.5016047 0.7097792 0.004444769 0.2962562 0.5647676 0.3991453
##   nTrueEmbeddings nForSim
## 9               6     259
## <<<<********>>>>
## [1] "Simulation: 10 rsqsym 0.67961547408819 rsqsgcca 0.647042973433406"
##       symRSQ  rgccaRSQ sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 10 0.6796155 0.6591293 0.647043 0.0009896896 0.8285033 0.1398677 0.2981007
##    nTrueEmbeddings nForSim
## 10               5     321
## <<<<********>>>>
## [1] "Simulation: 11 rsqsym 0.434917233315375 rsqsgcca 0.487634845631952"
##       symRSQ rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 11 0.4349172 0.463435 0.4876348 0.08693272 0.2858025 0.4138801 0.465193
##    nTrueEmbeddings nForSim
## 11               6     273
## <<<<********>>>>
## [1] "Simulation: 12 rsqsym 0.451019866813459 rsqsgcca 0.556552317212778"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2 corrupt3
## 12 0.4510199 0.4937726 0.5565523 0.04963764 0.6473258 0.397628 0.646168
##    nTrueEmbeddings nForSim
## 12              15     202
## <<<<********>>>>
## [1] "Simulation: 13 rsqsym 0.408942745263851 rsqsgcca 0.187849234612155"
##       symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 13 0.4089427 0.08321715 0.1878492 1.468865e-05 0.6888443 0.1847571 0.2689542
##    nTrueEmbeddings nForSim
## 13              24     364
## <<<<********>>>>
## [1] "Simulation: 14 rsqsym 0.517147154941497 rsqsgcca 0.547674808826771"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 14 0.5171472 0.4086983 0.5476748 7.008264e-05 0.6714665 0.8571574 0.6680247
##    nTrueEmbeddings nForSim
## 14               9     267
## <<<<********>>>>
## [1] "Simulation: 15 rsqsym 0.579293879388706 rsqsgcca 0.633558410137305"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 15 0.5792939 0.5900965 0.6335584 0.0002539454 0.2550545 0.8027444 0.2884029
##    nTrueEmbeddings nForSim
## 15              23     341
## <<<<********>>>>
## [1] "Simulation: 16 rsqsym 0.42087647028201 rsqsgcca 0.378181848044538"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 16 0.4208765 0.300542 0.3781818 0.008679495 0.8224056 0.2788775 0.3789082
##    nTrueEmbeddings nForSim
## 16              20     358
## <<<<********>>>>
## [1] "Simulation: 17 rsqsym 0.412962864037563 rsqsgcca 0.325216816997708"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 17 0.4129629 0.2446114 0.3252168 0.02723287 0.3827463 0.1016975 0.498994
##    nTrueEmbeddings nForSim
## 17              16     239
## <<<<********>>>>
## [1] "Simulation: 18 rsqsym 0.449357887147711 rsqsgcca 0.487545156122575"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 18 0.4493579 0.4760749 0.4875452 0.003657696 0.5939755 0.8541631 0.8179487
##    nTrueEmbeddings nForSim
## 18              21     394
## <<<<********>>>>
## [1] "Simulation: 19 rsqsym 0.642391712994806 rsqsgcca 0.610320351851101"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 19 0.6423917 0.5842467 0.6103204 0.06772832 0.5315619 0.8480022 0.8151635
##    nTrueEmbeddings nForSim
## 19              15     225
## <<<<********>>>>
## [1] "Simulation: 20 rsqsym 0.580640037424599 rsqsgcca 0.631717335166447"
##     symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 20 0.58064 0.5748232 0.6317173 0.0001031386 0.894567 0.3830734 0.7762652
##    nTrueEmbeddings nForSim
## 20              20     413
## <<<<********>>>>
## [1] "Simulation: 21 rsqsym 0.45806632115619 rsqsgcca 0.424489898976203"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 21 0.4580663 0.4008263 0.4244899 0.01627212 0.5307914 0.6875179 0.4006813
##    nTrueEmbeddings nForSim
## 21              12     383
## <<<<********>>>>
## [1] "Simulation: 22 rsqsym 0.501626803751263 rsqsgcca 0.494342717311942"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 22 0.5016268 0.5103097 0.4943427 0.007482171 0.8267991 0.8716003 0.1569747
##    nTrueEmbeddings nForSim
## 22              21     279
## <<<<********>>>>
## [1] "Simulation: 23 rsqsym 0.424019982155719 rsqsgcca 0.393342607460417"
##     symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 23 0.42402 0.4023419 0.3933426 0.05703327 0.1604842 0.6603718 0.6257906
##    nTrueEmbeddings nForSim
## 23              18     335
## <<<<********>>>>
## [1] "Simulation: 24 rsqsym 0.584745308650897 rsqsgcca 0.540257822588242"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 24 0.5847453 0.5114599 0.5402578 0.02428871 0.1296695 0.1695853 0.1227204
##    nTrueEmbeddings nForSim
## 24              25     276
## <<<<********>>>>
## [1] "Simulation: 25 rsqsym 0.521024738963995 rsqsgcca 0.380594555044674"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 25 0.5210247 0.2873388 0.3805946 0.01872892 0.8768807 0.6860525 0.1169671
##    nTrueEmbeddings nForSim
## 25               6     303
## <<<<********>>>>
## [1] "Simulation: 26 rsqsym 0.623962590853523 rsqsgcca 0.192686681356382"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 26 0.6239626 0.2956608 0.1926867 0.02629532 0.6882603 0.6693866 0.2517785
##    nTrueEmbeddings nForSim
## 26              19     150
## <<<<********>>>>
## [1] "Simulation: 27 rsqsym 0.500407434073037 rsqsgcca 0.446730557125625"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 27 0.5004074 0.3633363 0.4467306 0.01924604 0.6904371 0.3571471 0.5333443
##    nTrueEmbeddings nForSim
## 27              19     473
## <<<<********>>>>
## [1] "Simulation: 28 rsqsym 0.756953426568984 rsqsgcca 0.694456226136815"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ corrupt1  corrupt2 corrupt3
## 28 0.7569534 0.6131814 0.6944562 0.02849553 0.620296 0.8436519 0.458144
##    nTrueEmbeddings nForSim
## 28               6     168
## <<<<********>>>>
## [1] "Simulation: 29 rsqsym 0.667835459686361 rsqsgcca 0.687258593145159"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 29 0.6678355 0.5377198 0.6872586 0.0001343395 0.5194642 0.8266058 0.6277783
##    nTrueEmbeddings nForSim
## 29              11     217
## <<<<********>>>>
## [1] "Simulation: 30 rsqsym 0.583164403793886 rsqsgcca 0.361962147639716"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 30 0.5831644 0.2458016 0.3619621 0.002565758 0.3032608 0.7383811 0.5852181
##    nTrueEmbeddings nForSim
## 30              20     217
## <<<<********>>>>
## [1] "Simulation: 31 rsqsym 0.491164889249464 rsqsgcca 0.526921066150372"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 31 0.4911649 0.4618586 0.5269211 0.08891029 0.7282429 0.2031838 0.4044328
##    nTrueEmbeddings nForSim
## 31              18     324
## <<<<********>>>>
## [1] "Simulation: 32 rsqsym 0.390542036979606 rsqsgcca 0.524980373796632"
##      symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 32 0.390542 0.3883998 0.5249804 0.0110365 0.3501221 0.5624648 0.4493418
##    nTrueEmbeddings nForSim
## 32               8     321
## <<<<********>>>>
## [1] "Simulation: 33 rsqsym 0.268705231351444 rsqsgcca 0.268563043104229"
##       symRSQ   rgccaRSQ sgccaRSQ    prmRSQ corrupt1  corrupt2  corrupt3
## 33 0.2687052 0.08773133 0.268563 0.1164987 0.436592 0.1385706 0.3680125
##    nTrueEmbeddings nForSim
## 33              22     309
## <<<<********>>>>
## [1] "Simulation: 34 rsqsym 0.410165731807403 rsqsgcca 0.392154570116717"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 34 0.4101657 0.2082791 0.3921546 0.01946503 0.1544002 0.8155863 0.2192953
##    nTrueEmbeddings nForSim
## 34              15     309
## <<<<********>>>>
## Warning in sgccak(R, C, c1 = c1, scheme = scheme, init = init, bias = bias, :
## The SGCCA algorithm did not converge after 1000 iterations.
## [1] "Simulation: 35 rsqsym 0.677005245327446 rsqsgcca 0.692674333583416"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 35 0.6770052 0.4506672 0.6926743 0.04068371 0.5851936 0.3427513 0.5000881
##    nTrueEmbeddings nForSim
## 35               7     405
## <<<<********>>>>
## [1] "Simulation: 36 rsqsym 0.643949329698772 rsqsgcca 0.349633394596894"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 36 0.6439493 0.405382 0.3496334 0.005257452 0.2522588 0.7206225 0.8813692
##    nTrueEmbeddings nForSim
## 36              24     345
## <<<<********>>>>
## [1] "Simulation: 37 rsqsym 0.583630514220776 rsqsgcca 0.34229890230554"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 37 0.5836305 0.1316114 0.3422989 0.03234341 0.4398332 0.4602104 0.250888
##    nTrueEmbeddings nForSim
## 37               7     330
## <<<<********>>>>
## [1] "Simulation: 38 rsqsym 0.0935386772683676 rsqsgcca 0.118994380725365"
##        symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 38 0.09353868 0.01403716 0.1189944 0.0001659821 0.1679595 0.7741895 0.2491769
##    nTrueEmbeddings nForSim
## 38              25     300
## <<<<********>>>>
## [1] "Simulation: 39 rsqsym 0.569985250000322 rsqsgcca 0.454043440551608"
##       symRSQ rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 39 0.5699853 0.337834 0.4540434 0.02833617 0.2791145 0.640759 0.8329312
##    nTrueEmbeddings nForSim
## 39              25     305
## <<<<********>>>>
## [1] "Simulation: 40 rsqsym 0.500049233027188 rsqsgcca 0.36697276127582"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 40 0.5000492 0.2389479 0.3669728 0.0001440184 0.1590437 0.833552 0.4547524
##    nTrueEmbeddings nForSim
## 40              24     358
## <<<<********>>>>
## [1] "Simulation: 41 rsqsym 0.621958297515185 rsqsgcca 0.503186954954368"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 41 0.6219583 0.3828291 0.503187 0.002677636 0.4847883 0.291713 0.8222376
##    nTrueEmbeddings nForSim
## 41              20     256
## <<<<********>>>>
## [1] "Simulation: 42 rsqsym 0.544818723806164 rsqsgcca 0.511858027221582"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 42 0.5448187 0.3585077 0.511858 0.03371255 0.3012763 0.627033 0.3951814
##    nTrueEmbeddings nForSim
## 42              20     430
## <<<<********>>>>
## [1] "Simulation: 43 rsqsym 0.631317770052802 rsqsgcca 0.574131284356983"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 43 0.6313178 0.5780918 0.5741313 0.007660984 0.7214112 0.8823007 0.3360352
##    nTrueEmbeddings nForSim
## 43              17     317
## <<<<********>>>>
## [1] "Simulation: 44 rsqsym 0.648890750690163 rsqsgcca 0.584978389409612"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 44 0.6488908 0.4620259 0.5849784 6.801823e-07 0.6155342 0.8495107 0.1289159
##    nTrueEmbeddings nForSim
## 44               9     372
## <<<<********>>>>
## [1] "Simulation: 45 rsqsym 0.69829104729263 rsqsgcca 0.588719287021426"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2 corrupt3
## 45 0.698291 0.5227885 0.5887193 0.003033751 0.1410228 0.289673 0.356922
##    nTrueEmbeddings nForSim
## 45              12     347
## <<<<********>>>>
## [1] "Simulation: 46 rsqsym 0.392931315276972 rsqsgcca 0.422803589835628"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 46 0.3929313 0.2128069 0.4228036 0.0007764303 0.3769051 0.5152114 0.2799855
##    nTrueEmbeddings nForSim
## 46              19     248
## <<<<********>>>>
## [1] "Simulation: 47 rsqsym 0.454332712452488 rsqsgcca 0.517948539126346"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 47 0.4543327 0.5015011 0.5179485 0.03934069 0.8738161 0.1229469  0.30533
##    nTrueEmbeddings nForSim
## 47              12     480
## <<<<********>>>>
## [1] "Simulation: 48 rsqsym 0.550509477371469 rsqsgcca 0.562433880394532"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1 corrupt2  corrupt3
## 48 0.5505095 0.5915697 0.5624339 0.005883771 0.471881 0.522434 0.8014456
##    nTrueEmbeddings nForSim
## 48              19     336
## <<<<********>>>>
## [1] "Simulation: 49 rsqsym 0.694798376914468 rsqsgcca 0.704244400642284"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 49 0.6947984 0.6370647 0.7042444 0.02412728 0.6656333 0.6198922 0.866629
##    nTrueEmbeddings nForSim
## 49              13     293
## <<<<********>>>>
## [1] "Simulation: 50 rsqsym 0.600533876381929 rsqsgcca 0.56595396091291"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 50 0.6005339 0.3452818 0.565954 0.01124588 0.4344102 0.6799204 0.4099741
##    nTrueEmbeddings nForSim
## 50              16     364
## <<<<********>>>>
## [1] "Simulation: 51 rsqsym 0.453491554560102 rsqsgcca 0.475377230043224"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2 corrupt3
## 51 0.4534916 0.3566666 0.4753772 0.0101871 0.3476936 0.8587498 0.486094
##    nTrueEmbeddings nForSim
## 51              18     381
## <<<<********>>>>
## [1] "Simulation: 52 rsqsym 0.396131431842535 rsqsgcca 0.136185908409598"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 52 0.3961314 0.06545324 0.1361859 0.06827443 0.1569439 0.2231528 0.1094279
##    nTrueEmbeddings nForSim
## 52              18     241
## <<<<********>>>>
## [1] "Simulation: 53 rsqsym 0.356070901424428 rsqsgcca 0.36556762450566"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 53 0.3560709 0.3179103 0.3655676 0.05770816 0.4425242 0.1883126 0.5680132
##    nTrueEmbeddings nForSim
## 53              17     336
## <<<<********>>>>
## [1] "Simulation: 54 rsqsym 0.583101244008749 rsqsgcca 0.312845185739914"
##       symRSQ   rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 54 0.5831012 0.07820099 0.3128452 0.003450106 0.8272887 0.4393381 0.2237687
##    nTrueEmbeddings nForSim
## 54              15     471
## <<<<********>>>>
## [1] "Simulation: 55 rsqsym 0.392922581818401 rsqsgcca 0.338546044894568"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 55 0.3929226 0.1876889 0.338546 0.002840039 0.2681519 0.3353227 0.4164188
##    nTrueEmbeddings nForSim
## 55              12     330
## <<<<********>>>>
## [1] "Simulation: 56 rsqsym 0.534741804754525 rsqsgcca 0.561318650609173"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 56 0.5347418 0.5374709 0.5613187 0.008713642 0.2937456 0.8149369 0.8739436
##    nTrueEmbeddings nForSim
## 56              12     301
## <<<<********>>>>
## [1] "Simulation: 57 rsqsym 0.620823330016143 rsqsgcca 0.540933641683108"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 57 0.6208233 0.4067728 0.5409336 0.02522952 0.1002266 0.4612999 0.2636267
##    nTrueEmbeddings nForSim
## 57               7     264
## <<<<********>>>>
## [1] "Simulation: 58 rsqsym 0.4981269575989 rsqsgcca 0.433578117219692"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 58 0.498127 0.3645029 0.4335781 0.02854572 0.7507904 0.3868264 0.6326859
##    nTrueEmbeddings nForSim
## 58              17     284
## <<<<********>>>>
## [1] "Simulation: 59 rsqsym 0.499136410995172 rsqsgcca 0.45002137921813"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 59 0.4991364 0.2612097 0.4500214 0.02275719 0.5269512 0.8585265 0.2362692
##    nTrueEmbeddings nForSim
## 59               5     171
## <<<<********>>>>
## [1] "Simulation: 60 rsqsym 0.233867535633137 rsqsgcca 0.154954811568022"
##       symRSQ   rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 60 0.2338675 0.06798344 0.1549548 0.004577056 0.1368409 0.4308373 0.1536706
##    nTrueEmbeddings nForSim
## 60               5     378
## <<<<********>>>>
## [1] "Simulation: 61 rsqsym 0.49511166074831 rsqsgcca 0.478090567151587"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 61 0.4951117 0.3877688 0.4780906 8.869313e-05 0.7889965 0.2945368 0.5370012
##    nTrueEmbeddings nForSim
## 61              20     290
## <<<<********>>>>
## [1] "Simulation: 62 rsqsym 0.597663206925825 rsqsgcca 0.10709024086297"
##       symRSQ     rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 62 0.5976632 5.971027e-05 0.1070902 0.0006179396 0.2928243 0.8788607 0.1882851
##    nTrueEmbeddings nForSim
## 62              13     384
## <<<<********>>>>
## [1] "Simulation: 63 rsqsym 0.672480821136323 rsqsgcca 0.72597409027156"
##       symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 63 0.6724808 0.631906 0.7259741 0.0004733082 0.7306326 0.4942561 0.4960944
##    nTrueEmbeddings nForSim
## 63              21     426
## <<<<********>>>>
## [1] "Simulation: 64 rsqsym 0.218181587187968 rsqsgcca 0.0510543583554501"
##       symRSQ  rgccaRSQ   sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 64 0.2181816 0.1212347 0.05105436 0.04862605 0.3259776 0.2503945 0.4200655
##    nTrueEmbeddings nForSim
## 64              21     183
## <<<<********>>>>
## [1] "Simulation: 65 rsqsym 0.346167597079453 rsqsgcca 0.391080548520454"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 65 0.3461676 0.1598126 0.3910805 0.03748557 0.8581586 0.3279982 0.4257686
##    nTrueEmbeddings nForSim
## 65              16     224
## <<<<********>>>>
## [1] "Simulation: 66 rsqsym 0.452401654547075 rsqsgcca 0.400317684596816"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 66 0.4524017 0.2112562 0.4003177 5.949191e-06 0.4530189 0.640667 0.4527265
##    nTrueEmbeddings nForSim
## 66              17     506
## <<<<********>>>>
## [1] "Simulation: 67 rsqsym 0.566829134447346 rsqsgcca 0.543582395303469"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 67 0.5668291 0.3941403 0.5435824 0.0215324 0.1862677 0.5875123 0.4180602
##    nTrueEmbeddings nForSim
## 67              24     418
## <<<<********>>>>
## [1] "Simulation: 68 rsqsym 0.50212538558138 rsqsgcca 0.393353301220279"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 68 0.5021254 0.4409409 0.3933533 0.02069253 0.4696518 0.2779817 0.2467748
##    nTrueEmbeddings nForSim
## 68              19     435
## <<<<********>>>>
## [1] "Simulation: 69 rsqsym 0.465651128558678 rsqsgcca 0.428005383535426"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 69 0.4656511 0.3811938 0.4280054 0.03134277 0.1099845 0.5348248 0.5275168
##    nTrueEmbeddings nForSim
## 69               8     326
## <<<<********>>>>
## [1] "Simulation: 70 rsqsym 0.348183965093922 rsqsgcca 0.52241607460703"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 70 0.348184 0.2601868 0.5224161 0.005120797 0.6776801 0.647109 0.8815156
##    nTrueEmbeddings nForSim
## 70              17     197
## <<<<********>>>>
## [1] "Simulation: 71 rsqsym 0.726490881298171 rsqsgcca 0.682346119437703"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 71 0.7264909 0.6673374 0.6823461 0.008282554 0.3003894 0.2379569 0.2127435
##    nTrueEmbeddings nForSim
## 71              25     285
## <<<<********>>>>
## [1] "Simulation: 72 rsqsym 0.488232262669432 rsqsgcca 0.330786782282328"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 72 0.4882323 0.0443791 0.3307868 0.007719525 0.3011837 0.4871177 0.6970519
##    nTrueEmbeddings nForSim
## 72              15     430
## <<<<********>>>>
## [1] "Simulation: 73 rsqsym 0.566123806305665 rsqsgcca 0.534509309466627"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 73 0.5661238 0.2497581 0.5345093 0.02522339 0.8569064 0.3947365 0.4396441
##    nTrueEmbeddings nForSim
## 73               8     308
## <<<<********>>>>
## [1] "Simulation: 74 rsqsym 0.477750728267916 rsqsgcca 0.384064993077656"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 74 0.4777507 0.2561163 0.384065 0.001840344 0.6702812 0.2161957 0.5101028
##    nTrueEmbeddings nForSim
## 74              20     363
## <<<<********>>>>
## [1] "Simulation: 75 rsqsym 0.534964239115241 rsqsgcca 0.512149963257713"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 75 0.5349642 0.4724307  0.51215 0.006007692 0.7490435 0.7985777 0.1631237
##    nTrueEmbeddings nForSim
## 75              19     257
## <<<<********>>>>
## [1] "Simulation: 76 rsqsym 0.509307055962232 rsqsgcca 0.581772650422497"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 76 0.5093071 0.3706199 0.5817727 0.0005374709 0.6437605 0.4883076 0.4903955
##    nTrueEmbeddings nForSim
## 76              18     345
## <<<<********>>>>
## [1] "Simulation: 77 rsqsym 0.300096028816334 rsqsgcca 0.0886396795793668"
##      symRSQ   rgccaRSQ   sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 77 0.300096 0.04884299 0.08863968 0.006779478 0.4233497 0.5933021 0.1258496
##    nTrueEmbeddings nForSim
## 77               8     276
## <<<<********>>>>
## [1] "Simulation: 78 rsqsym 0.260678058365586 rsqsgcca 0.240153541495727"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 78 0.2606781 0.1660221 0.2401535 0.001285991 0.1547818 0.1775583 0.4993309
##    nTrueEmbeddings nForSim
## 78              13     377
## <<<<********>>>>
## [1] "Simulation: 79 rsqsym 0.52610152160492 rsqsgcca 0.531540284135714"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 79 0.5261015 0.3364088 0.5315403 0.04788949 0.5654484 0.5645001 0.7428239
##    nTrueEmbeddings nForSim
## 79              12     409
## <<<<********>>>>
## [1] "Simulation: 80 rsqsym 0.426927222406861 rsqsgcca 0.259295257499687"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 80 0.4269272 0.0290133 0.2592953 0.006161155 0.4462618 0.7851674 0.2694984
##    nTrueEmbeddings nForSim
## 80              15     308
## <<<<********>>>>
## [1] "Simulation: 81 rsqsym 0.581530202296948 rsqsgcca 0.6270887366707"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 81 0.5815302 0.5587883 0.6270887 0.01207802 0.2400547 0.3223464 0.2583558
##    nTrueEmbeddings nForSim
## 81              14     237
## <<<<********>>>>
## [1] "Simulation: 82 rsqsym 0.328415787868357 rsqsgcca 0.281301104245019"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 82 0.3284158 0.2911373 0.2813011 0.001558791 0.2712748 0.7504076 0.3170967
##    nTrueEmbeddings nForSim
## 82              13     222
## <<<<********>>>>
## [1] "Simulation: 83 rsqsym 0.311406115942455 rsqsgcca 0.27749133701365"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 83 0.3114061 0.2636826 0.2774913 0.04361256 0.6055685 0.6917729 0.7518633
##    nTrueEmbeddings nForSim
## 83              21     130
## <<<<********>>>>
## Warning in sgccak(R, C, c1 = c1, scheme = scheme, init = init, bias = bias, :
## The SGCCA algorithm did not converge after 1000 iterations.
## [1] "Simulation: 84 rsqsym 0.601918654969416 rsqsgcca 0.562166202930219"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 84 0.6019187 0.5869723 0.5621662 0.0002484066 0.5766139 0.5075706 0.1269817
##    nTrueEmbeddings nForSim
## 84              14     378
## <<<<********>>>>
## Warning in sgccak(R, C, c1 = c1, scheme = scheme, init = init, bias = bias, :
## The SGCCA algorithm did not converge after 1000 iterations.
## [1] "Simulation: 85 rsqsym 0.507004954430795 rsqsgcca 0.441601070309138"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 85 0.507005 0.2444986 0.4416011 1.96583e-05 0.609813 0.1514781 0.6292061
##    nTrueEmbeddings nForSim
## 85              12     319
## <<<<********>>>>
## [1] "Simulation: 86 rsqsym 0.585652012018178 rsqsgcca 0.503980519434783"
##      symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 86 0.585652 0.4446583 0.5039805 0.0273175 0.3358441 0.3240853 0.8426786
##    nTrueEmbeddings nForSim
## 86              24     377
## <<<<********>>>>
## [1] "Simulation: 87 rsqsym 0.313946999696718 rsqsgcca 0.237756026328088"
##      symRSQ  rgccaRSQ sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 87 0.313947 0.1965243 0.237756 0.1915176 0.4697052 0.4237337 0.2751579
##    nTrueEmbeddings nForSim
## 87              17     149
## <<<<********>>>>
## [1] "Simulation: 88 rsqsym 0.572486987595276 rsqsgcca 0.719837366483992"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 88 0.572487 0.7052217 0.7198374 0.002497289 0.1529857 0.2631594 0.2922959
##    nTrueEmbeddings nForSim
## 88               9     302
## <<<<********>>>>
## [1] "Simulation: 89 rsqsym 0.653879973713315 rsqsgcca 0.723562265811417"
##     symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 89 0.65388 0.2954773 0.7235623 0.09165673 0.6562259 0.1322438 0.6857676
##    nTrueEmbeddings nForSim
## 89               7     204
## <<<<********>>>>
## [1] "Simulation: 90 rsqsym 0.652195161768425 rsqsgcca 0.592271123229641"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 90 0.6521952 0.4240334 0.5922711 0.001823555 0.6310118 0.6484033 0.6847723
##    nTrueEmbeddings nForSim
## 90              15     326
## <<<<********>>>>
## [1] "Simulation: 91 rsqsym 0.522323841403289 rsqsgcca 0.47162886101363"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 91 0.5223238 0.3279079 0.4716289 0.06437637 0.1137693 0.8786272 0.5353798
##    nTrueEmbeddings nForSim
## 91              22     324
## <<<<********>>>>
## [1] "Simulation: 92 rsqsym 0.366422024522827 rsqsgcca 0.476281754919686"
##      symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 92 0.366422 0.06712833 0.4762818 0.02081252 0.5576644 0.3941734 0.5302135
##    nTrueEmbeddings nForSim
## 92              25     202
## <<<<********>>>>
## [1] "Simulation: 93 rsqsym 0.298791194130764 rsqsgcca 0.433679248222673"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 93 0.2987912 0.2630624 0.4336792 0.0003566044 0.3560441 0.226927 0.5352436
##    nTrueEmbeddings nForSim
## 93              13     294
## <<<<********>>>>
## [1] "Simulation: 94 rsqsym 0.637575991823816 rsqsgcca 0.668982247356921"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 94 0.637576 0.5782863 0.6689822 0.02227727 0.5291184 0.7492544 0.5367249
##    nTrueEmbeddings nForSim
## 94              17     412
## <<<<********>>>>
## [1] "Simulation: 95 rsqsym 0.451168144547921 rsqsgcca 0.436839440780205"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 95 0.4511681 0.2711107 0.4368394 0.0007274206 0.1295026 0.7203477 0.4332235
##    nTrueEmbeddings nForSim
## 95              10     238
## <<<<********>>>>
## [1] "Simulation: 96 rsqsym 0.460782041139416 rsqsgcca 0.398062109699398"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 96 0.460782 0.2148298 0.3980621 3.730104e-05 0.3888925 0.2550032 0.2558169
##    nTrueEmbeddings nForSim
## 96              11     326
## <<<<********>>>>
## [1] "Simulation: 97 rsqsym 0.283034500298583 rsqsgcca 0.301835992177041"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 97 0.2830345 0.2737499 0.301836 0.03070206 0.2608804 0.2873599 0.7119718
##    nTrueEmbeddings nForSim
## 97              13     181
## <<<<********>>>>
## [1] "Simulation: 98 rsqsym 0.529270834194948 rsqsgcca 0.566754553822022"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 98 0.5292708 0.4599721 0.5667546 0.001851919 0.4428944 0.2541065 0.3347575
##    nTrueEmbeddings nForSim
## 98              10     313
## <<<<********>>>>
## [1] "Simulation: 99 rsqsym 0.70770780822397 rsqsgcca 0.494021558546621"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 99 0.7077078 0.5275812 0.4940216 0.01196166 0.5520611 0.6440624 0.1254326
##    nTrueEmbeddings nForSim
## 99              10     337
## <<<<********>>>>
## [1] "Simulation: 100 rsqsym 0.572501196838784 rsqsgcca 0.393888924231565"
##        symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1 corrupt2  corrupt3
## 100 0.5725012 0.2019161 0.3938889 0.0215531 0.5527685 0.856266 0.3965549
##     nTrueEmbeddings nForSim
## 100              23     280
## <<<<********>>>>
## [1] "Simulation: 101 rsqsym 0.607963841733335 rsqsgcca 0.548861671617379"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 101 0.6079638 0.4970487 0.5488617 0.05002193 0.4105611 0.8063324 0.6630487
##     nTrueEmbeddings nForSim
## 101              25     294
## <<<<********>>>>
## [1] "Simulation: 102 rsqsym 0.580946261431419 rsqsgcca 0.639175816961478"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 102 0.5809463 0.6054637 0.6391758 0.0002671693 0.8525122 0.6505218 0.8316572
##     nTrueEmbeddings nForSim
## 102              15     334
## <<<<********>>>>
## [1] "Simulation: 103 rsqsym 0.560277024774188 rsqsgcca 0.554842218037964"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 103 0.560277 0.425402 0.5548422 0.002798476 0.5954883 0.6062012 0.8316034
##     nTrueEmbeddings nForSim
## 103              20     257
## <<<<********>>>>
## [1] "Simulation: 104 rsqsym 0.361935085511269 rsqsgcca 0.395347060438571"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 104 0.3619351 0.2594474 0.3953471 0.006320821 0.4997567 0.4452579 0.4073715
##     nTrueEmbeddings nForSim
## 104              24     292
## <<<<********>>>>
## [1] "Simulation: 105 rsqsym 0.556473400647814 rsqsgcca 0.501156946708329"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 105 0.5564734 0.2121226 0.5011569 0.01929927 0.5225104 0.3544439 0.8036832
##     nTrueEmbeddings nForSim
## 105              14     217
## <<<<********>>>>
## [1] "Simulation: 106 rsqsym 0.45723864415915 rsqsgcca 0.454916790089812"
##        symRSQ rgccaRSQ  sgccaRSQ      prmRSQ corrupt1 corrupt2  corrupt3
## 106 0.4572386 0.213753 0.4549168 0.000203309 0.822649  0.43779 0.8917009
##     nTrueEmbeddings nForSim
## 106              21     245
## <<<<********>>>>
## [1] "Simulation: 107 rsqsym 0.503785910628612 rsqsgcca 0.613984947392843"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 107 0.5037859 0.3700447 0.6139849 6.537106e-08 0.2662422     0.85 0.6465484
##     nTrueEmbeddings nForSim
## 107               7     321
## <<<<********>>>>
## [1] "Simulation: 108 rsqsym 0.572391721626676 rsqsgcca 0.725311962828203"
##        symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 108 0.5723917 0.6252097 0.725312 0.004395528 0.5178112 0.7085239 0.686261
##     nTrueEmbeddings nForSim
## 108              22     311
## <<<<********>>>>
## [1] "Simulation: 109 rsqsym 0.0635448934561401 rsqsgcca 0.135051397560783"
##         symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 109 0.06354489 0.01966475 0.1350514 6.0463e-05 0.4445034 0.7832479 0.6515661
##     nTrueEmbeddings nForSim
## 109              19     163
## <<<<********>>>>
## [1] "Simulation: 110 rsqsym 0.45572172689265 rsqsgcca 0.288982317370882"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 110 0.4557217 0.1305512 0.2889823 0.001912686 0.635658 0.5320764 0.4454202
##     nTrueEmbeddings nForSim
## 110              24     343
## <<<<********>>>>
## [1] "Simulation: 111 rsqsym 0.462363341803474 rsqsgcca 0.378644405525776"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ corrupt1 corrupt2  corrupt3
## 111 0.4623633 0.2684032 0.3786444 0.01723496 0.284206 0.150226 0.5085848
##     nTrueEmbeddings nForSim
## 111              15     339
## <<<<********>>>>
## [1] "Simulation: 112 rsqsym 0.633524549163417 rsqsgcca 0.626592559497463"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 112 0.6335245 0.5214905 0.6265926 0.001774272 0.5591724 0.6889736 0.6090539
##     nTrueEmbeddings nForSim
## 112              22     295
## <<<<********>>>>
## [1] "Simulation: 113 rsqsym 0.421864508641492 rsqsgcca 0.494927911559694"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 113 0.4218645 0.3148347 0.4949279 0.001070468 0.1964909 0.5260146 0.4824141
##     nTrueEmbeddings nForSim
## 113              15     331
## <<<<********>>>>
## [1] "Simulation: 114 rsqsym 0.188503875225456 rsqsgcca 0.315416751242309"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 114 0.1885039 0.2541153 0.3154168 0.01767438 0.5806778 0.2772731 0.357151
##     nTrueEmbeddings nForSim
## 114              21     333
## <<<<********>>>>
## [1] "Simulation: 115 rsqsym 0.349145366785674 rsqsgcca 0.127296733404578"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 115 0.3491454 0.1861737 0.1272967 0.01099733 0.1475666 0.488095 0.5905698
##     nTrueEmbeddings nForSim
## 115               7     371
## <<<<********>>>>
## Warning in sgccak(R, C, c1 = c1, scheme = scheme, init = init, bias = bias, :
## The SGCCA algorithm did not converge after 1000 iterations.

## [1] "Simulation: 116 rsqsym 0.608814394672538 rsqsgcca 0.561956930511183"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 116 0.6088144 0.5634997 0.5619569 0.007847332 0.6726812 0.6481071 0.2589203
##     nTrueEmbeddings nForSim
## 116              16     372
## <<<<********>>>>
## [1] "Simulation: 117 rsqsym 0.533463374921264 rsqsgcca 0.509535722094019"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 117 0.5334634 0.5094449 0.5095357 0.008707993 0.1696539 0.5466123 0.5343067
##     nTrueEmbeddings nForSim
## 117              20     366
## <<<<********>>>>
## [1] "Simulation: 118 rsqsym 0.136437078900109 rsqsgcca 0.0132858716526127"
##        symRSQ   rgccaRSQ   sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 118 0.1364371 0.01691603 0.01328587 0.003325421 0.3567169 0.2287202 0.388297
##     nTrueEmbeddings nForSim
## 118               8     186
## <<<<********>>>>
## [1] "Simulation: 119 rsqsym 0.498872962371812 rsqsgcca 0.155943686123964"
##       symRSQ   rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 119 0.498873 0.05070594 0.1559437 0.009420928 0.2709615 0.2207935 0.3327085
##     nTrueEmbeddings nForSim
## 119              25     149
## <<<<********>>>>
## [1] "Simulation: 120 rsqsym 0.471652271034512 rsqsgcca 0.596779951451762"
##        symRSQ  rgccaRSQ sgccaRSQ     prmRSQ corrupt1  corrupt2  corrupt3
## 120 0.4716523 0.3613531  0.59678 0.01224933 0.452771 0.7688931 0.8894699
##     nTrueEmbeddings nForSim
## 120              14     298
## <<<<********>>>>

Look over results, statistically

The r-squared value is most informative as it tells us how well the omnibus model predicts the known latent signal.

Compare SiMLR R\(^2\) vs. rgcca R\(^2\) with paired t-test.

print(t.test(simdatafrm[,"symRSQ"],simdatafrm[,"rgccaRSQ"],paired=T))
## 
##  Paired t-test
## 
## data:  simdatafrm[, "symRSQ"] and simdatafrm[, "rgccaRSQ"]
## t = 11.99, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.1215718 0.1696669
## sample estimates:
## mean of the differences 
##               0.1456193

Compare SiMLR R\(^2\) vs. sgcca R\(^2\) with paired t-test.

print(t.test(simdatafrm[,"symRSQ"],simdatafrm[,"sgccaRSQ"],paired=T))
## 
##  Paired t-test
## 
## data:  simdatafrm[, "symRSQ"] and simdatafrm[, "sgccaRSQ"]
## t = 3.7482, df = 119, p-value = 0.0002763
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.01845184 0.05977948
## sample estimates:
## mean of the differences 
##              0.03911566

Compare SiMLR R\(^2\) vs. permuted SiMLR R\(^2\) with paired t-test.

print(t.test(simdatafrm[,"symRSQ"],simdatafrm[,"prmRSQ"],paired=T))
## 
##  Paired t-test
## 
## data:  simdatafrm[, "symRSQ"] and simdatafrm[, "prmRSQ"]
## t = 36.866, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.4499341 0.5010101
## sample estimates:
## mean of the differences 
##               0.4754721

Compare rgcca R\(^2\) vs. permuted SiMLR R\(^2\) with paired t-test.

print(t.test(simdatafrm[,"sgccaRSQ"],simdatafrm[,"prmRSQ"],paired=T))
## 
##  Paired t-test
## 
## data:  simdatafrm[, "sgccaRSQ"] and simdatafrm[, "prmRSQ"]
## t = 27.762, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.4052342 0.4674786
## sample estimates:
## mean of the differences 
##               0.4363564

mean performance

print( colMeans( simdatafrm ) )
##          symRSQ        rgccaRSQ        sgccaRSQ          prmRSQ        corrupt1 
##      0.49395552      0.34833618      0.45483986      0.01848345      0.47281595 
##        corrupt2        corrupt3 nTrueEmbeddings         nForSim 
##      0.51951530      0.48067451     15.97500000    308.22500000

Visualize overall results

simdatafrm = na.omit( simdatafrm )
myline = 1:nrow( simdatafrm )
plot( myline/max(myline), myline/max(myline), type='l', lty=5, main='Signal recovery comparison (r-squared): \n SiMLR vs RGCCA (blue triangle) and SGCCA (red x)', xlab='R-squared RGCCA and SGCCA', ylab='R-squared SiMLR' )
points( simdatafrm[,"rgccaRSQ"], simdatafrm[,"symRSQ"], col='blue', ylab='Rsq - SiMLR', xlab='Rsq - RGCCA', pch=2 )
points( simdatafrm[,"sgccaRSQ"], simdatafrm[,"symRSQ"], col='red', ylab='Rsq - SiMLR', xlab='Rsq - SGCCA', pch=4 )

Look at the effect of the corruption on the outcomes.

summary( lm( symRSQ ~ corrupt1 + corrupt2 + corrupt3 , data=simdatafrm))
## 
## Call:
## lm(formula = symRSQ ~ corrupt1 + corrupt2 + corrupt3, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.46691 -0.06936  0.01096  0.08721  0.30099 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.34753    0.04517   7.694 5.15e-12 ***
## corrupt1     0.13277    0.05525   2.403   0.0178 *  
## corrupt2     0.13307    0.05121   2.599   0.0106 *  
## corrupt3     0.03020    0.05552   0.544   0.5875    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1304 on 116 degrees of freedom
## Multiple R-squared:  0.09996,    Adjusted R-squared:  0.07669 
## F-statistic: 4.295 on 3 and 116 DF,  p-value: 0.006516
summary( lm( rgccaRSQ ~ corrupt1 + corrupt2 + corrupt3 , data=simdatafrm))
## 
## Call:
## lm(formula = rgccaRSQ ~ corrupt1 + corrupt2 + corrupt3, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.37581 -0.10611 -0.00673  0.13422  0.45979 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.15431    0.05979   2.581   0.0111 *
## corrupt1     0.15602    0.07313   2.134   0.0350 *
## corrupt2     0.11140    0.06778   1.644   0.1030  
## corrupt3     0.12979    0.07349   1.766   0.0800 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1726 on 116 degrees of freedom
## Multiple R-squared:  0.09001,    Adjusted R-squared:  0.06648 
## F-statistic: 3.825 on 3 and 116 DF,  p-value: 0.01179
summary( lm( sgccaRSQ ~ corrupt1 + corrupt2 + corrupt3 , data=simdatafrm))
## 
## Call:
## lm(formula = sgccaRSQ ~ corrupt1 + corrupt2 + corrupt3, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.37958 -0.08963  0.01138  0.09209  0.38645 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.21803    0.05398   4.039 9.68e-05 ***
## corrupt1     0.16918    0.06602   2.562  0.01168 *  
## corrupt2     0.11166    0.06120   1.825  0.07062 .  
## corrupt3     0.20556    0.06635   3.098  0.00244 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1558 on 116 degrees of freedom
## Multiple R-squared:  0.1594, Adjusted R-squared:  0.1376 
## F-statistic: 7.331 on 3 and 116 DF,  p-value: 0.0001525

Look at the effect of the number of subjects for the simulation on the outcomes.

summary( lm( symRSQ ~ nForSim, data=simdatafrm))
## 
## Call:
## lm(formula = symRSQ ~ nForSim, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.39741 -0.07990  0.01570  0.08685  0.31429 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.3812151  0.0495358   7.696 4.72e-12 ***
## nForSim     0.0003658  0.0001558   2.348   0.0206 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1332 on 118 degrees of freedom
## Multiple R-squared:  0.04463,    Adjusted R-squared:  0.03653 
## F-statistic: 5.512 on 1 and 118 DF,  p-value: 0.02055
summary( lm( rgccaRSQ ~ nForSim, data=simdatafrm))
## 
## Call:
## lm(formula = rgccaRSQ ~ nForSim, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.38101 -0.11110 -0.00464  0.14838  0.35957 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept) 0.215177   0.065505   3.285  0.00134 **
## nForSim     0.000432   0.000206   2.097  0.03814 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1761 on 118 degrees of freedom
## Multiple R-squared:  0.03592,    Adjusted R-squared:  0.02775 
## F-statistic: 4.397 on 1 and 118 DF,  p-value: 0.03814
summary( lm( sgccaRSQ ~ nForSim, data=simdatafrm))
## 
## Call:
## lm(formula = sgccaRSQ ~ nForSim, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.42140 -0.10325  0.02626  0.11098  0.30883 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.3362184  0.0616501   5.454 2.75e-07 ***
## nForSim     0.0003849  0.0001939   1.985   0.0495 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1657 on 118 degrees of freedom
## Multiple R-squared:  0.03231,    Adjusted R-squared:  0.02411 
## F-statistic: 3.939 on 1 and 118 DF,  p-value: 0.04949

Look at the effect of the number of bases for the simulation on the outcomes.

summary( lm( symRSQ ~ nTrueEmbeddings, data=simdatafrm))
## 
## Call:
## lm(formula = symRSQ ~ nTrueEmbeddings, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.42434 -0.07025  0.01518  0.09740  0.25064 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.526007   0.036759  14.310   <2e-16 ***
## nTrueEmbeddings -0.002006   0.002166  -0.926    0.356    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1358 on 118 degrees of freedom
## Multiple R-squared:  0.007216,   Adjusted R-squared:  -0.001197 
## F-statistic: 0.8577 on 1 and 118 DF,  p-value: 0.3563
summary( lm( rgccaRSQ ~ nTrueEmbeddings, data=simdatafrm))
## 
## Call:
## lm(formula = rgccaRSQ ~ nTrueEmbeddings, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.35051 -0.13142  0.01237  0.14687  0.35164 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.3603512  0.0485512   7.422 1.95e-11 ***
## nTrueEmbeddings -0.0007521  0.0028613  -0.263    0.793    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1793 on 118 degrees of freedom
## Multiple R-squared:  0.0005852,  Adjusted R-squared:  -0.007884 
## F-statistic: 0.06909 on 1 and 118 DF,  p-value: 0.7931
summary( lm( sgccaRSQ ~ nTrueEmbeddings, data=simdatafrm))
## 
## Call:
## lm(formula = sgccaRSQ ~ nTrueEmbeddings, data = simdatafrm)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.46815 -0.07945  0.03686  0.11551  0.29056 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.508115   0.045323  11.211   <2e-16 ***
## nTrueEmbeddings -0.003335   0.002671  -1.249    0.214    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1674 on 118 degrees of freedom
## Multiple R-squared:  0.01304,    Adjusted R-squared:  0.004674 
## F-statistic: 1.559 on 1 and 118 DF,  p-value: 0.2143

Look at results via histogram

library( rtemis )
myMeth = paste0("SiMLR-mix-",mixingMethod,'-E-',energyType)
# Build dataset with different distributions
mdata <- data.frame(
  method = rep( c(myMeth, "RGCCA", "SGCCA" ),  each = nsims ),
  value = c( simdatafrm[,1], simdatafrm[,2], simdatafrm[,3] )
)
mplot3.x( split( mdata$value, mdata$method )  )

ofn = paste0( '/results/simulation_energy', energyType, "_mix", mixingMethod, '.csv' )
if ( dir.exists( "/results/" ) ) write.csv( simdatafrm, ofn )
library(viridis)
library(ggplot2)
library(dplyr)
library( psych )
opts <- options()  # save old options

options(ggplot2.continuous.colour="viridis")
options(ggplot2.continuous.fill = "viridis")
theme_set(theme_minimal())

myMeth = paste0("SiMLR-mix-",mixingMethod,'-E-',energyType)
# Build dataset with different distributions
mdata <- data.frame(
  method = rep( c(myMeth, "RGCCA", "SGCCA" ),  each = nsims ),
  value = c( simdatafrm[,1], simdatafrm[,2], simdatafrm[,3] )
)
histBy(mdata,"value","method",main='Signal Recovery Results: \n SiMLR (blue) vs rgcca (red) vs sgcca (green)' ,  xlab='RSQ')


viridis_qualitative_pal7 <- c("#440154FF", "#FDE725FF", "#443A83FF",
                              "#8FD744FF", "#31688EFF",  "#35B779FF",
                              "#21908CFF")
p <- mdata %>%
  ggplot( aes(x=value, fill=method, color = method )) +
    geom_density(  alpha=0.6, position = 'identity' ) +
    theme(text = element_text(size = 20 ))   + theme(legend.position="top") + scale_fill_manual( values = c("#440154FF","#FDE725FF", "#21908CFF"))
print( p )