Learn R Programming

phytoclass (version 2.3.1)

Minimise_elements_comb: Part of the steepest descent algorithm

Description

Part of the steepest descent algorithm

Usage

Minimise_elements_comb(Fmat, place, S, cm, c1_num = c(1, 2, 3))

Value

A list containing the F matrix with updated ratios, the RMSE of new estimates, and an updated C matrix of estimated group contribution.

Arguments

Fmat

The F matrix

place

A vector of indices indicating which elements to adjust

S

A matrix of samples (rows) and pigments (columns)

cm

A vector of bounded weights for each pigment

c1_num

A numeric vector (1, 2, or 3) indicating which scaler values to use

Examples

Run this code
 Fmat <- as.matrix(phytoclass::Fm)
 S <- as.matrix(phytoclass::Sm)
 S_weights <- as.numeric(phytoclass:::Bounded_weights(S))
 place <- which(Fmat[, seq(ncol(Fmat) - 2)] > 0)

 # Get F_initial from NNLS_MF as done in Steepest_Descent
 F_initial <- phytoclass::NNLS_MF(Fmat, S, S_weights)

 # Run Minimise_elements_comb with c1_num = 3 (as in Steepest_Descent)
 result <- phytoclass:::Minimise_elements_comb(
   F_initial[[1]], place, S, S_weights, c1_num = 3
 )

Run the code above in your browser using DataLab