| cp_int2 {rrcov3way} | R Documentation |
ATLD-ALS algorithm for Candecomp/Parafac (CP)
Description
Integrated algorithm combining ATLD and ALS for the minimization of the Candecomp/Parafac (CP) loss function.
Usage
cp_int2(
X,
n,
m,
p,
ncomp,
initconv = 0.01,
conv = 1e-06,
const = "none",
start = "random",
maxit = 5000,
trace = FALSE
)
Arguments
X |
A three-way array or a matrix. If |
n |
Number of A-mode entities |
m |
Number of B-mode entities |
p |
Number of C-mode entities |
ncomp |
Number of components to extract |
initconv |
Convergence criterion for the initialization phase (ATLD),
default is |
conv |
Convergence criterion, default is |
const |
Optional constraints for each mode. Can be a three element
character vector or a single character, one of |
start |
Initial values for the A, B and C components. Can be
|
maxit |
Maximum number of iterations, default is |
trace |
Logical, provide trace output. |
Value
The result of the decomposition as a list with the following elements:
-
fitValue of the loss function -
fpFit value expressed as a percentage -
ssSum of squares -
AComponent matrix for the A-mode -
BComponent matrix for the B-mode -
CComponent matrix for the C-mode -
iterNumber of iterations -
tripcosMinimal triple cosine between two components across the three component matrices, used to inspect degeneracy -
mintripcosMinimal triple cosine during the iterative algorithm observed at every 10 iterations, used to inspect degeneracy -
ftiterMatrix containing in each row the function value and the minimal triple cosine at every 10 iterations -
constOptional constraints (same as the input parameterconst)
Note
The argument const should be a three element character vector.
Set const[j]="none" for unconstrained update in j-th mode weight
matrix (the default),
const[j]="orth" for orthogonal update in j-th mode weight matrix or
const[j]="zerocor" for zero correlation between the extracted
factors.
The default is unconstrained update for all modes.
The loss function to be minimized is sum(k)|| X(k) - A D(k) B' ||^2,
where D(k) is a diagonal matrix holding the k-th row of
C.
Author(s)
Valentin Todorov, valentin.todorov@chello.at; Violetta Simonacci, violetta.simonacci@unina.it
References
H.-L. Wu, M. Shibukawa, K. Oguma, An alternating trilinear decomposition algorithm with application to calibration of HPLC-DAD for simultaneous determination of overlapped chlorinated aromatic hydrocarbons, Journal of Chemometrics 12 (1998) 1–26.
Simonacci, V. and Gallo, M. (2020). An ATLD–ALS method for the trilinear decomposition of large third-order tensors, Soft Computing 24 13535–13546.
Todorov, V. and Simonacci, V. and Gallo, M. and Trendafilov, N. (2023). A novel estimation procedure for robust CANDECOMP/PARAFAC model fitting. Econometrics and Statistics. In press.
Examples
## Not run:
## Example with the OECD data
data(elind)
dim(elind)
res <- cp_int2(elind, ncomp=3)
res$fp
res$fp
res$iter
res <- cp_int2(elind, ncomp=3, const="orth")
res$A
## End(Not run)