View source: R/standardNormalVariate.R
standardNormalVariate | R Documentation |
This function normalizes each row of an input matrix by subtracting each row by its mean and dividing it by its standard deviation
standardNormalVariate(X)
X |
a numeric matrix of spectral data (optionally a data frame that can be coerced to a numerical matrix). |
SNV is simple way for normalizing spectral data that intends to correct for light scatter. It operates row-wise:
\mjdeqnSNV_i = \fracx_i - \barx_is_iSNV_i = \fracx_i - \barx_is_i
where \mjeqnx_ix_i is the signal of the \mjeqniith observation, \mjeqn\barx_i\barx_i is its mean and \mjeqns_is_i its standard deviation.
a matrix of normalized spectral data.
Antoine Stevens
Barnes RJ, Dhanoa MS, Lister SJ. 1989. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Applied spectroscopy, 43(5): 772-777.
msc
, detrend
, blockScale
,
blockNorm
data(NIRsoil)
NIRsoil$spc_snv <- standardNormalVariate(X = NIRsoil$spc)
# 10 first snv spectra
matplot(
x = as.numeric(colnames(NIRsoil$spc_snv)),
y = t(NIRsoil$spc_snv[1:10, ]),
type = "l",
xlab = "wavelength, nm",
ylab = "snv"
)
## Not run:
apply(NIRsoil$spc_snv, 1, sd) # check
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.