Skip to contents

The goal is k such that lambda_1..lambda_k are all SMALL and lambda_{k+1} is relatively LARGE – not simply the largest gap anywhere in the spectrum. gaps is returned in full so a caller can see whether the choice was clear-cut.

Usage

Eigengap(values, kmax = NULL)

Arguments

values

Laplacian eigenvalues in INCREASING order.

kmax

Largest k considered.

Value

List with k, gap, gaps, values, n_zero, kmax.

Details

Formula: gamma_k = |lambda_k - lambda_{k+1}|; khat = argmax_k gamma_k

References

von Luxburg (2007), A Tutorial on Spectral Clustering, Statistics and Computing 17(4), 395-416, Section 8.3.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Eigengap(V)
#> $k
#> [1] 1
#> 
#> $gap
#> [1] 1
#> 
#> $gaps
#> [1] 1 1 1 1 1 1 1
#> 
#> $values
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $n_zero
#> [1] 0
#> 
#> $kmax
#> [1] 7
#> 
#> $method
#> [1] "Eigengap heuristic, von Luxburg (2007) Section 8.3"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"