deflate_mtx: Matrix Deflation

View source: R/plsda_batch.R

deflate_mtxR Documentation

Matrix Deflation

Description

This function removes the variance of given component t from the input matrix X.

\hat{X} = X - t (t^{\top}t)^{-1}t^{\top}X

It is a built-in function of PLSDA_batch.

Usage

deflate_mtx(X, t)

Arguments

X

A numeric matrix to be deflated. It assumes that samples are on the row, while variables are on the column. NAs are not allowed.

t

A component to be deflated out from the matrix.

Value

A deflated matrix with the same dimension as the input matrix.

Author(s)

Yiwen Wang, Kim-Anh LĂȘ Cao

References

\insertRef

barker2003partialPLSDAbatch

Examples

# A built-in function of PLSDA_batch, not separately used.
# Not run
data('AD_data')
library(mixOmics)
library(TreeSummarizedExperiment)

X <- assays(AD_data$EgData)$Clr_value
ad_pca <- pca(X, ncomp = 3)
# the matrix without the information of PC1:
ad.def.mtx <- deflate_mtx(X, ad_pca$variates$X[ ,1])



EvaYiwenWang/PLSDAbatch documentation built on Sept. 25, 2024, 8:54 p.m.