ComDim_PCA_MB: ComDim - Finding common dimensions in multi-block datasets.

View source: R/ComDim_PCA_MB.R

ComDim_PCA_MBR Documentation

ComDim - Finding common dimensions in multi-block datasets.

Description

Finding common dimensions in multi-block datasets. Code translated from the following MATLAB function: comdim_PCA_2020.m

Usage

ComDim_PCA_MB(
  MB = MB,
  ndim = NULL,
  normalise = FALSE,
  threshold = 1e-10,
  loquace = FALSE,
  CompMethod = "Normal",
  Partitions = 1
)

Arguments

MB

A MultiBlock oject.

ndim

Number of Common Dimensions

normalise

To apply normalisation. FALSE == no, TRUE == yes (default).

threshold

The threshold limit to stop the iterations. If the "difference of fit" < threshold (1e-10 as default).

loquace

To display the calculation times. TRUE == yes, FALSE == no (default).

CompMethod

To speed-up the analysis for really big MultiBlocks. 'Normal' (default), 'Kernel', 'PCT', 'Tall' or 'Wide'.

Partitions

To speed-up the analysis for really big MultiBlocks. This parameter is used if CompMethod is 'Tall' or 'Wide'.

Value

A list containing the results from a ComDim analysis. The list fields: Q Global scores (nrow x ndim). P Scaled Global Loadings calculated from Q and the blocks (nvars x ndim). P_Loc Loadings - List containing the Loadings for every block (local vars x ndim). T_Loc Local scores - List containing the (scaled) Local scores for every block (nrow x ndim). saliences Weight of the original blocks in each dimension (ntable x ndim). Sum_saliences_Tab Sum of Saliences for each block in a Dimension. Sum_saliences_Dim Sum of Saliences for each Dimension for a block. b Regression coefficients between Local and Global Scores. explained Percentage explanation given by each dimension (1 x ndim). runtime Period of time spent to execute the analysis (in seconds). NormMB norms of the blocks (1 x 1). MeanMB means of the blocks (1 x nvars). SingVal Vector with singular values (1 x ndim).

Examples

b1 = matrix(rnorm(500),10,50)
batch_b1 = rep(1,10)
b2 = matrix(rnorm(800),30,80)
batch_b2 = c(rep(1,10),rep(2,10),rep(3,10))
# Generate the multi-block (mb)
mb <- BuildMultiBlock(b1, batches = batch_b1)
mb <- BuildMultiBlock(b2, growingMB = mb, batches = batch_b2, equalSampleNumber = FALSE)
rw <- SplitRW(mb)
# Do ComDim
results <- ComDim_PCA(rw, 2) # In this analysis, we used 2 components.

f-puig/R.ComDim documentation built on Feb. 20, 2024, 6:49 a.m.