cm.sr | R Documentation |
This function develops an optimization algorithm based on correlation analysis between the spectral matrix spectra
and the
vegetation variable of interest x
. It determines the best spectral band combinations of the full spectrum that are most predictive for x
.
cm.sr(S, x, w = wavelength(S), w.unit = NULL, cm.plot = FALSE)
S |
A matrix of spectral data, where each row is a spectrum across all spectral bands. |
x |
A numeric vector (e.g., a vegetation variable). |
w |
A numeric vector of wavelengths; by default it is derived using |
w.unit |
A character string specifying the unit of wavelengths (default is |
cm.plot |
Logical. If |
This function runs a calculation of
SR = \lambda_i / \lambda_j
using the spectra data for all the possible pairs/combinations of any two bands (i, j)
within the full spectrum range. Next, correlation analysis is then performed between all possible SR values and another vector variable y
, and it returns
the squared Pearson correlation (R^2
) which indicates the predictive performance of each SR and its corresponding two-band combination. The
output is the wavelength (nm) indicating the best two bands that produce the highest value of R^2
.
cm |
Returns a correlation coefficients matrix. |
cm.nsr
## Not run:
library(visa)
data(NSpec.DF)
# Using the example spectra matrix of the spectra.dataframe
X <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 10)] # resampled to 10 nm steps
y <- NSpec.DF$N # nitrogen
cm <- cm.sr(X, y, cm.plot = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.