spectralNMF: Perform Non-Negative Matrix factorization on spectral data

spectralNMFR Documentation

Perform Non-Negative Matrix factorization on spectral data

Description

Perform Non-Negative Matrix factorization on spectral data

Usage

spectralNMF(
  object,
  rank,
  method = "PGNMF",
  initSpectralData = NULL,
  nruns = 10,
  subsamplingFactor = 1,
  checkDivergence = TRUE,
  maxIter = 1000,
  includeRefs = FALSE
)

Arguments

object

SpectraInTime-class

rank

number of NMF components to be found

method

name of the NMF method to be used. "PGNMF" (default), "HALSacc" and "semiNMF" are methods derived from the hNMF package. All methods from the NMF package are also available.

initSpectralData

this can be a list of spectralData objects, containing the pure component spectra. It can also be either of the NMF factor matrices with initial values

nruns

number of NMF runs. It is recommended to run the NMF analyses multiple times when random seeding is used, to avoid a suboptimal solution

subsamplingFactor

subsampling factor used during NMF analysis

checkDivergence

Boolean indicating whether divergence checking should be performed

maxIter

maximum number of iterations per NMF run

includeRefs

boolean, indicating whether references should be included in the input matrix for the NMF analysis

Value

SpectraInTimeComp-class which includeds a scaled NMF model (in accordance with the NMF package definition)

SpectraInTimeComp-class

Author(s)

Nicolas Sauwen

Examples


 spectralExample    <-  getSpectraInTimeExample()
 nmfResult          <-  spectralNMF( spectralExample , rank = 2 , subsamplingFactor = 5 )
  nmfObject         <-  getDimensionReduction( nmfResult , type = "NMF")$NMF
  nmfTrends         <-  t( NMF::coef( nmfObject ) )
  matplot( nmfTrends , type = "l" , x = getTimePoints( spectralExample , timeUnit = "hours"  ),
		 xlab = "time in hours"  )


spectralAnalysis documentation built on Jan. 11, 2023, 5:15 p.m.