flash_greedy_init_default: Initialize a flash factor

View source: R/flash_greedy_init_fns.R

flash_greedy_init_defaultR Documentation

Initialize a flash factor

Description

The default method for initializing the loadings \ell_{\cdot k} and factor values f_{\cdot k} of a new ("greedy") flash factor. It is essentially an implementation of the power method, but unlike many existing implementations, it can handle missing data and sign constraints. For details, see Chapter 2.2.3 in the reference below.

Usage

flash_greedy_init_default(
  flash,
  sign_constraints = NULL,
  tol = NULL,
  maxiter = 100,
  seed = 666
)

Arguments

flash

A flash_fit object.

sign_constraints

This parameter can be used to constrain the sign of the initial factor and loadings. It should be a vector of length two with entries equal to -1, 0, or 1. The first entry constrains the sign of the loadings \ell_{\cdot k}, with -1 yielding nonpositive loadings, +1 yielding nonnegative loadings, and 0 indicating that loadings should not be constrained. The second entry of sign_constraints similarly constrains the sign of factor values f_{\cdot k}. If sign_constraints = NULL, then no constraints will be applied.

tol

Convergence tolerance parameter. When the maximum (absolute) change over all values \ell_{ik} and f_{jk} is less than or equal to tol, initialization terminates. At each iteration, the factor and loadings are L^2-normalized. The default tolerance parameter is \min(1 / n, 1 / p), where n is the number of rows in the data matrix and p is the number of columns.

maxiter

Maximum number of power iterations.

seed

Since initialization is random, a default seed is set for reproducibility.

Value

A list of length two consisting of, respectively, the vector of initial values for loadings \ell_{\cdot k} and the vector of initial factor values f_{\cdot k}.

References

Jason Willwerscheid (2021), Empirical Bayes Matrix Factorization: Methods and Applications. Ph.D. thesis, University of Chicago.

See Also

flash_greedy, flash_greedy_init_softImpute, flash_greedy_init_irlba


flashier documentation built on Oct. 17, 2023, 5:07 p.m.