This algorithm is based on the geometry of convex sets. It exploits the fact that endmembers occupy the vertices of a simplex.

vca(data, p, method = c("nascimento", "lopez"))

Arguments

data

Data matrix. It will be converted to a matrix using as.matrix. The matrix should contain a spectrum per row. If dimension of the data is higher than p, vca_dr is applied to reduce the data to p dimensions before running projections.

p

Number of endmembers.

method

The VCA algorithm to use. Options:

Default: nascimento.

Value

A list which contains:

  • indices: sorted indices of the calculated endmembers.

  • projection_vectors: projection vectors in iteration order, included only when debuglevel >= 1.

  • unsorted_indices: unsorted list of indices, i.e., in the same order as iteration, included only when debuglevel >= 1.

The returned object has classes c("vca", "pure_endmembers") and can be passed directly to abundances.

See also

endmembers to extract the spectra; abundances to determine abundances of endmembers in each sample.

Examples

data(demo_data)
vca_demo <- vca(demo_data, p = 2)
em <- endmembers(vca_demo, demo_data)
matplot(t(em), type = "l")