Learn R Programming

phytoclass (version 2.3.1)

Steepest_Descent: Performs the steepest descent algorithm for a set number of iterations to optimize the F matrix of pigment ratios.

Description

Performs the steepest descent algorithm for a set number of iterations to optimize the F matrix of pigment ratios.

Usage

Steepest_Descent(Fmat, place, S, S_weights, num.loops)

Value

A list containing: 1: The optimized F matrix 2: Final RMSE value 3: The C matrix (class abundances for each group)

Arguments

Fmat

Initial F matrix containing pigment ratios

place

Vector of indices where F matrix has non-zero values

S

Matrix of sample measurements (rows) and pigments (columns)

S_weights

Vector of weights for each pigment in NNLS optimization

num.loops

Maximum number of iterations to perform optimization

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)
 num.loops <- 2
 # Run Steepest_Descent
 result <- phytoclass:::Steepest_Descent(Fmat, place, S, S_weights, num.loops)

Run the code above in your browser using DataLab