View source: R/parafac_functions.R
parafac_conv | R Documentation |
parafac
.Please refer to parafac
for input parameters and details. This wrapper function ensures 'nstart' converging models are calculated. On the contrary, parafac calculates 'nstart' models regardless if they are converging.
parafac_conv(
X,
nstart,
verbose = FALSE,
output = c("best", "all"),
cl = NULL,
...
)
X |
array |
nstart |
number of converging models to calculate |
verbose |
logical, whether more information is supplied |
output |
Output the best solution (default) or output all nstart solutions. |
cl |
cluster to be used for parallel processing |
... |
arguments passed on to |
either a parafac model or a list of parafac models
parafac
data(eem_list)
dim_min <- 3 # minimum number of components
dim_max <- 4 # maximum number of components
nstart <- 25 # random starts for PARAFAC analysis, models built simulanuously, best selected
# cores <- parallel::detectCores(logical=FALSE) # use all cores but do not use all threads
cores <- 2 # package checks only run with 2 cores
maxit = 2500
ctol <- 10^-7 # tolerance for parafac
pfres_comps <- eem_parafac(eem_list, comps = seq(dim_min, dim_max),
normalise = TRUE, strictly_converging = TRUE, maxit = maxit, nstart = nstart,
ctol = ctol, cores = cores)
# keep all calculated models for diagnostics
pfres_comps_all <- eem_parafac(eem_list, comps = seq(dim_min, dim_max),
normalise = TRUE, strictly_converging = TRUE, output = "all", maxit = maxit,
nstart = nstart, ctol = ctol, cores = cores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.