Function vanderMonde() generates Vandermonde matrices, the hyperSpec method generates a hyperSpec object containing the Vandermonde matrix of the wavelengths of a hyperSpec object.

vanderMonde(x, order, ...)

# S4 method for hyperSpec
vanderMonde(x, order, ..., normalize.wl = normalize_01)

Arguments

x

object to evaluate the polynomial on

order

of the polynomial

...

hyperSpec method: further arguments to decomposition()

normalize.wl

function to transform the wavelengths before evaluating the polynomial (or other function). normalize_01() maps the wavelength range to the interval [0, 1]. Use base::I() to turn off.

Value

Vandermonde matrix

hyperSpec method: hyperSpec object containing Vandermonde matrix as spectra and an additional column $.vdm.order giving the order of each spectrum (term).

Details

It is often numerically preferable to map wl(x) to [0, 1], see the example.

See also

wl_eval() for calculating arbitrary functions of the wavelength

normalize_01()

Author

C. Beleites

Examples

plot(vanderMonde(flu, 2))

plot(vanderMonde(flu, 2, normalize.wl = I))