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.19499041603474 rsqsgcca 0.018726097942524"
##      symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 1 0.1949904 0.08271954 0.0187261 0.0008009392 0.6097639 0.1657645 0.2102564
##   nTrueEmbeddings nForSim
## 1              18     270
## <<<<********>>>>
## [1] "Simulation: 2 rsqsym 0.681655255059649 rsqsgcca 0.595573100376879"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 2 0.6816553 0.1663712 0.5955731 0.08348015 0.4274195 0.8341307 0.503782
##   nTrueEmbeddings nForSim
## 2               7     248
## <<<<********>>>>
## [1] "Simulation: 3 rsqsym 0.644565500206674 rsqsgcca 0.449030498392422"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 3 0.6445655 0.3909184 0.4490305 0.02075885 0.3815088 0.8738479 0.3846142
##   nTrueEmbeddings nForSim
## 3              23     243
## <<<<********>>>>
## [1] "Simulation: 4 rsqsym 0.577523822071225 rsqsgcca 0.504529295978701"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 4 0.5775238 0.2380919 0.5045293 5.476742e-05 0.3743984 0.2930968 0.7249775
##   nTrueEmbeddings nForSim
## 4              21     337
## <<<<********>>>>
## [1] "Simulation: 5 rsqsym 0.582367213529232 rsqsgcca 0.553934741260822"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 5 0.5823672 0.4183328 0.5539347 0.001414994 0.4553291 0.5243792 0.7343283
##   nTrueEmbeddings nForSim
## 5              14     253
## <<<<********>>>>
## [1] "Simulation: 6 rsqsym 0.636934720656124 rsqsgcca 0.566153587511158"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 6 0.6369347 0.5761825 0.5661536 0.02331619 0.6356254 0.5923085 0.7961964
##   nTrueEmbeddings nForSim
## 6              20     342
## <<<<********>>>>
## [1] "Simulation: 7 rsqsym 0.621954137428283 rsqsgcca 0.655560290093703"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 7 0.6219541 0.5894104 0.6555603 0.008639469 0.5721252 0.4228447  0.64963
##   nTrueEmbeddings nForSim
## 7              20     503
## <<<<********>>>>
## [1] "Simulation: 8 rsqsym 0.655260922427714 rsqsgcca 0.641991566398773"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 8 0.6552609 0.5973998 0.6419916 0.001736077 0.850412 0.5317252 0.3854239
##   nTrueEmbeddings nForSim
## 8              16     313
## <<<<********>>>>
## [1] "Simulation: 9 rsqsym 0.71965499861959 rsqsgcca 0.709779240852967"
##     symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 9 0.719655 0.5016047 0.7097792 0.002338726 0.2962562 0.5647676 0.3991453
##   nTrueEmbeddings nForSim
## 9               6     259
## <<<<********>>>>
## [1] "Simulation: 10 rsqsym 0.733996805905093 rsqsgcca 0.647042973433406"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 10 0.7339968 0.6591293 0.647043 0.04373065 0.8285033 0.1398677 0.2981007
##    nTrueEmbeddings nForSim
## 10               5     321
## <<<<********>>>>
## [1] "Simulation: 11 rsqsym 0.637074263873038 rsqsgcca 0.487634845631952"
##       symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 11 0.6370743 0.463435 0.4876348 0.002162833 0.2858025 0.4138801 0.465193
##    nTrueEmbeddings nForSim
## 11               6     273
## <<<<********>>>>
## [1] "Simulation: 12 rsqsym 0.407651735362106 rsqsgcca 0.556552317212778"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2 corrupt3
## 12 0.4076517 0.4937726 0.5565523 0.001371486 0.6473258 0.397628 0.646168
##    nTrueEmbeddings nForSim
## 12              15     202
## <<<<********>>>>
## [1] "Simulation: 13 rsqsym 0.437462401329427 rsqsgcca 0.187849234612155"
##       symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 13 0.4374624 0.08321715 0.1878492 0.0003980824 0.6888443 0.1847571 0.2689542
##    nTrueEmbeddings nForSim
## 13              24     364
## <<<<********>>>>
## [1] "Simulation: 14 rsqsym 0.408290106319165 rsqsgcca 0.547674808826771"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 14 0.4082901 0.4086983 0.5476748 0.002218006 0.6714665 0.8571574 0.6680247
##    nTrueEmbeddings nForSim
## 14               9     267
## <<<<********>>>>
## [1] "Simulation: 15 rsqsym 0.577716986393835 rsqsgcca 0.633558410137305"
##      symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 15 0.577717 0.5900965 0.6335584 0.002103269 0.2550545 0.8027444 0.2884029
##    nTrueEmbeddings nForSim
## 15              23     341
## <<<<********>>>>
## [1] "Simulation: 16 rsqsym 0.416863675220599 rsqsgcca 0.378181848044538"
##       symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 16 0.4168637 0.300542 0.3781818 2.092288e-05 0.8224056 0.2788775 0.3789082
##    nTrueEmbeddings nForSim
## 16              20     358
## <<<<********>>>>
## [1] "Simulation: 17 rsqsym 0.601678226471629 rsqsgcca 0.325216816997708"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 17 0.6016782 0.2446114 0.3252168 0.06367589 0.3827463 0.1016975 0.498994
##    nTrueEmbeddings nForSim
## 17              16     239
## <<<<********>>>>
## [1] "Simulation: 18 rsqsym 0.456485646321679 rsqsgcca 0.487545156122575"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 18 0.4564856 0.4760749 0.4875452 0.02287962 0.5939755 0.8541631 0.8179487
##    nTrueEmbeddings nForSim
## 18              21     394
## <<<<********>>>>
## [1] "Simulation: 19 rsqsym 0.626908127709106 rsqsgcca 0.610320351851101"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 19 0.6269081 0.5842467 0.6103204 0.03417406 0.5315619 0.8480022 0.8151635
##    nTrueEmbeddings nForSim
## 19              15     225
## <<<<********>>>>
## [1] "Simulation: 20 rsqsym 0.563320238215692 rsqsgcca 0.631717335166447"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1  corrupt2  corrupt3
## 20 0.5633202 0.5748232 0.6317173 0.0003631891 0.894567 0.3830734 0.7762652
##    nTrueEmbeddings nForSim
## 20              20     413
## <<<<********>>>>
## [1] "Simulation: 21 rsqsym 0.486369027650972 rsqsgcca 0.424489898976203"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 21 0.486369 0.4008263 0.4244899 0.01938865 0.5307914 0.6875179 0.4006813
##    nTrueEmbeddings nForSim
## 21              12     383
## <<<<********>>>>
## [1] "Simulation: 22 rsqsym 0.478450495380711 rsqsgcca 0.494342717311942"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 22 0.4784505 0.5103097 0.4943427 0.003890893 0.8267991 0.8716003 0.1569747
##    nTrueEmbeddings nForSim
## 22              21     279
## <<<<********>>>>
## [1] "Simulation: 23 rsqsym 0.359425012914949 rsqsgcca 0.393342607460417"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 23 0.359425 0.4023419 0.3933426 0.05163669 0.1604842 0.6603718 0.6257906
##    nTrueEmbeddings nForSim
## 23              18     335
## <<<<********>>>>
## [1] "Simulation: 24 rsqsym 0.564120908983037 rsqsgcca 0.540257822588242"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 24 0.5641209 0.5114599 0.5402578 0.008571686 0.1296695 0.1695853 0.1227204
##    nTrueEmbeddings nForSim
## 24              25     276
## <<<<********>>>>
## [1] "Simulation: 25 rsqsym 0.563300792479713 rsqsgcca 0.380594555044674"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 25 0.5633008 0.2873388 0.3805946 0.002614212 0.8768807 0.6860525 0.1169671
##    nTrueEmbeddings nForSim
## 25               6     303
## <<<<********>>>>
## [1] "Simulation: 26 rsqsym 0.570744631304227 rsqsgcca 0.192686681356382"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 26 0.5707446 0.2956608 0.1926867 0.06619518 0.6882603 0.6693866 0.2517785
##    nTrueEmbeddings nForSim
## 26              19     150
## <<<<********>>>>
## [1] "Simulation: 27 rsqsym 0.508740939357954 rsqsgcca 0.446730557125625"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 27 0.5087409 0.3633363 0.4467306 0.005279974 0.6904371 0.3571471 0.5333443
##    nTrueEmbeddings nForSim
## 27              19     473
## <<<<********>>>>
## [1] "Simulation: 28 rsqsym 0.783289328808735 rsqsgcca 0.694456226136815"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ corrupt1  corrupt2 corrupt3
## 28 0.7832893 0.6131814 0.6944562 0.1752168 0.620296 0.8436519 0.458144
##    nTrueEmbeddings nForSim
## 28               6     168
## <<<<********>>>>
## [1] "Simulation: 29 rsqsym 0.677210403483303 rsqsgcca 0.687258593145159"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 29 0.6772104 0.5377198 0.6872586 6.489354e-05 0.5194642 0.8266058 0.6277783
##    nTrueEmbeddings nForSim
## 29              11     217
## <<<<********>>>>
## [1] "Simulation: 30 rsqsym 0.598782892937101 rsqsgcca 0.361962147639716"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 30 0.5987829 0.2458016 0.3619621 0.01990645 0.3032608 0.7383811 0.5852181
##    nTrueEmbeddings nForSim
## 30              20     217
## <<<<********>>>>
## [1] "Simulation: 31 rsqsym 0.441808005106011 rsqsgcca 0.526921066150372"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 31 0.441808 0.4618586 0.5269211 0.08805233 0.7282429 0.2031838 0.4044328
##    nTrueEmbeddings nForSim
## 31              18     324
## <<<<********>>>>
## [1] "Simulation: 32 rsqsym 0.606205902622287 rsqsgcca 0.524980373796632"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 32 0.6062059 0.3883998 0.5249804 0.0398912 0.3501221 0.5624648 0.4493418
##    nTrueEmbeddings nForSim
## 32               8     321
## <<<<********>>>>
## [1] "Simulation: 33 rsqsym 0.266723366556151 rsqsgcca 0.268563043104229"
##       symRSQ   rgccaRSQ sgccaRSQ   prmRSQ corrupt1  corrupt2  corrupt3
## 33 0.2667234 0.08773133 0.268563 0.114566 0.436592 0.1385706 0.3680125
##    nTrueEmbeddings nForSim
## 33              22     309
## <<<<********>>>>
## [1] "Simulation: 34 rsqsym 0.316859900011147 rsqsgcca 0.392154570116717"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 34 0.3168599 0.2082791 0.3921546 0.004217125 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.724050425964061 rsqsgcca 0.692674333583416"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 35 0.7240504 0.4506672 0.6926743 0.02326596 0.5851936 0.3427513 0.5000881
##    nTrueEmbeddings nForSim
## 35               7     405
## <<<<********>>>>
## [1] "Simulation: 36 rsqsym 0.570477651318873 rsqsgcca 0.349633394596894"
##       symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 36 0.5704777 0.405382 0.3496334 3.373393e-06 0.2522588 0.7206225 0.8813692
##    nTrueEmbeddings nForSim
## 36              24     345
## <<<<********>>>>
## [1] "Simulation: 37 rsqsym 0.675414094465981 rsqsgcca 0.34229890230554"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 37 0.6754141 0.1316114 0.3422989 0.01040543 0.4398332 0.4602104 0.250888
##    nTrueEmbeddings nForSim
## 37               7     330
## <<<<********>>>>
## [1] "Simulation: 38 rsqsym 0.131249002908142 rsqsgcca 0.118994380725365"
##      symRSQ   rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 38 0.131249 0.01403716 0.1189944 0.006618325 0.1679595 0.7741895 0.2491769
##    nTrueEmbeddings nForSim
## 38              25     300
## <<<<********>>>>
## [1] "Simulation: 39 rsqsym 0.560567071995913 rsqsgcca 0.454043440551608"
##       symRSQ rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 39 0.5605671 0.337834 0.4540434 0.08777932 0.2791145 0.640759 0.8329312
##    nTrueEmbeddings nForSim
## 39              25     305
## <<<<********>>>>
## [1] "Simulation: 40 rsqsym 0.541822752586166 rsqsgcca 0.36697276127582"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 40 0.5418228 0.2389479 0.3669728 0.0008090199 0.1590437 0.833552 0.4547524
##    nTrueEmbeddings nForSim
## 40              24     358
## <<<<********>>>>
## [1] "Simulation: 41 rsqsym 0.517421420340154 rsqsgcca 0.503186954954368"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 41 0.5174214 0.3828291 0.503187 0.05811436 0.4847883 0.291713 0.8222376
##    nTrueEmbeddings nForSim
## 41              20     256
## <<<<********>>>>
## [1] "Simulation: 42 rsqsym 0.521991302676809 rsqsgcca 0.511858027221582"
##       symRSQ  rgccaRSQ sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 42 0.5219913 0.3585077 0.511858 3.149157e-05 0.3012763 0.627033 0.3951814
##    nTrueEmbeddings nForSim
## 42              20     430
## <<<<********>>>>
## [1] "Simulation: 43 rsqsym 0.640699253942654 rsqsgcca 0.574131284356983"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 43 0.6406993 0.5780918 0.5741313 0.001418071 0.7214112 0.8823007 0.3360352
##    nTrueEmbeddings nForSim
## 43              17     317
## <<<<********>>>>
## [1] "Simulation: 44 rsqsym 0.610522414958812 rsqsgcca 0.584978389409612"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 44 0.6105224 0.4620259 0.5849784 0.02042724 0.6155342 0.8495107 0.1289159
##    nTrueEmbeddings nForSim
## 44               9     372
## <<<<********>>>>
## [1] "Simulation: 45 rsqsym 0.695396768275815 rsqsgcca 0.588719287021426"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2 corrupt3
## 45 0.6953968 0.5227885 0.5887193 0.0001128155 0.1410228 0.289673 0.356922
##    nTrueEmbeddings nForSim
## 45              12     347
## <<<<********>>>>
## [1] "Simulation: 46 rsqsym 0.458498175364393 rsqsgcca 0.422803589835628"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 46 0.4584982 0.2128069 0.4228036 0.0003097372 0.3769051 0.5152114 0.2799855
##    nTrueEmbeddings nForSim
## 46              19     248
## <<<<********>>>>
## [1] "Simulation: 47 rsqsym 0.465201228961009 rsqsgcca 0.517948539126346"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2 corrupt3
## 47 0.4652012 0.5015011 0.5179485 0.0005325767 0.8738161 0.1229469  0.30533
##    nTrueEmbeddings nForSim
## 47              12     480
## <<<<********>>>>
## [1] "Simulation: 48 rsqsym 0.526858919725109 rsqsgcca 0.562433880394532"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ corrupt1 corrupt2  corrupt3
## 48 0.5268589 0.5915697 0.5624339 5.230929e-05 0.471881 0.522434 0.8014456
##    nTrueEmbeddings nForSim
## 48              19     336
## <<<<********>>>>
## [1] "Simulation: 49 rsqsym 0.688513039404875 rsqsgcca 0.704244400642284"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 49 0.688513 0.6370647 0.7042444 0.04492495 0.6656333 0.6198922 0.866629
##    nTrueEmbeddings nForSim
## 49              13     293
## <<<<********>>>>
## [1] "Simulation: 50 rsqsym 0.618520553971798 rsqsgcca 0.56595396091291"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 50 0.6185206 0.3452818 0.565954 0.01511669 0.4344102 0.6799204 0.4099741
##    nTrueEmbeddings nForSim
## 50              16     364
## <<<<********>>>>
## [1] "Simulation: 51 rsqsym 0.506446024325381 rsqsgcca 0.475377230043224"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2 corrupt3
## 51 0.506446 0.3566666 0.4753772 0.0008830341 0.3476936 0.8587498 0.486094
##    nTrueEmbeddings nForSim
## 51              18     381
## <<<<********>>>>
## [1] "Simulation: 52 rsqsym 0.375008059085874 rsqsgcca 0.136185908409598"
##       symRSQ   rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 52 0.3750081 0.06545324 0.1361859 0.1167652 0.1569439 0.2231528 0.1094279
##    nTrueEmbeddings nForSim
## 52              18     241
## <<<<********>>>>
## [1] "Simulation: 53 rsqsym 0.406043012171512 rsqsgcca 0.36556762450566"
##      symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 53 0.406043 0.3179103 0.3655676 0.04109764 0.4425242 0.1883126 0.5680132
##    nTrueEmbeddings nForSim
## 53              17     336
## <<<<********>>>>
## [1] "Simulation: 54 rsqsym 0.606559433597976 rsqsgcca 0.312845185739914"
##       symRSQ   rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 54 0.6065594 0.07820099 0.3128452 0.0254928 0.8272887 0.4393381 0.2237687
##    nTrueEmbeddings nForSim
## 54              15     471
## <<<<********>>>>
## [1] "Simulation: 55 rsqsym 0.422011173299244 rsqsgcca 0.338546044894568"
##       symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 55 0.4220112 0.1876889 0.338546 0.003078158 0.2681519 0.3353227 0.4164188
##    nTrueEmbeddings nForSim
## 55              12     330
## <<<<********>>>>
## [1] "Simulation: 56 rsqsym 0.515823574122314 rsqsgcca 0.561318650609173"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 56 0.5158236 0.5374709 0.5613187 0.03807382 0.2937456 0.8149369 0.8739436
##    nTrueEmbeddings nForSim
## 56              12     301
## <<<<********>>>>
## [1] "Simulation: 57 rsqsym 0.593646421774433 rsqsgcca 0.540933641683108"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 57 0.5936464 0.4067728 0.5409336 0.02594376 0.1002266 0.4612999 0.2636267
##    nTrueEmbeddings nForSim
## 57               7     264
## <<<<********>>>>
## [1] "Simulation: 58 rsqsym 0.511782050104842 rsqsgcca 0.433578117219692"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 58 0.5117821 0.3645029 0.4335781 0.0268236 0.7507904 0.3868264 0.6326859
##    nTrueEmbeddings nForSim
## 58              17     284
## <<<<********>>>>
## [1] "Simulation: 59 rsqsym 0.510493025022378 rsqsgcca 0.45002137921813"
##      symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 59 0.510493 0.2612097 0.4500214 0.1287623 0.5269512 0.8585265 0.2362692
##    nTrueEmbeddings nForSim
## 59               5     171
## <<<<********>>>>
## [1] "Simulation: 60 rsqsym 0.370983801091124 rsqsgcca 0.154954811568022"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 60 0.3709838 0.06798344 0.1549548 0.03359924 0.1368409 0.4308373 0.1536706
##    nTrueEmbeddings nForSim
## 60               5     378
## <<<<********>>>>
## [1] "Simulation: 61 rsqsym 0.469291289672428 rsqsgcca 0.478090567151587"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 61 0.4692913 0.3877688 0.4780906 0.01840318 0.7889965 0.2945368 0.5370012
##    nTrueEmbeddings nForSim
## 61              20     290
## <<<<********>>>>
## [1] "Simulation: 62 rsqsym 0.236255511056054 rsqsgcca 0.10709024086297"
##       symRSQ     rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 62 0.2362555 5.971027e-05 0.1070902 0.002507937 0.2928243 0.8788607 0.1882851
##    nTrueEmbeddings nForSim
## 62              13     384
## <<<<********>>>>
## [1] "Simulation: 63 rsqsym 0.657566338654409 rsqsgcca 0.72597409027156"
##       symRSQ rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 63 0.6575663 0.631906 0.7259741 4.091716e-05 0.7306326 0.4942561 0.4960944
##    nTrueEmbeddings nForSim
## 63              21     426
## <<<<********>>>>
## [1] "Simulation: 64 rsqsym 0.276561314631559 rsqsgcca 0.0510543583554501"
##       symRSQ  rgccaRSQ   sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 64 0.2765613 0.1212347 0.05105436 0.0004686498 0.3259776 0.2503945 0.4200655
##    nTrueEmbeddings nForSim
## 64              21     183
## <<<<********>>>>
## [1] "Simulation: 65 rsqsym 0.294630340199372 rsqsgcca 0.391080548520454"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 65 0.2946303 0.1598126 0.3910805 0.04675419 0.8581586 0.3279982 0.4257686
##    nTrueEmbeddings nForSim
## 65              16     224
## <<<<********>>>>
## [1] "Simulation: 66 rsqsym 0.397255261317655 rsqsgcca 0.400317684596816"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 66 0.3972553 0.2112562 0.4003177 0.0003504491 0.4530189 0.640667 0.4527265
##    nTrueEmbeddings nForSim
## 66              17     506
## <<<<********>>>>
## [1] "Simulation: 67 rsqsym 0.613916799664489 rsqsgcca 0.543582395303469"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 67 0.6139168 0.3941403 0.5435824 0.0005433946 0.1862677 0.5875123 0.4180602
##    nTrueEmbeddings nForSim
## 67              24     418
## <<<<********>>>>
## [1] "Simulation: 68 rsqsym 0.57357088054313 rsqsgcca 0.393353301220279"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 68 0.5735709 0.4409409 0.3933533 0.001687098 0.4696518 0.2779817 0.2467748
##    nTrueEmbeddings nForSim
## 68              19     435
## <<<<********>>>>
## [1] "Simulation: 69 rsqsym 0.5058815103641 rsqsgcca 0.428005383535426"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 69 0.5058815 0.3811938 0.4280054 0.005482989 0.1099845 0.5348248 0.5275168
##    nTrueEmbeddings nForSim
## 69               8     326
## <<<<********>>>>
## [1] "Simulation: 70 rsqsym 0.333902286790121 rsqsgcca 0.52241607460703"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 70 0.3339023 0.2601868 0.5224161 0.008345195 0.6776801 0.647109 0.8815156
##    nTrueEmbeddings nForSim
## 70              17     197
## <<<<********>>>>
## [1] "Simulation: 71 rsqsym 0.671773039796877 rsqsgcca 0.682346119437703"
##      symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 71 0.671773 0.6673374 0.6823461 2.461349e-05 0.3003894 0.2379569 0.2127435
##    nTrueEmbeddings nForSim
## 71              25     285
## <<<<********>>>>
## [1] "Simulation: 72 rsqsym 0.46856817634437 rsqsgcca 0.330786782282328"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 72 0.4685682 0.0443791 0.3307868 0.0004985269 0.3011837 0.4871177 0.6970519
##    nTrueEmbeddings nForSim
## 72              15     430
## <<<<********>>>>
## [1] "Simulation: 73 rsqsym 0.655641440248548 rsqsgcca 0.534509309466627"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ  corrupt1  corrupt2  corrupt3
## 73 0.6556414 0.2497581 0.5345093 0.1141629 0.8569064 0.3947365 0.4396441
##    nTrueEmbeddings nForSim
## 73               8     308
## <<<<********>>>>
## [1] "Simulation: 74 rsqsym 0.452209643834713 rsqsgcca 0.384064993077656"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 74 0.4522096 0.2561163 0.384065 0.01444359 0.6702812 0.2161957 0.5101028
##    nTrueEmbeddings nForSim
## 74              20     363
## <<<<********>>>>
## [1] "Simulation: 75 rsqsym 0.538492454913388 rsqsgcca 0.512149963257713"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 75 0.5384925 0.4724307  0.51215 0.01884437 0.7490435 0.7985777 0.1631237
##    nTrueEmbeddings nForSim
## 75              19     257
## <<<<********>>>>
## [1] "Simulation: 76 rsqsym 0.531065539695547 rsqsgcca 0.581772650422497"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 76 0.5310655 0.3706199 0.5817727 0.00924394 0.6437605 0.4883076 0.4903955
##    nTrueEmbeddings nForSim
## 76              18     345
## <<<<********>>>>
## [1] "Simulation: 77 rsqsym 0.493743920671157 rsqsgcca 0.0886396795793668"
##       symRSQ   rgccaRSQ   sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 77 0.4937439 0.04884299 0.08863968 0.03185716 0.4233497 0.5933021 0.1258496
##    nTrueEmbeddings nForSim
## 77               8     276
## <<<<********>>>>
## [1] "Simulation: 78 rsqsym 0.367290630656759 rsqsgcca 0.240153541495727"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 78 0.3672906 0.1660221 0.2401535 0.01996336 0.1547818 0.1775583 0.4993309
##    nTrueEmbeddings nForSim
## 78              13     377
## <<<<********>>>>
## [1] "Simulation: 79 rsqsym 0.452955707071105 rsqsgcca 0.531540284135714"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 79 0.4529557 0.3364088 0.5315403 0.0003591183 0.5654484 0.5645001 0.7428239
##    nTrueEmbeddings nForSim
## 79              12     409
## <<<<********>>>>
## [1] "Simulation: 80 rsqsym 0.480923497038353 rsqsgcca 0.259295257499687"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 80 0.4809235 0.0290133 0.2592953 0.003900754 0.4462618 0.7851674 0.2694984
##    nTrueEmbeddings nForSim
## 80              15     308
## <<<<********>>>>
## [1] "Simulation: 81 rsqsym 0.666694948200962 rsqsgcca 0.6270887366707"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 81 0.6666949 0.5587883 0.6270887 0.001083444 0.2400547 0.3223464 0.2583558
##    nTrueEmbeddings nForSim
## 81              14     237
## <<<<********>>>>
## [1] "Simulation: 82 rsqsym 0.497035287794701 rsqsgcca 0.281301104245019"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 82 0.4970353 0.2911373 0.2813011 0.01031817 0.2712748 0.7504076 0.3170967
##    nTrueEmbeddings nForSim
## 82              13     222
## <<<<********>>>>
## [1] "Simulation: 83 rsqsym 0.366154875106546 rsqsgcca 0.27749133701365"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 83 0.3661549 0.2636826 0.2774913 0.04609528 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.602841251062932 rsqsgcca 0.562166202930219"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 84 0.6028413 0.5869723 0.5621662 0.003139963 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.4847725671234 rsqsgcca 0.441601070309138"
##       symRSQ  rgccaRSQ  sgccaRSQ    prmRSQ corrupt1  corrupt2  corrupt3
## 85 0.4847726 0.2444986 0.4416011 0.0132079 0.609813 0.1514781 0.6292061
##    nTrueEmbeddings nForSim
## 85              12     319
## <<<<********>>>>
## [1] "Simulation: 86 rsqsym 0.54167656206568 rsqsgcca 0.503980519434783"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 86 0.5416766 0.4446583 0.5039805 0.03503546 0.3358441 0.3240853 0.8426786
##    nTrueEmbeddings nForSim
## 86              24     377
## <<<<********>>>>
## [1] "Simulation: 87 rsqsym 0.337760592276848 rsqsgcca 0.237756026328088"
##       symRSQ  rgccaRSQ sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 87 0.3377606 0.1965243 0.237756 0.09806176 0.4697052 0.4237337 0.2751579
##    nTrueEmbeddings nForSim
## 87              17     149
## <<<<********>>>>
## [1] "Simulation: 88 rsqsym 0.657001127952622 rsqsgcca 0.719837366483992"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 88 0.6570011 0.7052217 0.7198374 0.008981985 0.1529857 0.2631594 0.2922959
##    nTrueEmbeddings nForSim
## 88               9     302
## <<<<********>>>>
## [1] "Simulation: 89 rsqsym 0.758891586067522 rsqsgcca 0.723562265811417"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 89 0.7588916 0.2954773 0.7235623 0.002143661 0.6562259 0.1322438 0.6857676
##    nTrueEmbeddings nForSim
## 89               7     204
## <<<<********>>>>
## [1] "Simulation: 90 rsqsym 0.689842309930354 rsqsgcca 0.592271123229641"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 90 0.6898423 0.4240334 0.5922711 0.001834781 0.6310118 0.6484033 0.6847723
##    nTrueEmbeddings nForSim
## 90              15     326
## <<<<********>>>>
## [1] "Simulation: 91 rsqsym 0.497438845677233 rsqsgcca 0.47162886101363"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 91 0.4974388 0.3279079 0.4716289 0.04240134 0.1137693 0.8786272 0.5353798
##    nTrueEmbeddings nForSim
## 91              22     324
## <<<<********>>>>
## [1] "Simulation: 92 rsqsym 0.46582775000753 rsqsgcca 0.476281754919686"
##       symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 92 0.4658278 0.06712833 0.4762818 0.00493925 0.5576644 0.3941734 0.5302135
##    nTrueEmbeddings nForSim
## 92              25     202
## <<<<********>>>>
## [1] "Simulation: 93 rsqsym 0.370370181925805 rsqsgcca 0.433679248222673"
##       symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1 corrupt2  corrupt3
## 93 0.3703702 0.2630624 0.4336792 0.0007280857 0.3560441 0.226927 0.5352436
##    nTrueEmbeddings nForSim
## 93              13     294
## <<<<********>>>>
## [1] "Simulation: 94 rsqsym 0.600888720610974 rsqsgcca 0.668982247356921"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 94 0.6008887 0.5782863 0.6689822 0.01773065 0.5291184 0.7492544 0.5367249
##    nTrueEmbeddings nForSim
## 94              17     412
## <<<<********>>>>
## [1] "Simulation: 95 rsqsym 0.448985214317614 rsqsgcca 0.436839440780205"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 95 0.4489852 0.2711107 0.4368394 0.01489922 0.1295026 0.7203477 0.4332235
##    nTrueEmbeddings nForSim
## 95              10     238
## <<<<********>>>>
## [1] "Simulation: 96 rsqsym 0.520489824178111 rsqsgcca 0.398062109699398"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 96 0.5204898 0.2148298 0.3980621 0.006550331 0.3888925 0.2550032 0.2558169
##    nTrueEmbeddings nForSim
## 96              11     326
## <<<<********>>>>
## [1] "Simulation: 97 rsqsym 0.13415493255106 rsqsgcca 0.301835992177041"
##       symRSQ  rgccaRSQ sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 97 0.1341549 0.2737499 0.301836 0.0008624163 0.2608804 0.2873599 0.7119718
##    nTrueEmbeddings nForSim
## 97              13     181
## <<<<********>>>>
## [1] "Simulation: 98 rsqsym 0.51906886201301 rsqsgcca 0.566754553822022"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 98 0.5190689 0.4599721 0.5667546 0.02514625 0.4428944 0.2541065 0.3347575
##    nTrueEmbeddings nForSim
## 98              10     313
## <<<<********>>>>
## [1] "Simulation: 99 rsqsym 0.725225772589112 rsqsgcca 0.494021558546621"
##       symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 99 0.7252258 0.5275812 0.4940216 0.02563436 0.5520611 0.6440624 0.1254326
##    nTrueEmbeddings nForSim
## 99              10     337
## <<<<********>>>>
## [1] "Simulation: 100 rsqsym 0.641223319612098 rsqsgcca 0.393888924231565"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 100 0.6412233 0.2019161 0.3938889 0.01755631 0.5527685 0.856266 0.3965549
##     nTrueEmbeddings nForSim
## 100              23     280
## <<<<********>>>>
## [1] "Simulation: 101 rsqsym 0.647933887074605 rsqsgcca 0.548861671617379"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 101 0.6479339 0.4970487 0.5488617 0.001036142 0.4105611 0.8063324 0.6630487
##     nTrueEmbeddings nForSim
## 101              25     294
## <<<<********>>>>
## [1] "Simulation: 102 rsqsym 0.594439697593725 rsqsgcca 0.639175816961478"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 102 0.5944397 0.6054637 0.6391758 0.0001949871 0.8525122 0.6505218 0.8316572
##     nTrueEmbeddings nForSim
## 102              15     334
## <<<<********>>>>
## [1] "Simulation: 103 rsqsym 0.556225272677398 rsqsgcca 0.554842218037964"
##        symRSQ rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 103 0.5562253 0.425402 0.5548422 0.009171568 0.5954883 0.6062012 0.8316034
##     nTrueEmbeddings nForSim
## 103              20     257
## <<<<********>>>>
## [1] "Simulation: 104 rsqsym 0.401054907428984 rsqsgcca 0.395347060438571"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 104 0.4010549 0.2594474 0.3953471 0.0001497792 0.4997567 0.4452579 0.4073715
##     nTrueEmbeddings nForSim
## 104              24     292
## <<<<********>>>>
## [1] "Simulation: 105 rsqsym 0.516567301226567 rsqsgcca 0.501156946708329"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 105 0.5165673 0.2121226 0.5011569 0.01462846 0.5225104 0.3544439 0.8036832
##     nTrueEmbeddings nForSim
## 105              14     217
## <<<<********>>>>
## [1] "Simulation: 106 rsqsym 0.460596581781169 rsqsgcca 0.454916790089812"
##        symRSQ rgccaRSQ  sgccaRSQ     prmRSQ corrupt1 corrupt2  corrupt3
## 106 0.4605966 0.213753 0.4549168 0.01350409 0.822649  0.43779 0.8917009
##     nTrueEmbeddings nForSim
## 106              21     245
## <<<<********>>>>
## [1] "Simulation: 107 rsqsym 0.65847804707346 rsqsgcca 0.613984947392843"
##       symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1 corrupt2  corrupt3
## 107 0.658478 0.3700447 0.6139849 0.003366777 0.2662422     0.85 0.6465484
##     nTrueEmbeddings nForSim
## 107               7     321
## <<<<********>>>>
## [1] "Simulation: 108 rsqsym 0.532176581192621 rsqsgcca 0.725311962828203"
##        symRSQ  rgccaRSQ sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 108 0.5321766 0.6252097 0.725312 0.001425236 0.5178112 0.7085239 0.686261
##     nTrueEmbeddings nForSim
## 108              22     311
## <<<<********>>>>
## [1] "Simulation: 109 rsqsym 0.245436453599636 rsqsgcca 0.135051397560783"
##        symRSQ   rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 109 0.2454365 0.01966475 0.1350514 0.01884707 0.4445034 0.7832479 0.6515661
##     nTrueEmbeddings nForSim
## 109              19     163
## <<<<********>>>>
## [1] "Simulation: 110 rsqsym 0.458122405759925 rsqsgcca 0.288982317370882"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ corrupt1  corrupt2  corrupt3
## 110 0.4581224 0.1305512 0.2889823 0.002504137 0.635658 0.5320764 0.4454202
##     nTrueEmbeddings nForSim
## 110              24     343
## <<<<********>>>>
## [1] "Simulation: 111 rsqsym 0.480724716410118 rsqsgcca 0.378644405525776"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ corrupt1 corrupt2  corrupt3
## 111 0.4807247 0.2684032 0.3786444 0.02216265 0.284206 0.150226 0.5085848
##     nTrueEmbeddings nForSim
## 111              15     339
## <<<<********>>>>
## [1] "Simulation: 112 rsqsym 0.669672535982278 rsqsgcca 0.626592559497463"
##        symRSQ  rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 112 0.6696725 0.5214905 0.6265926 5.727873e-07 0.5591724 0.6889736 0.6090539
##     nTrueEmbeddings nForSim
## 112              22     295
## <<<<********>>>>
## [1] "Simulation: 113 rsqsym 0.46697847898466 rsqsgcca 0.494927911559694"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2  corrupt3
## 113 0.4669785 0.3148347 0.4949279 0.001787254 0.1964909 0.5260146 0.4824141
##     nTrueEmbeddings nForSim
## 113              15     331
## <<<<********>>>>
## [1] "Simulation: 114 rsqsym 0.30205390990818 rsqsgcca 0.315416751242309"
##        symRSQ  rgccaRSQ  sgccaRSQ      prmRSQ  corrupt1  corrupt2 corrupt3
## 114 0.3020539 0.2541153 0.3154168 0.006446191 0.5806778 0.2772731 0.357151
##     nTrueEmbeddings nForSim
## 114              21     333
## <<<<********>>>>
## [1] "Simulation: 115 rsqsym 0.522953240790021 rsqsgcca 0.127296733404578"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1 corrupt2  corrupt3
## 115 0.5229532 0.1861737 0.1272967 0.02530545 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.567238581639121 rsqsgcca 0.561956930511183"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 116 0.5672386 0.5634997 0.5619569 0.05957556 0.6726812 0.6481071 0.2589203
##     nTrueEmbeddings nForSim
## 116              16     372
## <<<<********>>>>
## [1] "Simulation: 117 rsqsym 0.494663870670635 rsqsgcca 0.509535722094019"
##        symRSQ  rgccaRSQ  sgccaRSQ     prmRSQ  corrupt1  corrupt2  corrupt3
## 117 0.4946639 0.5094449 0.5095357 0.03560003 0.1696539 0.5466123 0.5343067
##     nTrueEmbeddings nForSim
## 117              20     366
## <<<<********>>>>
## [1] "Simulation: 118 rsqsym 0.11830733006103 rsqsgcca 0.0132858716526127"
##        symRSQ   rgccaRSQ   sgccaRSQ     prmRSQ  corrupt1  corrupt2 corrupt3
## 118 0.1183073 0.01691603 0.01328587 0.02975282 0.3567169 0.2287202 0.388297
##     nTrueEmbeddings nForSim
## 118               8     186
## <<<<********>>>>
## [1] "Simulation: 119 rsqsym 0.110592744372824 rsqsgcca 0.155943686123964"
##        symRSQ   rgccaRSQ  sgccaRSQ       prmRSQ  corrupt1  corrupt2  corrupt3
## 119 0.1105927 0.05070594 0.1559437 4.067525e-05 0.2709615 0.2207935 0.3327085
##     nTrueEmbeddings nForSim
## 119              25     149
## <<<<********>>>>
## [1] "Simulation: 120 rsqsym 0.507965915700662 rsqsgcca 0.596779951451762"
##        symRSQ  rgccaRSQ sgccaRSQ    prmRSQ corrupt1  corrupt2  corrupt3
## 120 0.5079659 0.3613531  0.59678 0.1777057 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.746, df = 119, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.1385223 0.1894789
## sample estimates:
## mean of the differences 
##               0.1640006

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 = 5.4298, df = 119, p-value = 3.028e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03652940 0.07846438
## sample estimates:
## mean of the differences 
##              0.05749689

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

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

