whitening (version 1.4.0)

explainedVariation: 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).

Value

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

Details

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

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

Run this code
# NOT RUN {
# 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 )


# }

Run the code above in your browser using DataLab