View source: R/ComDim_Exploratory_MB.R
ComDim_Exploratory_MB | R Documentation |
Finding common dimensions in multi-block datasets. Code translated from the following MATLAB function: comdim_PCA_2020.m
ComDim_Exploratory_MB(
MB = MB,
ndim = NULL,
FUN = FUN,
normalise = FALSE,
threshold = 1e-10,
loquace = FALSE,
method = "FUN",
...
)
MB |
A MultiBlock oject. |
ndim |
Number of Common Dimensions |
FUN |
The function used as core of the ComDim analysis. |
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). |
... |
Additional arguments needed for the internal core function of the ComDim analysis. |
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).
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.