mean performance

print( colMeans( simdatafrm ) )
##          symRSQ        rgccaRSQ        sgccaRSQ          prmRSQ        corrupt1 
##      0.51233675      0.34833618      0.45483986      0.02269175      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.37430 -0.06119  0.01135  0.09618  0.26937 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.38891    0.04756   8.177 4.14e-13 ***
## corrupt1     0.10747    0.05817   1.847   0.0672 .  
## corrupt2     0.12071    0.05392   2.239   0.0271 *  
## corrupt3     0.02060    0.05846   0.352   0.7252    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1373 on 116 degrees of freedom
## Multiple R-squared:  0.06841,    Adjusted R-squared:  0.04431 
## F-statistic: 2.839 on 3 and 116 DF,  p-value: 0.04103
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.37825 -0.08493  0.00602  0.09857  0.31928 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.4061190  0.0514737   7.890 1.71e-12 ***
## nForSim     0.0003446  0.0001619   2.129   0.0354 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1384 on 118 degrees of freedom
## Multiple R-squared:  0.03698,    Adjusted R-squared:  0.02882 
## F-statistic: 4.531 on 1 and 118 DF,  p-value: 0.03536
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.43925 -0.06450  0.00958  0.10313  0.21439 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.602927   0.037141  16.233   <2e-16 ***
## nTrueEmbeddings -0.005671   0.002189  -2.591   0.0108 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1372 on 118 degrees of freedom
## Multiple R-squared:  0.05382,    Adjusted R-squared:  0.0458 
## F-statistic: 6.712 on 1 and 118 DF,  p-value: 0.01078
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 )