Skip to contents

Explained variance ratio from the SVD of the centred data matrix (hmevr)

Usage

morie_geron_explained_variance_ratio_alt(X, n_components = NULL, center = TRUE)

Arguments

X

Data (m, n).

n_components

Truncate to leading k (default all).

center

Subtract column means.

Value

List with explained_variance_ratio, explained_variance, singular_values, cumulative, n_for_95.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_explained_variance_ratio_alt(V)
#> $explained_variance_ratio
#> [1] 1
#> 
#> $explained_variance
#> [1] 6
#> 
#> $singular_values
#> [1] 6.480741
#> 
#> $cumulative
#> [1] 1
#> 
#> $total_variance
#> [1] 6
#> 
#> $n_for_95
#> [1] 1
#> 
#> $components
#>      [,1]
#> [1,]    1
#> 
#> $centered
#> [1] TRUE
#> 
#> $estimate
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "EVR from the SVD of the centred data matrix"
#>