ComDim_Exploratory: ComDim_Exploratory - Extending matrix decomposition methods...

View source: R/ComDim_Exploratory.R

ComDim_ExploratoryR Documentation

ComDim_Exploratory - Extending matrix decomposition methods to multi-block data.

Description

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.

Usage

ComDim_Exploratory(
  MB = MB,
  ndim = NULL,
  FUN = FUN,
  normalise = FALSE,
  threshold = 1e-10,
  loquace = FALSE,
  method = "FUN",
  ...
)

Arguments

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 W (salience-weighted concatenated blocks) and ndim as its first two arguments, and return a matrix of scores with one column per component.

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 FUN.

Value

A ComDim object. Slots for supervised analysis (R2Y, Q2, DQ2, VIP, VIP.block, PLS.model, cv, Prediction) are empty. The populated slots are:

Method

The label supplied via the method argument.

ndim

Number of Common Dimensions extracted.

Q.scores

Global 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.scores

Named 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.loadings

Global 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.

Saliences

Block 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.

R2X

Proportion 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.

Singular

Squared L2 norms of the FUN score vectors: Singular_a = sv_a^2 = \|\mathbf{s}_a\|^2, used to derive R2X.

Mean

List with MeanMB: named list of column-mean vectors per block, used for mean-centring.

Norm

List with NormMB: Frobenius norms used for block normalisation (all ones when normalise = FALSE).

variable.block

Character vector (length p_{tot}) indicating the block name of each row in P.loadings.

runtime

Total computation time in seconds.

References

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")}

Examples

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"
  )
}

R.ComDim documentation built on May 13, 2026, 9:07 a.m.