explainedVariation: Compute Explained Variation from Loadings

View source: R/explainedVariation.R

explainedVariationR Documentation

Compute Explained Variation from Loadings

Description

explainedVariation computes the explained variation for each whitened variables from the loadings (both covariance loadings and correlation loadings).

Usage

  explainedVariation(Phi)

Arguments

Phi

Loading matrix (with columns referring to whitened variables).

Details

explainedVariation computes for each column of the loading matrix the sum of squares of the elements in that column.

Value

explainedVariation returns a vector with the explained variation contributed by each whitened variable.

Author(s)

Korbinian Strimmer (https://strimmerlab.github.io).

References

Kessy, A., A. Lewin, and K. Strimmer. 2018. Optimal whitening and decorrelation. The American Statistician. 72: 309-314. <DOI:10.1080/00031305.2016.1277159>

See Also

whiteningLoadings

Examples

# load whitening library
library("whitening")

######

# example data set
# E. Anderson. 1935.  The irises of the Gaspe Peninsula.
# Bull. Am. Iris Soc. 59: 2--5
data("iris")
X = as.matrix(iris[,1:4])
d = ncol(X) # 4
n = nrow(X) # 150
colnames(X) # "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"

# estimate covariance
S = cov(X)

# PCA-cor loadings
ldgs = whiteningLoadings(S, method="PCA-cor")

# Explained variation from correlation loadings
explainedVariation( ldgs$Psi )



whitening documentation built on June 7, 2022, 5:10 p.m.