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.
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"
