ComDim_y_MB | R Documentation |
Finding common dimensions in multi-block datasets. Code translated from the following MATLAB function: comdim_PCA_2020.m
ComDim_y_MB(
MB = MB,
y = y,
ndim = NULL,
FUN = FUN,
type = c("regression", "discriminant")[1],
orthogonalization = FALSE,
decisionRule = c("fixed", "max")[2],
normalise = FALSE,
threshold = 1e-10,
loquace = FALSE,
method = "FUN",
...
)
MB |
A MultiBlock oject. |
y |
The y vector. |
ndim |
Number of Common Dimensions |
FUN |
The function used as core of the ComDim analysis. |
type |
To indicate wether ComDim is used for regression or as a discriminant tool. |
orthogonalization |
If TRUE, the orthogonal components will be captured. |
decisionRule |
Only used if method is set to PLS-DA. If 'fixed', samples are assigned to the class... |
normalise |
To apply normalisation. FALSE == no (default), TRUE == yes. |
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.