R/vca.R
vca.RdThis 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"))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.
Number of endmembers.
The VCA algorithm to use. Options:
nascimento (vca_nascimento)
lopez (vca_lopez)
Default: nascimento.
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.
endmembers to extract the spectra; abundances
to determine abundances of endmembers in each sample.
data(demo_data)
vca_demo <- vca(demo_data, p = 2)
em <- endmembers(vca_demo, demo_data)
matplot(t(em), type = "l")