Learn R Programming

phytoclass (version 2.3.1)

NNLS_MF: Performs the non-negative matrix factorisation for given phytoplankton pigments and pigment ratios, to attain an estimate of phytoplankton class abundances.

Description

Performs the non-negative matrix factorisation for given phytoplankton pigments and pigment ratios, to attain an estimate of phytoplankton class abundances.

Usage

NNLS_MF(Fn, S, S_weights = NULL)

Value

A list containing

  1. The F matrix (pigment: Chl a) ratios

  2. The root mean square error (RMSE)

  3. The C matrix (class abundances for each group)

Arguments

Fn

Pigment to Chl a matrix

S

Sample data matrix – a matrix of pigment samples

S_weights

Weights for each column

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