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.202856720935524 rsqsgcca 0.018726097942524"
##      symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 1 0.2028567 0.08271954 0.0187261 0.01437723 0.6097639 0.1657645 0.2102564
##   nTrueEmbeddings nForSim
## 1              18     270
## <<<<********>>>>
## [1] "Simulation: 2 rsqsym 0.575525752182748 rsqsgcca 0.595573100376879"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 2 0.5755258 0.1663712 0.5955731 0.04996832 0.4274195 0.8341307 0.503782
##   nTrueEmbeddings nForSim
## 2               7     248
## <<<<********>>>>
## [1] "Simulation: 3 rsqsym 0.510498864728684 rsqsgcca 0.449030498392422"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 3 0.5104989 0.3909184 0.4490305 0.06680795 0.3815088 0.8738479 0.3846142
##   nTrueEmbeddings nForSim
## 3              23     243
## <<<<********>>>>
## [1] "Simulation: 4 rsqsym 0.359807619453061 rsqsgcca 0.504529295978701"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 4 0.3598076 0.2380919 0.5045293 0.01155261 0.3743984 0.2930968 0.7249775
##   nTrueEmbeddings nForSim
## 4              21     337
## <<<<********>>>>
## [1] "Simulation: 5 rsqsym 0.554356456728195 rsqsgcca 0.553934741260822"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 5 0.5543565 0.4183328 0.5539347 0.002639123 0.4553291 0.5243792 0.7343283
##   nTrueEmbeddings nForSim
## 5              14     253
## <<<<********>>>>
## [1] "Simulation: 6 rsqsym 0.543351442261847 rsqsgcca 0.566153587511158"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 6 0.5433514 0.5761825 0.5661536 0.03951137 0.6356254 0.5923085 0.7961964
##   nTrueEmbeddings nForSim
## 6              20     342
## <<<<********>>>>
## [1] "Simulation: 7 rsqsym 0.568273357324806 rsqsgcca 0.655560290093703"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2 corrupt3
## 7 0.5682734 0.5894104 0.6555603 4.089757e-07 0.5721252 0.4228447  0.64963
##   nTrueEmbeddings nForSim
## 7              20     503
## <<<<********>>>>
## [1] "Simulation: 8 rsqsym 0.648204055466001 rsqsgcca 0.641991566398773"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ corrupt1  corrupt2  corrupt3
## 8 0.6482041 0.5973998 0.6419916 0.02776197 0.850412 0.5317252 0.3854239
##   nTrueEmbeddings nForSim
## 8              16     313
## <<<<********>>>>
## [1] "Simulation: 9 rsqsym 0.647349551325274 rsqsgcca 0.709779240852967"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 9 0.6473496 0.5016047 0.7097792 0.007461439 0.2962562 0.5647676 0.3991453
##   nTrueEmbeddings nForSim
## 9               6     259
## <<<<********>>>>
## [1] "Simulation: 10 rsqsym 0.69144463443665 rsqsgcca 0.647042973433406"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 10 0.6914446 0.6591293 0.647043 0.001320208 0.8285033 0.1398677 0.2981007
##    nTrueEmbeddings nForSim
## 10               5     321
## <<<<********>>>>
## [1] "Simulation: 11 rsqsym 0.635899873833549 rsqsgcca 0.487634845631952"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 11 0.6358999 0.463435 0.4876348 0.003318125 0.2858025 0.4138801 0.465193
##    nTrueEmbeddings nForSim
## 11               6     273
## <<<<********>>>>
## [1] "Simulation: 12 rsqsym 0.395343407365176 rsqsgcca 0.556552317212778"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1 corrupt2 corrupt3
## 12 0.3953434 0.4937726 0.5565523 0.0010043 0.6473258 0.397628 0.646168
##    nTrueEmbeddings nForSim
## 12              15     202
## <<<<********>>>>
## [1] "Simulation: 13 rsqsym 0.452262816888679 rsqsgcca 0.187849234612155"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 13 0.4522628 0.08321715 0.1878492 0.02104285 0.6888443 0.1847571 0.2689542
##    nTrueEmbeddings nForSim
## 13              24     364
## <<<<********>>>>
## [1] "Simulation: 14 rsqsym 0.542463499126587 rsqsgcca 0.547674808826771"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 14 0.5424635 0.4086983 0.5476748 0.0004746701 0.6714665 0.8571574 0.6680247
##    nTrueEmbeddings nForSim
## 14               9     267
## <<<<********>>>>
## [1] "Simulation: 15 rsqsym 0.531842994983515 rsqsgcca 0.633558410137305"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 15 0.531843 0.5900965 0.6335584 0.006772317 0.2550545 0.8027444 0.2884029
##    nTrueEmbeddings nForSim
## 15              23     341
## <<<<********>>>>
## [1] "Simulation: 16 rsqsym 0.439368750636714 rsqsgcca 0.378181848044538"
##       symRSQ rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 16 0.4393688 0.300542 0.3781818 0.01488231 0.8224056 0.2788775 0.3789082
##    nTrueEmbeddings nForSim
## 16              20     358
## <<<<********>>>>
## [1] "Simulation: 17 rsqsym 0.505979023297046 rsqsgcca 0.325216816997708"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 17 0.505979 0.2446114 0.3252168 0.01695063 0.3827463 0.1016975 0.498994
##    nTrueEmbeddings nForSim
## 17              16     239
## <<<<********>>>>
## [1] "Simulation: 18 rsqsym 0.448821138556339 rsqsgcca 0.487545156122575"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 18 0.4488211 0.4760749 0.4875452 0.001080676 0.5939755 0.8541631 0.8179487
##    nTrueEmbeddings nForSim
## 18              21     394
## <<<<********>>>>
## [1] "Simulation: 19 rsqsym 0.629652155658994 rsqsgcca 0.610320351851101"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 19 0.6296522 0.5842467 0.6103204 0.02569567 0.5315619 0.8480022 0.8151635
##    nTrueEmbeddings nForSim
## 19              15     225
## <<<<********>>>>
## [1] "Simulation: 20 rsqsym 0.589364031474132 rsqsgcca 0.631717335166447"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 20 0.589364 0.5748232 0.6317173 0.002688741 0.894567 0.3830734 0.7762652
##    nTrueEmbeddings nForSim
## 20              20     413
## <<<<********>>>>
## [1] "Simulation: 21 rsqsym 0.481744511326206 rsqsgcca 0.424489898976203"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 21 0.4817445 0.4008263 0.4244899 0.0004808662 0.5307914 0.6875179 0.4006813
##    nTrueEmbeddings nForSim
## 21              12     383
## <<<<********>>>>
## [1] "Simulation: 22 rsqsym 0.467783620434676 rsqsgcca 0.494342717311942"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 22 0.4677836 0.5103097 0.4943427 0.0337345 0.8267991 0.8716003 0.1569747
##    nTrueEmbeddings nForSim
## 22              21     279
## <<<<********>>>>
## [1] "Simulation: 23 rsqsym 0.436913198343056 rsqsgcca 0.393342607460417"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 23 0.4369132 0.4023419 0.3933426 0.01039347 0.1604842 0.6603718 0.6257906
##    nTrueEmbeddings nForSim
## 23              18     335
## <<<<********>>>>
## [1] "Simulation: 24 rsqsym 0.554522752677056 rsqsgcca 0.540257822588242"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 24 0.5545228 0.5114599 0.5402578 0.04053957 0.1296695 0.1695853 0.1227204
##    nTrueEmbeddings nForSim
## 24              25     276
## <<<<********>>>>
## [1] "Simulation: 25 rsqsym 0.409693621879637 rsqsgcca 0.380594555044674"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 25 0.4096936 0.2873388 0.3805946 0.006115338 0.8768807 0.6860525 0.1169671
##    nTrueEmbeddings nForSim
## 25               6     303
## <<<<********>>>>
## [1] "Simulation: 26 rsqsym 0.417833234579801 rsqsgcca 0.192686681356382"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 26 0.4178332 0.2956608 0.1926867 0.001731067 0.6882603 0.6693866 0.2517785
##    nTrueEmbeddings nForSim
## 26              19     150
## <<<<********>>>>
## [1] "Simulation: 27 rsqsym 0.474148500570386 rsqsgcca 0.446730557125625"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 27 0.4741485 0.3633363 0.4467306 0.0003835995 0.6904371 0.3571471 0.5333443
##    nTrueEmbeddings nForSim
## 27              19     473
## <<<<********>>>>
## [1] "Simulation: 28 rsqsym 0.62370347552732 rsqsgcca 0.694456226136815"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ corrupt1  corrupt2 corrupt3
## 28 0.6237035 0.6131814 0.6944562 0.03162872 0.620296 0.8436519 0.458144
##    nTrueEmbeddings nForSim
## 28               6     168
## <<<<********>>>>
## [1] "Simulation: 29 rsqsym 0.636009105803206 rsqsgcca 0.687258593145159"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 29 0.6360091 0.5377198 0.6872586 0.06222598 0.5194642 0.8266058 0.6277783
##    nTrueEmbeddings nForSim
## 29              11     217
## <<<<********>>>>
## [1] "Simulation: 30 rsqsym 0.54768435213864 rsqsgcca 0.361962147639716"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 30 0.5476844 0.2458016 0.3619621 0.05350086 0.3032608 0.7383811 0.5852181
##    nTrueEmbeddings nForSim
## 30              20     217
## <<<<********>>>>
## [1] "Simulation: 31 rsqsym 0.465656920222987 rsqsgcca 0.526921066150372"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 31 0.4656569 0.4618586 0.5269211 0.006254274 0.7282429 0.2031838 0.4044328
##    nTrueEmbeddings nForSim
## 31              18     324
## <<<<********>>>>
## [1] "Simulation: 32 rsqsym 0.418908109615615 rsqsgcca 0.524980373796632"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 32 0.4189081 0.3883998 0.5249804 8.5009e-05 0.3501221 0.5624648 0.4493418
##    nTrueEmbeddings nForSim
## 32               8     321
## <<<<********>>>>
## [1] "Simulation: 33 rsqsym 0.251999335077914 rsqsgcca 0.268563043104229"
##       symRSQ   rgccaRSQ sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 33 0.2519993 0.08773133 0.268563 1.382864e-05 0.436592 0.1385706 0.3680125
##    nTrueEmbeddings nForSim
## 33              22     309
## <<<<********>>>>
## [1] "Simulation: 34 rsqsym 0.334529570450818 rsqsgcca 0.392154570116717"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 34 0.3345296 0.2082791 0.3921546 0.04103443 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.696461566826266 rsqsgcca 0.692674333583416"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 35 0.6964616 0.4506672 0.6926743 0.0005701815 0.5851936 0.3427513 0.5000881
##    nTrueEmbeddings nForSim
## 35               7     405
## <<<<********>>>>
## [1] "Simulation: 36 rsqsym 0.586154512307116 rsqsgcca 0.349633394596894"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 36 0.5861545 0.405382 0.3496334 0.001031353 0.2522588 0.7206225 0.8813692
##    nTrueEmbeddings nForSim
## 36              24     345
## <<<<********>>>>
## [1] "Simulation: 37 rsqsym 0.500895107968697 rsqsgcca 0.34229890230554"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 37 0.5008951 0.1316114 0.3422989 0.02355264 0.4398332 0.4602104 0.250888
##    nTrueEmbeddings nForSim
## 37               7     330
## <<<<********>>>>
## [1] "Simulation: 38 rsqsym 0.0870134877821341 rsqsgcca 0.118994380725365"
##        symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 38 0.08701349 0.01403716 0.1189944 0.03046258 0.1679595 0.7741895 0.2491769
##    nTrueEmbeddings nForSim
## 38              25     300
## <<<<********>>>>
## [1] "Simulation: 39 rsqsym 0.608686398109982 rsqsgcca 0.454043440551608"
##       symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 39 0.6086864 0.337834 0.4540434 0.0004240518 0.2791145 0.640759 0.8329312
##    nTrueEmbeddings nForSim
## 39              25     305
## <<<<********>>>>
## [1] "Simulation: 40 rsqsym 0.482688700650622 rsqsgcca 0.36697276127582"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 40 0.4826887 0.2389479 0.3669728 0.005312991 0.1590437 0.833552 0.4547524
##    nTrueEmbeddings nForSim
## 40              24     358
## <<<<********>>>>
## [1] "Simulation: 41 rsqsym 0.51199622995669 rsqsgcca 0.503186954954368"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 41 0.5119962 0.3828291 0.503187 0.008403915 0.4847883 0.291713 0.8222376
##    nTrueEmbeddings nForSim
## 41              20     256
## <<<<********>>>>
## [1] "Simulation: 42 rsqsym 0.556410135042568 rsqsgcca 0.511858027221582"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 42 0.5564101 0.3585077 0.511858 0.02191264 0.3012763 0.627033 0.3951814
##    nTrueEmbeddings nForSim
## 42              20     430
## <<<<********>>>>
## [1] "Simulation: 43 rsqsym 0.65792937498457 rsqsgcca 0.574131284356983"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 43 0.6579294 0.5780918 0.5741313 5.521392e-05 0.7214112 0.8823007 0.3360352
##    nTrueEmbeddings nForSim
## 43              17     317
## <<<<********>>>>
## [1] "Simulation: 44 rsqsym 0.633708318629736 rsqsgcca 0.584978389409612"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 44 0.6337083 0.4620259 0.5849784 0.0009523041 0.6155342 0.8495107 0.1289159
##    nTrueEmbeddings nForSim
## 44               9     372
## <<<<********>>>>
## [1] "Simulation: 45 rsqsym 0.61313402515677 rsqsgcca 0.588719287021426"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2 corrupt3
## 45 0.613134 0.5227885 0.5887193 0.007486326 0.1410228 0.289673 0.356922
##    nTrueEmbeddings nForSim
## 45              12     347
## <<<<********>>>>
## [1] "Simulation: 46 rsqsym 0.351405565235849 rsqsgcca 0.422803589835628"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 46 0.3514056 0.2128069 0.4228036 0.000707703 0.3769051 0.5152114 0.2799855
##    nTrueEmbeddings nForSim
## 46              19     248
## <<<<********>>>>
## [1] "Simulation: 47 rsqsym 0.428165807612968 rsqsgcca 0.517948539126346"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 47 0.4281658 0.5015011 0.5179485 0.04041243 0.8738161 0.1229469  0.30533
##    nTrueEmbeddings nForSim
## 47              12     480
## <<<<********>>>>
## [1] "Simulation: 48 rsqsym 0.535343053258258 rsqsgcca 0.562433880394532"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1 corrupt2  corrupt3
## 48 0.5353431 0.5915697 0.5624339 0.002735931 0.471881 0.522434 0.8014456
##    nTrueEmbeddings nForSim
## 48              19     336
## <<<<********>>>>
## [1] "Simulation: 49 rsqsym 0.725596711813013 rsqsgcca 0.704244400642284"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 49 0.7255967 0.6370647 0.7042444 0.01075836 0.6656333 0.6198922 0.866629
##    nTrueEmbeddings nForSim
## 49              13     293
## <<<<********>>>>
## [1] "Simulation: 50 rsqsym 0.587834137342566 rsqsgcca 0.56595396091291"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 50 0.5878341 0.3452818 0.565954 0.01046475 0.4344102 0.6799204 0.4099741
##    nTrueEmbeddings nForSim
## 50              16     364
## <<<<********>>>>
## [1] "Simulation: 51 rsqsym 0.508581689984302 rsqsgcca 0.475377230043224"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2 corrupt3
## 51 0.5085817 0.3566666 0.4753772 9.912991e-05 0.3476936 0.8587498 0.486094
##    nTrueEmbeddings nForSim
## 51              18     381
## <<<<********>>>>
## [1] "Simulation: 52 rsqsym 0.438369462954532 rsqsgcca 0.136185908409598"
##       symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 52 0.4383695 0.06545324 0.1361859 0.0002085117 0.1569439 0.2231528 0.1094279
##    nTrueEmbeddings nForSim
## 52              18     241
## <<<<********>>>>
## [1] "Simulation: 53 rsqsym 0.392503100692882 rsqsgcca 0.36556762450566"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 53 0.3925031 0.3179103 0.3655676 0.007368847 0.4425242 0.1883126 0.5680132
##    nTrueEmbeddings nForSim
## 53              17     336
## <<<<********>>>>
## [1] "Simulation: 54 rsqsym 0.553761033666771 rsqsgcca 0.312845185739914"
##      symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 54 0.553761 0.07820099 0.3128452 0.0001934515 0.8272887 0.4393381 0.2237687
##    nTrueEmbeddings nForSim
## 54              15     471
## <<<<********>>>>
## [1] "Simulation: 55 rsqsym 0.410488174405146 rsqsgcca 0.338546044894568"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 55 0.4104882 0.1876889 0.338546 0.002430318 0.2681519 0.3353227 0.4164188
##    nTrueEmbeddings nForSim
## 55              12     330
## <<<<********>>>>
## [1] "Simulation: 56 rsqsym 0.522743544262301 rsqsgcca 0.561318650609173"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 56 0.5227435 0.5374709 0.5613187 0.01373336 0.2937456 0.8149369 0.8739436
##    nTrueEmbeddings nForSim
## 56              12     301
## <<<<********>>>>
## [1] "Simulation: 57 rsqsym 0.577820764193399 rsqsgcca 0.540933641683108"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 57 0.5778208 0.4067728 0.5409336 0.003914938 0.1002266 0.4612999 0.2636267
##    nTrueEmbeddings nForSim
## 57               7     264
## <<<<********>>>>
## [1] "Simulation: 58 rsqsym 0.492289391023667 rsqsgcca 0.433578117219692"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 58 0.4922894 0.3645029 0.4335781 0.0001359366 0.7507904 0.3868264 0.6326859
##    nTrueEmbeddings nForSim
## 58              17     284
## <<<<********>>>>
## [1] "Simulation: 59 rsqsym 0.611949746795321 rsqsgcca 0.45002137921813"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 59 0.6119497 0.2612097 0.4500214 0.02538561 0.5269512 0.8585265 0.2362692
##    nTrueEmbeddings nForSim
## 59               5     171
## <<<<********>>>>
## [1] "Simulation: 60 rsqsym 0.241047524720244 rsqsgcca 0.154954811568022"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 60 0.2410475 0.06798344 0.1549548 0.02107654 0.1368409 0.4308373 0.1536706
##    nTrueEmbeddings nForSim
## 60               5     378
## <<<<********>>>>
## [1] "Simulation: 61 rsqsym 0.518071641251794 rsqsgcca 0.478090567151587"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 61 0.5180716 0.3877688 0.4780906 0.0003069895 0.7889965 0.2945368 0.5370012
##    nTrueEmbeddings nForSim
## 61              20     290
## <<<<********>>>>
## [1] "Simulation: 62 rsqsym 0.557764321435361 rsqsgcca 0.10709024086297"
##       symRSQ     rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 62 0.5577643 5.971027e-05 0.1070902 0.00227918 0.2928243 0.8788607 0.1882851
##    nTrueEmbeddings nForSim
## 62              13     384
## <<<<********>>>>
## [1] "Simulation: 63 rsqsym 0.648632041269752 rsqsgcca 0.72597409027156"
##      symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 63 0.648632 0.631906 0.7259741 0.0003751725 0.7306326 0.4942561 0.4960944
##    nTrueEmbeddings nForSim
## 63              21     426
## <<<<********>>>>
## [1] "Simulation: 64 rsqsym 0.261629099150799 rsqsgcca 0.0510543583554501"
##       symRSQ  rgccaRSQ   sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 64 0.2616291 0.1212347 0.05105436 0.1689841 0.3259776 0.2503945 0.4200655
##    nTrueEmbeddings nForSim
## 64              21     183
## <<<<********>>>>
## [1] "Simulation: 65 rsqsym 0.33514630699484 rsqsgcca 0.391080548520454"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 65 0.3351463 0.1598126 0.3910805 0.02243095 0.8581586 0.3279982 0.4257686
##    nTrueEmbeddings nForSim
## 65              16     224
## <<<<********>>>>
## [1] "Simulation: 66 rsqsym 0.452828433636637 rsqsgcca 0.400317684596816"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 66 0.4528284 0.2112562 0.4003177 0.01879933 0.4530189 0.640667 0.4527265
##    nTrueEmbeddings nForSim
## 66              17     506
## <<<<********>>>>
## [1] "Simulation: 67 rsqsym 0.499855707430381 rsqsgcca 0.543582395303469"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 67 0.4998557 0.3941403 0.5435824 4.119169e-06 0.1862677 0.5875123 0.4180602
##    nTrueEmbeddings nForSim
## 67              24     418
## <<<<********>>>>
## [1] "Simulation: 68 rsqsym 0.520717639253581 rsqsgcca 0.393353301220279"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 68 0.5207176 0.4409409 0.3933533 0.01812426 0.4696518 0.2779817 0.2467748
##    nTrueEmbeddings nForSim
## 68              19     435
## <<<<********>>>>
## [1] "Simulation: 69 rsqsym 0.512832801721864 rsqsgcca 0.428005383535426"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 69 0.5128328 0.3811938 0.4280054 0.007619002 0.1099845 0.5348248 0.5275168
##    nTrueEmbeddings nForSim
## 69               8     326
## <<<<********>>>>
## [1] "Simulation: 70 rsqsym 0.434879113070005 rsqsgcca 0.52241607460703"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 70 0.4348791 0.2601868 0.5224161 0.06328212 0.6776801 0.647109 0.8815156
##    nTrueEmbeddings nForSim
## 70              17     197
## <<<<********>>>>
## [1] "Simulation: 71 rsqsym 0.713879019022198 rsqsgcca 0.682346119437703"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 71 0.713879 0.6673374 0.6823461 0.01726109 0.3003894 0.2379569 0.2127435
##    nTrueEmbeddings nForSim
## 71              25     285
## <<<<********>>>>
## [1] "Simulation: 72 rsqsym 0.464818367936637 rsqsgcca 0.330786782282328"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 72 0.4648184 0.0443791 0.3307868 0.004171204 0.3011837 0.4871177 0.6970519
##    nTrueEmbeddings nForSim
## 72              15     430
## <<<<********>>>>
## [1] "Simulation: 73 rsqsym 0.556099477533113 rsqsgcca 0.534509309466627"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 73 0.5560995 0.2497581 0.5345093 0.003254804 0.8569064 0.3947365 0.4396441
##    nTrueEmbeddings nForSim
## 73               8     308
## <<<<********>>>>
## [1] "Simulation: 74 rsqsym 0.468897181246393 rsqsgcca 0.384064993077656"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 74 0.4688972 0.2561163 0.384065 0.01297155 0.6702812 0.2161957 0.5101028
##    nTrueEmbeddings nForSim
## 74              20     363
## <<<<********>>>>
## [1] "Simulation: 75 rsqsym 0.47657560341125 rsqsgcca 0.512149963257713"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 75 0.4765756 0.4724307  0.51215 0.003208978 0.7490435 0.7985777 0.1631237
##    nTrueEmbeddings nForSim
## 75              19     257
## <<<<********>>>>
## [1] "Simulation: 76 rsqsym 0.484740753966208 rsqsgcca 0.581772650422497"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 76 0.4847408 0.3706199 0.5817727 0.001486698 0.6437605 0.4883076 0.4903955
##    nTrueEmbeddings nForSim
## 76              18     345
## <<<<********>>>>
## [1] "Simulation: 77 rsqsym 0.274660577979467 rsqsgcca 0.0886396795793668"
##       symRSQ   rgccaRSQ   sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 77 0.2746606 0.04884299 0.08863968 0.02827622 0.4233497 0.5933021 0.1258496
##    nTrueEmbeddings nForSim
## 77               8     276
## <<<<********>>>>
## [1] "Simulation: 78 rsqsym 0.337247729840773 rsqsgcca 0.240153541495727"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 78 0.3372477 0.1660221 0.2401535 0.0006594788 0.1547818 0.1775583 0.4993309
##    nTrueEmbeddings nForSim
## 78              13     377
## <<<<********>>>>
## [1] "Simulation: 79 rsqsym 0.534902291583144 rsqsgcca 0.531540284135714"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 79 0.5349023 0.3364088 0.5315403 0.0002734066 0.5654484 0.5645001 0.7428239
##    nTrueEmbeddings nForSim
## 79              12     409
## <<<<********>>>>
## [1] "Simulation: 80 rsqsym 0.469426476485691 rsqsgcca 0.259295257499687"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 80 0.4694265 0.0290133 0.2592953 0.003683866 0.4462618 0.7851674 0.2694984
##    nTrueEmbeddings nForSim
## 80              15     308
## <<<<********>>>>
## [1] "Simulation: 81 rsqsym 0.602546413922538 rsqsgcca 0.6270887366707"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 81 0.6025464 0.5587883 0.6270887 0.01644433 0.2400547 0.3223464 0.2583558
##    nTrueEmbeddings nForSim
## 81              14     237
## <<<<********>>>>
## [1] "Simulation: 82 rsqsym 0.465727554022581 rsqsgcca 0.281301104245019"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 82 0.4657276 0.2911373 0.2813011 0.003478853 0.2712748 0.7504076 0.3170967
##    nTrueEmbeddings nForSim
## 82              13     222
## <<<<********>>>>
## [1] "Simulation: 83 rsqsym 0.267359586921645 rsqsgcca 0.27749133701365"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 83 0.2673596 0.2636826 0.2774913 0.02320815 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.579423688488084 rsqsgcca 0.562166202930219"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 84 0.5794237 0.5869723 0.5621662 0.008638274 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.44064389897939 rsqsgcca 0.441601070309138"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 85 0.4406439 0.2444986 0.4416011 0.0009420033 0.609813 0.1514781 0.6292061
##    nTrueEmbeddings nForSim
## 85              12     319
## <<<<********>>>>
## [1] "Simulation: 86 rsqsym 0.582115318301818 rsqsgcca 0.503980519434783"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 86 0.5821153 0.4446583 0.5039805 0.01902831 0.3358441 0.3240853 0.8426786
##    nTrueEmbeddings nForSim
## 86              24     377
## <<<<********>>>>
## [1] "Simulation: 87 rsqsym 0.358174020368868 rsqsgcca 0.237756026328088"
##      symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 87 0.358174 0.1965243 0.237756 0.02127478 0.4697052 0.4237337 0.2751579
##    nTrueEmbeddings nForSim
## 87              17     149
## <<<<********>>>>
## [1] "Simulation: 88 rsqsym 0.681483686714053 rsqsgcca 0.719837366483992"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 88 0.6814837 0.7052217 0.7198374 0.007010515 0.1529857 0.2631594 0.2922959
##    nTrueEmbeddings nForSim
## 88               9     302
## <<<<********>>>>
## [1] "Simulation: 89 rsqsym 0.632347242931029 rsqsgcca 0.723562265811417"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 89 0.6323472 0.2954773 0.7235623 0.01481974 0.6562259 0.1322438 0.6857676
##    nTrueEmbeddings nForSim
## 89               7     204
## <<<<********>>>>
## [1] "Simulation: 90 rsqsym 0.614529944164972 rsqsgcca 0.592271123229641"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 90 0.6145299 0.4240334 0.5922711 0.04900129 0.6310118 0.6484033 0.6847723
##    nTrueEmbeddings nForSim
## 90              15     326
## <<<<********>>>>
## [1] "Simulation: 91 rsqsym 0.481029162474233 rsqsgcca 0.47162886101363"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 91 0.4810292 0.3279079 0.4716289 0.003818642 0.1137693 0.8786272 0.5353798
##    nTrueEmbeddings nForSim
## 91              22     324
## <<<<********>>>>
## [1] "Simulation: 92 rsqsym 0.457007232072974 rsqsgcca 0.476281754919686"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 92 0.4570072 0.06712833 0.4762818 0.00131653 0.5576644 0.3941734 0.5302135
##    nTrueEmbeddings nForSim
## 92              25     202
## <<<<********>>>>
## [1] "Simulation: 93 rsqsym 0.276010337516033 rsqsgcca 0.433679248222673"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 93 0.2760103 0.2630624 0.4336792 0.03900894 0.3560441 0.226927 0.5352436
##    nTrueEmbeddings nForSim
## 93              13     294
## <<<<********>>>>
## [1] "Simulation: 94 rsqsym 0.624916032476443 rsqsgcca 0.668982247356921"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 94 0.624916 0.5782863 0.6689822 0.004602964 0.5291184 0.7492544 0.5367249
##    nTrueEmbeddings nForSim
## 94              17     412
## <<<<********>>>>
## [1] "Simulation: 95 rsqsym 0.44396584676084 rsqsgcca 0.436839440780205"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 95 0.4439658 0.2711107 0.4368394 8.94108e-06 0.1295026 0.7203477 0.4332235
##    nTrueEmbeddings nForSim
## 95              10     238
## <<<<********>>>>
## [1] "Simulation: 96 rsqsym 0.43938447159489 rsqsgcca 0.398062109699398"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 96 0.4393845 0.2148298 0.3980621 0.01016323 0.3888925 0.2550032 0.2558169
##    nTrueEmbeddings nForSim
## 96              11     326
## <<<<********>>>>
## [1] "Simulation: 97 rsqsym 0.368261099338391 rsqsgcca 0.301835992177041"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 97 0.3682611 0.2737499 0.301836 0.01133582 0.2608804 0.2873599 0.7119718
##    nTrueEmbeddings nForSim
## 97              13     181
## <<<<********>>>>
## [1] "Simulation: 98 rsqsym 0.560438879103046 rsqsgcca 0.566754553822022"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 98 0.5604389 0.4599721 0.5667546 0.01012596 0.4428944 0.2541065 0.3347575
##    nTrueEmbeddings nForSim
## 98              10     313
## <<<<********>>>>
## [1] "Simulation: 99 rsqsym 0.706405169485256 rsqsgcca 0.494021558546621"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 99 0.7064052 0.5275812 0.4940216 0.05421854 0.5520611 0.6440624 0.1254326
##    nTrueEmbeddings nForSim
## 99              10     337
## <<<<********>>>>
## [1] "Simulation: 100 rsqsym 0.609575699254108 rsqsgcca 0.393888924231565"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 100 0.6095757 0.2019161 0.3938889 0.00292468 0.5527685 0.856266 0.3965549
##     nTrueEmbeddings nForSim
## 100              23     280
## <<<<********>>>>
## [1] "Simulation: 101 rsqsym 0.630187817439025 rsqsgcca 0.548861671617379"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 101 0.6301878 0.4970487 0.5488617 0.02163316 0.4105611 0.8063324 0.6630487
##     nTrueEmbeddings nForSim
## 101              25     294
## <<<<********>>>>
## [1] "Simulation: 102 rsqsym 0.554808525578762 rsqsgcca 0.639175816961478"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 102 0.5548085 0.6054637 0.6391758 0.004152944 0.8525122 0.6505218 0.8316572
##     nTrueEmbeddings nForSim
## 102              15     334
## <<<<********>>>>
## [1] "Simulation: 103 rsqsym 0.592739075146689 rsqsgcca 0.554842218037964"
##        symRSQ rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 103 0.5927391 0.425402 0.5548422 0.05760645 0.5954883 0.6062012 0.8316034
##     nTrueEmbeddings nForSim
## 103              20     257
## <<<<********>>>>
## [1] "Simulation: 104 rsqsym 0.315541504880694 rsqsgcca 0.395347060438571"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 104 0.3155415 0.2594474 0.3953471 0.002916099 0.4997567 0.4452579 0.4073715
##     nTrueEmbeddings nForSim
## 104              24     292
## <<<<********>>>>
## [1] "Simulation: 105 rsqsym 0.523541079917334 rsqsgcca 0.501156946708329"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 105 0.5235411 0.2121226 0.5011569 0.02681065 0.5225104 0.3544439 0.8036832
##     nTrueEmbeddings nForSim
## 105              14     217
## <<<<********>>>>
## [1] "Simulation: 106 rsqsym 0.415254757564255 rsqsgcca 0.454916790089812"
##        symRSQ rgccaRSQ  sgccaRSQ      prmRSQ corrupt1 corrupt2  corrupt3
## 106 0.4152548 0.213753 0.4549168 0.002384616 0.822649  0.43779 0.8917009
##     nTrueEmbeddings nForSim
## 106              21     245
## <<<<********>>>>
## [1] "Simulation: 107 rsqsym 0.43444048653616 rsqsgcca 0.613984947392843"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 107 0.4344405 0.3700447 0.6139849 0.01098696 0.2662422     0.85 0.6465484
##     nTrueEmbeddings nForSim
## 107               7     321
## <<<<********>>>>
## [1] "Simulation: 108 rsqsym 0.647637524135569 rsqsgcca 0.725311962828203"
##        symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 108 0.6476375 0.6252097 0.725312 0.003876096 0.5178112 0.7085239 0.686261
##     nTrueEmbeddings nForSim
## 108              22     311
## <<<<********>>>>
## [1] "Simulation: 109 rsqsym 0.171822870681969 rsqsgcca 0.135051397560783"
##        symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 109 0.1718229 0.01966475 0.1350514 0.01571631 0.4445034 0.7832479 0.6515661
##     nTrueEmbeddings nForSim
## 109              19     163
## <<<<********>>>>
## [1] "Simulation: 110 rsqsym 0.411885246266706 rsqsgcca 0.288982317370882"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 110 0.4118852 0.1305512 0.2889823 0.0001468147 0.635658 0.5320764 0.4454202
##     nTrueEmbeddings nForSim
## 110              24     343
## <<<<********>>>>
## [1] "Simulation: 111 rsqsym 0.34924913486609 rsqsgcca 0.378644405525776"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1 corrupt2  corrupt3
## 111 0.3492491 0.2684032 0.3786444 0.004289429 0.284206 0.150226 0.5085848
##     nTrueEmbeddings nForSim
## 111              15     339
## <<<<********>>>>
## [1] "Simulation: 112 rsqsym 0.634579807399846 rsqsgcca 0.626592559497463"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 112 0.6345798 0.5214905 0.6265926 0.000298673 0.5591724 0.6889736 0.6090539
##     nTrueEmbeddings nForSim
## 112              22     295
## <<<<********>>>>
## [1] "Simulation: 113 rsqsym 0.354559261029595 rsqsgcca 0.494927911559694"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 113 0.3545593 0.3148347 0.4949279 0.0007430371 0.1964909 0.5260146 0.4824141
##     nTrueEmbeddings nForSim
## 113              15     331
## <<<<********>>>>
## [1] "Simulation: 114 rsqsym 0.237900155827878 rsqsgcca 0.315416751242309"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 114 0.2379002 0.2541153 0.3154168 0.02674227 0.5806778 0.2772731 0.357151
##     nTrueEmbeddings nForSim
## 114              21     333
## <<<<********>>>>
## [1] "Simulation: 115 rsqsym 0.444482191722554 rsqsgcca 0.127296733404578"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 115 0.4444822 0.1861737 0.1272967 0.01287703 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.618043030090702 rsqsgcca 0.561956930511183"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 116 0.618043 0.5634997 0.5619569 0.03228521 0.6726812 0.6481071 0.2589203
##     nTrueEmbeddings nForSim
## 116              16     372
## <<<<********>>>>
## [1] "Simulation: 117 rsqsym 0.495225633879678 rsqsgcca 0.509535722094019"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 117 0.4952256 0.5094449 0.5095357 0.02280156 0.1696539 0.5466123 0.5343067
##     nTrueEmbeddings nForSim
## 117              20     366
## <<<<********>>>>
## [1] "Simulation: 118 rsqsym 0.0812364978925622 rsqsgcca 0.0132858716526127"
##        symRSQ   rgccaRSQ   sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 118 0.0812365 0.01691603 0.01328587 0.05652837 0.3567169 0.2287202 0.388297
##     nTrueEmbeddings nForSim
## 118               8     186
## <<<<********>>>>
## [1] "Simulation: 119 rsqsym 0.530636657395345 rsqsgcca 0.155943686123964"
##        symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 119 0.5306367 0.05070594 0.1559437 0.0001830088 0.2709615 0.2207935 0.3327085
##     nTrueEmbeddings nForSim
## 119              25     149
## <<<<********>>>>
## [1] "Simulation: 120 rsqsym 0.476280990862383 rsqsgcca 0.596779951451762"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 120 0.476281 0.3613531  0.59678 0.002363752 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 = 12.008, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.1192900 0.1664006
## sample estimates:
## mean of the differences 
##               0.1428453

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.5184, df = 119, p-value = 0.0006158
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.01588906 0.05679416
## sample estimates:
## mean of the differences 
##              0.03634161

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 = 38.655, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.4515725 0.5003340
## sample estimates:
## mean of the differences 
##               0.4759532

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.9, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.4084121 0.4708111
## sample estimates:
## mean of the differences 
##               0.4396116

