makevexp: Utility for computing the variance explained by a set of...

Description Usage Arguments Value Author(s) Examples

View source: R/makevexp.R

Description

Utility for computing the variance explained by a set of components

Usage

1
makevexp(scores, X, unc = FALSE)

Arguments

scores,

a matrix of components scores

X

the data matrix.

unc

logical, are the components orthogonal.

Value

a vector with the variance explained by each component

Author(s)

Giovanni Merola

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
 if(FALSE){
   A = matrix(c(rep(1, 16), rep(c(-1, 0.5, 1, 0.5), 4)), 16, 2)
   sc = hitters %*% A
   makevexp(sc, hitters, FALSE)

 ## this is wrong
   makevexp(sc, hitters, TRUE)

 ## because the components are not orthogonal
   cor(sc)
 }
}

merolagio/LSSPCA documentation built on April 29, 2021, 4:17 p.m.