View source: R/ComDim_PLS_MB.R
| ComDim_PLS_MB | R Documentation |
Finding common dimensions in multi-block datasets. Code translated from the following MATLAB function: comdim_PCA_2020.m
ComDim_PLS_MB(
MB = MB,
y = y,
ndim = NULL,
method = c("PLS-DA", "PLS-R"),
decisionRule = c("fixed", "max")[2],
normalise = FALSE,
threshold = 1e-10,
loquace = FALSE,
CompMethod = "Normal",
Partitions = 1
)
MB |
A MultiBlock object. |
y |
The Y-block to use in the PLS model as dependent data. A class vector or a dummy matrix. |
ndim |
Number of Common Dimensions |
method |
PLS-DA or PLS-R |
decisionRule |
Only used if method is set to PLS-DA. If 'fixed', samples are assigned to the class... |
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 multi-blocks. 'Normal' (default), 'Kernel', 'PCT', 'Tall' or 'Wide'. |
Partitions |
To speed up the analysis for really big multi-blocks. This parameter is used if CompMethod is 'Tall' or 'Wide'. |
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). Lx Unscaled Global loadings for data. Lx_Loc Unscaled Local loadings for data. 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)
# Generate the Y-block
y <- scale(1:10, center = TRUE)
# Do ComDim
results <- ComDim_PLS(rw, y, 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.