Description Usage Arguments Details Value Author(s) References See Also Examples
Select the number of significant singular values, by finding the ‘elbow’ of the scree plot, in a principled way.
1 2  | 
X | 
 an object of class   | 
k | 
 The embedding dimensionality. Defaults to  
  | 
edge.attr | 
 the names of the attribute to use for weights if   | 
n | 
 default value: 3; the number of returned elbows.  | 
threshold | 
 either   | 
plot | 
 logical. When   | 
The input of the function is a numeric vector which contains the measure of ‘importance’ for each dimension.
For spectral embedding, these are the singular values of the adjacency matrix. The singular values are assumed to be generated from a Gaussian mixture distribution with two components that have different means and same variance. The dimensionality d is chosen to maximize the likelihood when the d largest singular values are assigned to one component of the mixture and the rest of the singular values assigned to the other component.
This function can also be used for the general separation problem, where we assume that the left and the right of the vector are coming from two Normal distributions, with different means, and we want to know their border. See examples below.
list containing the following:
valueThe singular values associated with each elbow in elbow.
elbowThe indices of the elbows.
plotIf plot is TRUE, contains a scree plot annotated with the elbows.
Youngser Park youngser@jhu.edu, Gabor Csardi csardi.gabor@gmail.com, and Eric Bridgeford ericwb95@gmail.com.
M. Zhu, and A. Ghodsi (2006). Automatic dimensionality selection from the scree plot via the use of profile likelihood. Computational Statistics and Data Analysis, Vol. 51, 918–930.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  | # Generate the two groups of singular values with
# Gaussian mixture of two components that have different means
sing.vals  <- c( rnorm (10, mean=1, sd=1), rnorm(10, mean=3, sd=1) )
dim.chosen <- gs.dim.select(sing.vals)
dim.chosen
# Sample random vectors with multivariate normal distribution
# and normalize to unit length
lpvs <- matrix(rnorm(200), 10, 20)
lpvs <- apply(lpvs, 2, function(x) { (abs(x) / sqrt(sum(x^2))) })
RDP.graph  <- sample_dot_product(lpvs)
gs.dim.select( embed_adjacency_matrix(RDP.graph, 10)$D )
# Sample random vectors with the Dirichlet distribution
lpvs.dir    <- sample_dirichlet(n=20, rep(1, 10))
RDP.graph.2 <- sample_dot_product(lpvs.dir)
gs.dim.select( embed_adjacency_matrix(RDP.graph.2, 10)$D )
# Sample random vectors from hypersphere with radius 1.
lpvs.sph    <- sample_sphere_surface(dim=10, n=20, radius=1)
RDP.graph.3 <- sample_dot_product(lpvs.sph)
gs.dim.select( embed_adjacency_matrix(RDP.graph.3, 10)$D )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.