Fits a symmetric CP model sum_r lambda_r * u_r^(o m) to a symmetric
tensor by minimizing the Frobenius residual over the weights and the shared
factor matrix with L-BFGS-B, mirroring the MATLAB Tensor Toolbox cp_sym.
Usage
cp_sym(
X,
R,
init = "random",
maxiters = 500L,
factr = 1e+07,
symmetrize = FALSE,
printitn = 0L
)Arguments
- X
A symmetric Tensor (all modes the same size).
- R
Number of symmetric rank-one components.
- init
"random"or ann x Rmatrix of initial factors.- maxiters
Maximum optimizer iterations (default
500).- factr
optimL-BFGS-Bfactrconvergence parameter.- symmetrize
Logical; if
TRUE, symmetrizeXfirst instead of requiring exact symmetry.- printitn
If positive, print the optimizer trace.
Details
With t_r = <X, u_r^(o m)> and c_rs = u_r . u_s, the objective is
||X||^2 - 2 sum_r lambda_r t_r + sum_rs lambda_r lambda_s c_rs^m, whose
gradients are evaluated exactly using ttsv().