Type: Package
Title: Whitening Data as Preparation for Blind Source Separation
Version: 0.1
Date: 2021-03-25
Maintainer: Markus Matilainen <markus.matilainen@outlook.com>
Imports: Rcpp (≥ 0.11.0)
LinkingTo: Rcpp, RcppArmadillo
Description: Whitening is the first step of almost all blind source separation (BSS) methods. A fast implementation of whitening for BSS is implemented to serve as a lightweight dependency for packages providing BSS methods.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
NeedsCompilation: yes
Packaged: 2021-03-25 14:05:39 UTC; manmat
Author: Markus Matilainen ORCID iD [cre, aut], Klaus Nordhausen ORCID iD [aut]
Repository: CRAN
Date/Publication: 2021-03-29 09:32:16 UTC

Whitening Data as Preparation for Blind Source Separation

Description

Whitening is the first step of almost all blind source separation (BSS) methods. A fast implementation of whitening for BSS is implemented to serve as a lightweight dependency for packages providing BSS methods.

Details

Package: BSSprep
Type: Package
Version: 0.1
Date: 2021-03-25
License: GPL (>= 2)

This package contains the single function BSSprep for whitening multivariate data as a preprocessing step for blind source separation (BSS). The package is meant as a fast and lightweight dependency for packages providing BSS methods as whitening is almost always the first step.

Author(s)

Markus Matilainen, Klaus Nordhausen

Maintainer: Markus Matilainen <markus.matilainen@outlook.com>


Whitening of Multivariate Data

Description

A function for data whitening.

Usage

BSSprep(X)

Arguments

X

A numeric matrix. Missing values are not allowed.

Details

A p-variate {\bf Y} with T observations is whitened, i.e. {\bf Y}={\bf S}^{-1/2}({\bf X}_t - \frac{1}{T}\sum_{t=1}^T {\bf X}_{t}), for t = 1, \ldots, T, where {\bf S} is the sample covariance matrix of {\bf X}.

This is often need as a preprocessing step like in almost all blind source separation (BSS) methods. The function is implemented using C++ and returns the whitened data matrix as well as the ingredients to back transform.

Value

A list containing the following components:

Y

The whitened data matrix.

X.C

The mean-centered data matrix.

COV.sqrt.i

The inverse square root of the covariance matrix of X.

MEAN

Mean vector of X.

Author(s)

Markus Matilainen, Klaus Nordhausen

Examples

n <- 100
X <- matrix(rnorm(10*n) - 1, nrow = n, ncol = 10)

res1 <- BSSprep(X)
res1$Y # The whitened matrix
colMeans(res1$Y) # should be close to zero
cov(res1$Y) # should be close to the identity matrix
res1$MEAN # Should hover around -1 for all 10 columns