# naginterfaces.library.matop.real_​nmf_​rcomm¶

naginterfaces.library.matop.real_nmf_rcomm(irevcm, w, h, ht, comm, seed=1, errtol=0.0)[source]

real_nmf_rcomm computes a non-negative matrix factorization for a real non-negative matrix . It uses reverse communication for evaluating matrix products, so that the matrix is not accessed explicitly.

For full information please refer to the NAG Library document for f01sb

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/f01/f01sbf.html

Parameters
irevcmint

On initial entry: must be set to .

wfloat, ndarray, shape , modified in place

On initial entry:

if , should be set to an initial iterate for the non-negative matrix factor, .

If , need not be set. real_nmf_rcomm will generate a random initial iterate.

On intermediate exit: if or , contains the current iterate of the non-negative matrix .

On intermediate entry:

if , must contain , where is stored in .

If , or , must not be changed.

On final exit: contains the non-negative matrix .

hfloat, ndarray, shape , modified in place

On initial entry:

if , should be set to an initial iterate for the non-negative matrix factor, .

If , need not be set. real_nmf_rcomm will generate a random initial iterate.

On intermediate exit: if , contains the current iterate of the non-negative matrix .

On intermediate entry: must not be changed.

On final exit: contains the non-negative matrix .

htfloat, ndarray, shape , modified in place

On initial entry: need not be set.

On intermediate exit: if , contains the non-negative matrix , which is required in order to form .

On intermediate entry: if , must contain .

If , or , must not be changed.

On final exit: is undefined.

commdict, communication object, modified in place

Communication structure.

On initial entry: need not be set.

seedint, optional

On initial entry:

if , the supplied values of and are used for the initial iterate.

If , the value of is used to seed a random number generator for the initial iterates and . See Generating Random Initial Iterates for further details.

errtolfloat, optional

The convergence tolerance for when the Hierarchical Alternating Least Squares iteration has reached a stationary point. If , is used.

Returns
irevcmint

On intermediate exit: specifies what action you must take before re-entering real_nmf_rcomm with unchanged. The value of should be interpreted as follows:

Indicates the start of a new iteration. No action is required by you, but and are available for printing, and a limit on the number of iterations can be applied.

Indicates that before re-entry to real_nmf_rcomm, the product must be computed and stored in .

Indicates that before re-entry to real_nmf_rcomm, the product must be computed and stored in .

On final exit: .

Raises
NagValueError
(errno )

On intermediate re-entry, .

Constraint: , or .

(errno )

On initial entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

(errno )

On entry, one of more of the elements of or were negative.

Notes

The matrix is factorized into the product of an matrix and a matrix , both with non-negative elements. The factorization is approximate, , with and chosen to minimize the functional

You are free to choose any value for , provided . The product will then be a low-rank approximation to , with rank at most .

real_nmf_rcomm finds and using an iterative method known as the Hierarchical Alternating Least Squares algorithm. You may specify initial values for and , or you may provide a seed value for real_nmf_rcomm to generate the initial values using a random number generator.

real_nmf_rcomm does not explicitly need to access the elements of ; it only requires the result of matrix multiplications of the form or . A reverse communication interface is used, in which control is returned to the calling program whenever a matrix product is required.

References

Cichocki, A and Phan, A–H, 2009, Fast local algorithms for large scale nonnegative matrix and tensor factorizations, IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences (E92–A), 708–721

Cichocki, A, Zdunek, R and Amari, S–I, 2007, Hierarchical ALS algorithms for nonnegative matrix and 3D tensor factorization, Lecture Notes in Computer Science (4666), Springer, 169–176

Ho, N–D, 2008, Nonnegative matrix factorization algorithms and applications, PhD Thesis, Univ. Catholique de Louvain