cm.nsr {visa} | R Documentation |
Selecting the best 2-Band combinations for Normalized Simple Ratio (NSR)
Description
This function develops a optimization algorithm based on correlation analysis between spectral matrix 'spectra' and the vegetation variable of interest x, which determines the best spectral band combinations of the full spectrum that are most predictive for 'x'.
Usage
cm.nsr(S, x, w = wavelength(S), w.unit = NULL, cm.plot = FALSE)
Arguments
S |
A matrix of spectral data, a row is a spectrum across all spectral bands. |
x |
A vector. |
w |
A vector of wavelength. |
w.unit |
Character string, default = NULL, |
cm.plot |
A logic value for whether plotting the coefficient matrix or not, default FALSE. |
Details
This function runs a calculation of
NDVI = (\lambda_i - \lambda_j)/(\lambda_i + \lambda_j)
using all the possible pairs/combinations of any two bands (i,j) within the full spectrum range thoroughly. A correlation analysis is then performed between the x and all possible NDVIs, and it calculates the correlation coefficients (r) which indicates the predictive performance of each NDVI and its corresponding two-band combination. The output is the wavelength (nm) indicating the best two bands that produce the highest value of r.
Value
cm |
Returns a correlation coefficients matrix. |
See Also
Examples
library(visa)
data(NSpec.DF)
x <- NSpec.DF$N # nitrogen
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 5)] # resampled to 5 nm steps
cm <- cm.nsr(S, x, cm.plot = TRUE)