Parallel Factor Analysis
parafac(
Tensor,
nfac,
nstart = 1,
maxit = 500,
max_fn = 10000,
ctol = 1e-04,
rel_tol = 1e-08,
abs_tol = 1e-08,
grad_tol = 1e-08,
initialization = "random",
method = "als",
verbose = FALSE,
output = "best",
sortComponents = FALSE
)
List object of the PARAFAC model or models.
3-way matrix of numeric data
Number of factors (components) to fit.
Number of models to randomly initialize (default 1).
Maximum number of iterations allowed without convergence in the ALS case (default 500).
Maximum number of function evaluations allowed without convergence in the OPT case (default 10000).
Relative change in loss tolerated to call the algorithm converged in the ALS case (default 1e-4).
Relative change in loss tolerated to call the algorithm converged in the OPT case (default 1e-8).
Absolute loss tolerated to call the algorithm converged in the OPT case (default 1e-8).
Tolerance on the two-norm of the gradient divided over the number of elements in the gradient in the OPT case (default 1e-8).
"Random" for randomly initialized input vectors or "nvec" for svd-based best guess.
Use ALS algorithm ("als", default) or use all-at-once optimization ("opt"). The all-at-once optimization is based on a nonlinear conjugate gradient method with Hestenes-Stiefel updates and the More-Thuente line search algorithm.
String ("best"/"all") Return only the best model of the nstart models ("best") or return all of them in a list object ("all").
Boolean to sort the components based on their variance explained (default FALSE)
X = array(rnorm(108*100*10), c(108,100,10))
model = parafac(X, 2)
Run the code above in your browser using DataLab