sim_factors: Simulate matrices to explores 'vrnmf'

View source: R/simulate_factorization.R

sim_factorsR Documentation

Simulate matrices to explores vrnmf

Description

sim_factors simulates non-negative factorization matrices C and D under a variaty of conditions to explore factorization X = C*D + noise.

Usage

sim_factors(
  m,
  n,
  r,
  simplex = "col",
  distr = "unif",
  frac.zeros = 0.4,
  condition = FALSE,
  noise = 0
)

Arguments

m

Integers. Size of matrices. Matrix C has a size of m*r and matrix D has a size of r*n.

n

Integers. Size of matrices. Matrix C has a size of m*r and matrix D has a size of r*n.

r

Integers. Size of matrices. Matrix C has a size of m*r and matrix D has a size of r*n.

simplex

A character. Either columns ("col") or rows ("row") of matrix C are projected onto unit simplex. (default="col")

distr

A character. Distribution to simulate matrix entries: "unif" for uniform and "exp" for exponential distributions. (default="unif")

frac.zeros

A numeric. Fraction of zeros in matrix C. It promotes sufficient scattering of matrix column/row vectors. (default=0.4)

condition

A boolean. Generate more well-conditioned matrix R. (default=FALSE)

noise

A numeric. Standard deviation of gaussian noise to add. (default=0e-4)

Value

List of simulated matrices:

X.noise, X - noisy and original matrix X to decompose.

C, D - factorization matrices.


vrnmf documentation built on March 18, 2022, 6:11 p.m.