Calculates spectral separability by class
Available statistics:
Bhattacharyya distance (Bhattacharyya 1943; Harold 2003) measures the similarity of two discrete or continuous probability distributions.
Jeffries-Matusita (default) distance (Bruzzone et al., 2005; Swain et al., 1971) is a scaled (0-2) version of Bhattacharyya. The J-M distance is asymptotic to 2, where 2 suggest complete separability.
spectral.separability(x, y, jeffries.matusita = TRUE)
x | data.frame, matrix or vector of spectral values must, match classes defined in y |
---|---|
y | A vector or factor with grouping classes, must match row wise values in x |
jeffries.matusita | (TRUE/FALSE) Return J-M distance (default) else Bhattacharyya |
A matrix of class-wise Jeffries-Matusita or Bhattacharyya distance separability values
Bhattacharyya, A. (1943) On a measure of divergence between two statistical populations defined by their probability distributions'. Bulletin of the Calcutta Mathematical Society 35:99-109
Bruzzone, L., F. Roli, S.B. Serpico (1995) An extension to multiclass cases of the Jefferys-Matusita distance. IEEE Transactions on Pattern Analysis and Machine Intelligence 33:1318-1321
Kailath, T., (1967) The Divergence and Bhattacharyya measures in signal selection. IEEE Transactions on Communication Theory 15:52-60
Jeffrey S. Evans jeffrey_evans@tnc.org
#>#> #>#>#> #>#>#> #>d <- 6 # Number of bands n.class <- 5 # Number of classes n <- rep(1000, 5) mu <- round(matrix(rnorm(d*n.class, 128, 1), ncol=n.class, byrow=TRUE), 0) x <- matrix(double(), ncol=d, nrow=0) classes <- integer() for (i in 1:n.class) { f <- svd(matrix(rnorm(d^2), ncol=d)) sigma <- t(f$v) %*% diag(rep(10, d)) %*% f$v x <- rbind(x, mvrnorm(n[i], mu[, i], sigma)) classes <- c(classes, rep(i, n[i])) } colnames(x) <- paste0("band", 1:6) classes <- factor(classes, labels=c("water", "forest", "shrub", "urban", "ag")) # Separability for multi-band (multivariate) spectra spectral.separability(x, classes)#>#> water forest shrub urban ag #> water 0.0000000 0.5222125 0.6930201 0.5661507 0.5772556 #> forest 0.5222125 0.0000000 0.5784187 0.4408988 0.3518784 #> shrub 0.6930201 0.5784187 0.0000000 0.4689764 0.4626040 #> urban 0.5661507 0.4408988 0.4689764 0.0000000 0.5425867 #> ag 0.5772556 0.3518784 0.4626040 0.5425867 0.0000000# Separability for single-band (univariate) spectra spectral.separability(x[,1], classes)#>#> water forest shrub urban ag #> water 0.0000000 0.323189891 0.4735819 0.31380337 0.331823652 #> forest 0.3231899 0.000000000 0.1588724 0.01759146 0.009642274 #> shrub 0.4735819 0.158872383 0.0000000 0.16449753 0.152035332 #> urban 0.3138034 0.017591463 0.1644975 0.00000000 0.026335384 #> ag 0.3318237 0.009642274 0.1520353 0.02633538 0.000000000