decomp_recomp: Decompose/Recompose

Description Usage Arguments Value Author(s) References Examples

View source: R/decomp_recomp.r

Description

Exclude the variance contributed by the principal components enumerated in the vector exclude from the data matrix.

Usage

1
decomp_recomp(x, exclude, center = TRUE, scale = FALSE)

Arguments

x

A matrix or ddmatrix of numeric values.

exclude

A vector of positive integer values which are the principal components whose variance contribution should be removed.

center

Logical; determines if the matrix should be centered first.

scale

Logical; determines if the matrix should be scaled first.

Value

A matrix or ddmatrix, matching the same type as the input x.

Author(s)

Drew Schmidt

References

Inspired by a question from Ahmed Moustafa: https://twitter.com/AhmedMoustafa/status/646310686725812224

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## TODO add mpirun message boilerplate
library(pbdDMAT)
init.grid()

x <- ddmatrix("rnorm", nrow=100, ncol=10, bldim=c(2,2))
# Remove the contribution of PC 1's variance
decomp_recomp(x, 1)

finalize()

## End(Not run)

RBigData/pbdML documentation built on July 12, 2019, 6:12 p.m.