cm.sr: Selecting the best 2-Band combinations for Simple Ratio (SR)

Description Usage Arguments Details Value See Also Examples

View source: R/cm.sr.R

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

1
cm.sr(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 = λ_i / λ_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

cm.nsr

Examples

1
2
3
4
5
library(visa)
data(NSpec.DF)
x <- NSpec.DF$N # nitrogen
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 10)] # resampled to 10 nm steps
cm <- cm.sr(S, x, cm.plot = FALSE)

visa documentation built on April 20, 2021, 9:07 a.m.