tlsce {BCE}R Documentation

Total Least Squares Composition Estimator

Description

estimates a matrix X for which:

(A+ε_A)X = B+ε_B

minimize sum{ε_A^2 + ε_B^2}

sum{X_{i,}}=1 forall i

X>0

the elements of ε_A are NULL if the corresponding elements of A are NULL. A typically contains biomarker concentrations for several taxonomic groups, and B field measurements of the same biomarkers. X is then an estimate of the taxonomic composition of the field sample.

Usage

tlsce(A, B, Wa=NULL, optimizationfunction="nlminb",
  A_init=A, Xratios=TRUE, ...)

Arguments

A a matrix or data frame. If A contains biomarker data for taxonomic groups, the biomarkers have to be organized per row, and the taxonomic groups per column.
B a matrix or data frame. If B contains biomarker field data, the biomarkers have to be organized per row, and the samples per column.
Wa weighting of A, a matrix with the same dimensions of A. If Wa=NULL, Wa defaults to 1. This parameter can be used to give more importance to elements of A or A in total compared to B. Weighting of B is not possible. the weights are implemented as proportional to 1/s (as opposed to 1/s^2) with s the standard deviation of the error term.
optimizationfunction the function used for the optimization of A (one of "nlminb","optim","constrOptim").
A_init a matrix with the same structure as A. a general, non-linear optimization routine (default nlminb) is used to minimize the sum of squared residuals of A versus the fitted matrix A_fit (see falue). This optimization routine requires a set of starting values, by default the non-zero elements of A. This provides a good fit, but when in doubt about the convergence of the algorithm, one can provide different starting values for the optimization routine in A_init.
Xratios TRUE or FALSE: are the colSums of the matrix X equal to 1? This is for example the case in a compositional matrix.
... Arguments to be passed to the optimization function in use.

Details

instead of a linear least squares regression, in which the elements of A would be fixed, the function tlsce includes the non-zero elements of A in the least squares regression. This is similar to other total least squares regression methods, with the main difference that only non-zero elements of A contain an error term.

Value

A list with the following elements:

X Array with dimension c(ncol(A),ncol(B), iter) containing the species composition of each sample
A_fit Array with same dimension as A, containing the best-fit values of the input biomarker data per taxonomic group
B_fit Array with same dimension as B, containing the biomarker field data, corresponding to Afit
solutionNorms a vector of 3 values:
the value of the minimised quadratic function at the solution, in this case sum((Afit-A)*Wa)^2 + (Bfit-B)^2),
and the shares of this value attributed to A and to B
convergence An integer code. '0' indicates successful convergence.

Author(s)

Karel Van den Meersche <k.vdmeersche@nioo.knaw.nl>, Karline Soetaert <k.soetaert@nioo.knaw.nl>

References

Van den Meersche, K., K. Soetaert and J.J. Middelburg (2008) A Bayesian compositional estimator for microbial taxonomy based on biomarkers, Limnology and Oceanography Methods 6, 190-199

See Also

BCE

Examples

A <- t(bceInput$Rat)
B <- t(bceInput$Dat)
tlsce(A,B)
## weighting Wa inversely proportional to A
tlsce(A,B,Wa=1/A)

[Package BCE version 1.4 Index]