View source: R/ComDim_Exploratory.R
| ComDim_Exploratory | R Documentation |
Extends any matrix decomposition method used for exploratory purposes to the multi-block
field. The user provides a function (FUN) to compute the scores from the
salience-weighted concatenated blocks; these scores are then used to derive the global
scores, local scores, and loadings following the traditional ComDim-PCA framework.
ComDim_Exploratory(
MB = MB,
ndim = NULL,
FUN = FUN,
normalise = FALSE,
threshold = 1e-10,
loquace = FALSE,
method = "FUN",
...
)
MB |
A MultiBlock object. |
ndim |
Number of Common Dimensions. |
FUN |
The function used as the core of the ComDim analysis. It must accept a matrix
|
normalise |
To apply block normalisation. FALSE == no (default), TRUE == yes. |
threshold |
The threshold limit to stop the iterations. Iterations stop when the change in the global score vector is below this value (1e-10 as default). |
loquace |
To display the calculation times. TRUE == yes, FALSE == no (default). |
method |
A string label identifying the decomposition method used (default: 'FUN'). |
... |
Additional arguments passed to |
A ComDim object. Slots for supervised analysis
(R2Y, Q2, DQ2, VIP, VIP.block,
PLS.model, cv, Prediction) are empty. The
populated slots are:
MethodThe label supplied via the method argument.
ndimNumber of Common Dimensions extracted.
Q.scoresGlobal scores matrix (n \times ndim).
Column names are CC1, CC2, etc.; row names are sample
names. Each column \mathbf{q}_a is a unit-norm consensus score
derived from the dominant left direction of FUN applied to the
salience-weighted concatenated blocks
\mathbf{W} = [\sqrt{\lambda_1}\mathbf{X}_1 \mid \cdots \mid
\sqrt{\lambda_B}\mathbf{X}_B].
T.scoresNamed list of block-specific local scores matrices
(n \times ndim each). For block b and component a:
local loading \mathbf{p}_{ba} = \mathbf{X}_b'\mathbf{q}_a and
local score
\mathbf{t}_{ba} =
\mathbf{X}_b\,\mathbf{p}_{ba}(\mathbf{p}_{ba}'\mathbf{p}_{ba})^{-1}.
P.loadingsGlobal loadings matrix (p_{tot} \times
ndim). Column a is
\mathbf{P}_a = \mathbf{X}'\mathbf{q}_a,
where \mathbf{X} is the mean-centred (and optionally normalised)
concatenated blocks.
SaliencesBlock salience (weight) matrix (ntable
\times ndim, row names = block names). Entry (b,a) is
\lambda_{ba} =
\mathbf{q}_a'\mathbf{X}_b\mathbf{X}_b'\mathbf{q}_a,
the variance of block b captured by global score a.
R2XProportion of multi-block variance captured by each
component (named vector, length ndim). Let \mathbf{s}_a
be the score vector returned by FUN for component a (before
unit-normalisation to obtain \mathbf{q}_a), so that
sv_a = \|\mathbf{s}_a\|; then
R2X_a = sv_a^4 \big/ \sum_k sv_k^4 =
Singular_a^2 \big/ \sum_k Singular_k^2.
SingularSquared L2 norms of the FUN score vectors:
Singular_a = sv_a^2 = \|\mathbf{s}_a\|^2, used to derive
R2X.
MeanList with MeanMB: named list of column-mean
vectors per block, used for mean-centring.
NormList with NormMB: Frobenius norms used for
block normalisation (all ones when normalise = FALSE).
variable.blockCharacter vector (length p_{tot})
indicating the block name of each row in P.loadings.
runtimeTotal computation time in seconds.
Jouan-Rimbaud Bouveresse D, Rutledge DN (2024). A synthetic review of some recent extensions of ComDim. Journal of Chemometrics, 38(5), e3454. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/cem.3454")}
b1 <- matrix(rnorm(500), 10, 50) # 10 samples, 50 variables
b2 <- matrix(rnorm(800), 10, 80) # 10 samples, 80 variables
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
if (requireNamespace("ica", quietly = TRUE)) {
fun.ICA <- function(W, ndim, ...) {
# W is the concatenated MB.
# ndim is the number of components.
result <- ica::ica(W, ndim)
# The function must return the source estimates (analogous to PCA scores).
return(result$S)
}
resultsICA <- ComDim_Exploratory(mb,
ndim = 2,
FUN = fun.ICA,
method = "ICA"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.