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

vca(...)

# S3 method for default
vca(
  data,
  p,
  method = c("05", "Lopez2012"),
  seed = 1L,
  SNR = estSNR(data, p),
  ...,
  EMonly = FALSE
)

# S3 method for formula
vca(formula, frame, p, method = "05", seed = NULL, ...)

Arguments

...

Additional parameters for the methods (currently unused).

data

Data matrix. It will be converted to a matrix using as.matrix. The matrix should contain a spectrum per row.

p

Number of endmembers.

method

The VCA algorithm to use. Options:

Default: 05.

seed

vca05 generates a random vector. Set the random number generator seed with this argument.

SNR

The Signal-to-Noise ratio of the data. By default it will be estimated using estSNR.

EMonly

Boolean that indicates whether the data parameter should be stored in the resulting structure.

formula

Formula object.

frame

Data frame containing the hyperspectral data.

Value

A list which contains:

  • data: the original data.

  • indices: the indices of the calculated endmembers.

See also

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

Examples

data(demo_data)
demo <- vca(demo_data, 2, method = "05")
em <- endmembers(demo)
em <- rbind(demo_data[c(7,9),], em)
em[3:4,] <- em[3:4,] + 0.5 # a small offset for the found em's
matplot(t(em), type = "l",
   col = c("black", "blue", "black", "blue"), lty = c(1, 1, 2, 2),
   xlab = "frequency", ylab = "intensity",
   main = "mvca of demo_data")
leg.txt <- c("Endmember 2", "Endmember 3", "Endmember 2 (found)", "Endmember 3 (found)")
legend("topright", leg.txt, col = c("black", "blue", "black", "blue"),
lty = c(1, 1, 2, 2), cex = 0.75)