Given a FEEM cube, model the fluorescence and the scattering signals at the same time as a sum of a PARAFAC model and a low-rank unfolded matrix factorisation.
feemflame(
X, ffac, sfac, maxiter = 32, widths = rep(25, 4), Raman.shift = 3400,
ctol = 1e-04, progress = TRUE, control.parafac, control.cmf
)
# S3 method for feemflame
fitted(object, ...)
# S3 method for feemflame
residuals(object, ...)
# S3 method for feemflame
coef(
object, type = c(
"fluorescence",
"scores", "loadings", "emission", "excitation", "samples",
"scattering", "sc.scores", "sc.loadings"
), ...
)
# S3 method for feemflame
plot(
x, type = c('both', 'fl.image', 'fl.lines'), ...
)
An object of class feemflame
, which is a list containing the
following components:
A feemparafac
object containing the fluorescence
part of the model.
An object of internal class cmf
. Please don't rely on its
structure.
A feemcube
object containing the part of X
fitted by the model.
A feemcube
object equal to \(
\mathbf{X} - \hat{\mathbf{X}}
\), with an extra class
feem.resid
set. Objects of this class are plotted with a
different default palette, see plot.feem.resid
.
See the description of the type
argument.
A feemcube
object.
The number of trilinear components used to model fluorescence,
passed to feemparafac
.
The number of bilinear (low-rank matrix factorisation) components used to model the scattering signal.
Maximum number of alternating PARAFAC and constrained matrix factorisation iterations.
Widths of the scattering regions, like in feemscatter
:
A numeric vector of length 4 containing the widths (in nm) of the
scattering signal, in the following order:
Rayleigh scattering
Raman scattering
Rayleigh scattering, \(2\lambda\)
Raman scattering, \(2\lambda\)
Raman shift of the scattering signal, in
\(\textrm{cm}^{-1}\), like in
feemscatter
.
Given \( L = ||\mathbf X - \hat{\mathbf X}||^2 \), stop when \( \frac{|\Delta L|}{L} \le \mathtt{ctol} \).
Print progress information on the console, including the iteration number, relative sum of squared residuals, and relative change in sum of squared residuals.
Named lists of additional arguments to be passed to the underlying
functions. Both default to list(ctol = 1e-4, maxit = 10)
,
which makes both steps to run for 10 iterations or stop
when the absolute change in \(R^2\) is less
than \(10^{-4}\), whichever happens
sooner.
A feemflame
object.
Determines the type of coefficients to return:
Equivalent to calling coef.feemparafac
on the
fluorescence model (default).
Equivalent to calling coef.feemparafac
on the
fluorescence model and passing the respective type
argument.
A data.frame
containing the following columns:
Sample numbers or names.
Scattering intensity value for a given factor.
The number of the scattering component.
A data.frame
containing the following columns:
The wavelengths corresponding to the value of the scattering profile.
Scattering intensity value for a given factor.
The number of the scattering component.
A list with names “scores” and “loadings”
containing results of coef(object, 'sc.scores')
and
coef(object, 'sc.loadings')
, respectively.
Describes the kind of plot to produce:
Plot the loadings of the fluorescence and scattering models as false colour images.
Equivalent to calling plot.feemparafac
on the
fluorescence model with the argument “image” or
“lines”, respectively.
No other parameters are allowed.
FLAME models the input data as a sum of fluorescence signal (PARAFAC model) and scattering signal (low rank model):
$$ X_k(\lambda^\mathrm{em}_i, \lambda^\mathrm{ex}_j) = \underbrace{\sum_p A_{i,p} B_{j,p} C_{k,p}}_{\mbox{fluorescence}} + \underbrace{\sum_q S_{i,j,q} D_{k,q}}_{\mbox{scattering}} $$
The function alternates between fitting the PARAFAC model on the
dataset with scattering signal subtracted and fitting the low-rank
model on the dataset with fluorescence signal subtracted. The PARAFAC
model is fitted using the feemparafac
function. The
low-rank model is fitted by means of unfolding the wavelength
dimensions into one, resulting in a matrix, followed by the same
alternating least squares procedure as done in multivariate curve
resolution. Both models are constrained to result in non-negative
factors.
The low-rank model is additionally constrained to zero outside the
scattering region. The scattering region is defined the same way as in
feemscatter
, using the widths
and the
Raman.shift
arguments.
Initial PARAFAC model is fitted with the scattering region set to missing. The low-rank model is initialised with truncated singular value decomposition forced to be non-negative.
albatross:::.Rdreference('Tauler1998')
albatross:::.Rdreference('Krylov2021') https://files.libs.chem.msu.ru/~ivan/SSC17/P13.pdf.
feemparafac
, feemcube
# \donttest{
data(feems)
cube <- feemscale(cube)
factors <- feemflame(cube, ffac = 3, sfac = 1)
str(coef(factors))
str(coef(factors, 'scattering'))
plot(factors)
# }
Run the code above in your browser using DataLab