mean performance

print( colMeans( simdatafrm ) )
##          symRSQ        rgccaRSQ        sgccaRSQ          prmRSQ        corrupt1 
##      0.49118147      0.34833618      0.45483986      0.01522823      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.39243 -0.06824 -0.00355  0.08362  0.28520 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.36171    0.04371   8.275 2.47e-13 ***
## corrupt1     0.09597    0.05346   1.795   0.0752 .  
## corrupt2     0.11493    0.04955   2.319   0.0221 *  
## corrupt3     0.05074    0.05373   0.944   0.3469    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1262 on 116 degrees of freedom
## Multiple R-squared:  0.0791, Adjusted R-squared:  0.05528 
## F-statistic: 3.321 on 3 and 116 DF,  p-value: 0.0223
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.40165 -0.06715  0.00206  0.09119  0.23908 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.3968428  0.0476503   8.328 1.69e-13 ***
## nForSim     0.0003061  0.0001499   2.042   0.0434 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1281 on 118 degrees of freedom
## Multiple R-squared:  0.03414,    Adjusted R-squared:  0.02595 
## F-statistic: 4.171 on 1 and 118 DF,  p-value: 0.04335
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.43070 -0.06493  0.01469  0.09909  0.24618 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.532748   0.035060  15.195   <2e-16 ***
## nTrueEmbeddings -0.002602   0.002066  -1.259     0.21    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1295 on 118 degrees of freedom
## Multiple R-squared:  0.01326,    Adjusted R-squared:  0.004899 
## F-statistic: 1.586 on 1 and 118 DF,  p-value: 0.2104
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 )