Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

standardNormalVariate

Standard normal variate transformation


Description

This function normalizes each row of an input matrix by subtracting each row by its mean and dividing it by its standard deviation

Usage

standardNormalVariate(X)

Arguments

X

a numeric matrix of spectral data (optionally a data frame that can be coerced to a numerical matrix).

Details

SNV is simple way for normalizing spectral data that intends to correct for light scatter. It operates row-wise:

where \(x_i\) is the signal of the \(i\)th observation, \(\bar{x}_i\) is its mean and \(s_i\) its standard deviation.

Value

a matrix of normalized spectral data.

Author(s)

Antoine Stevens

References

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.

See Also

Examples

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)

prospectr

Miscellaneous Functions for Processing and Sample Selection of Spectroscopic Data

v0.2.1
MIT + file LICENSE
Authors
Antoine Stevens [aut, cre] (<https://orcid.org/0000-0002-1588-7519>), Leonardo Ramirez-Lopez [aut, cre] (<https://orcid.org/0000-0002-5369-5120>), Guillaume Hans [ctb] (<https://orcid.org/0000-0002-6503-5760>)
Initial release
2020-10-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.