Learn R Programming

NMF (version 0.2.2)

nmf.equal: Testing Equality of NMF Models

Description

The function nmf.equal tests if two NMF models are the same, i.e. they contain -- almost -- identical data: same basis and coefficient matrices, as well as same extra parameters.

Usage

nmf.equal(x, y, ...)

## S3 method for class 'NMF,NMF': nmf.equal(x, y, identical = TRUE, ...)

## S3 method for class 'list,list': nmf.equal(x, y, ..., all = FALSE, vector = FALSE)

Arguments

x
an NMF model or an object that is associated with an NMF model, e.g. the result from a fit with nmf.
y
an NMF model or an object that is associated with an NMF model, e.g. the result from a fit with nmf.
identical
a logical that indicates if the comparison should be made using the function identical (TRUE) or all.equal (FALSE). See d
...
extra arguments to allow extension, and passed to subsequent calls
all
a logical that indicates if all fits should be compared separately or only the best fits
vector
a logical, only used when all=TRUE, that indicates if all fits must be equal for x and y to be declared equal, or if one wants to return the result of each comparison in a vector.

Details

nmf.equal compares two NMF models, and return TRUE iff they are identical acording to the function identical when identical=TRUE, or equal up to some tolerance acording to the function all.equal. This means that all data contained in the objects are compared, which includes at least the basis and coefficient matrices, as well as the extra parameters stored in slot misc.

If extra arguments are specified in ..., then the comparison is performed using all.equal, irrespective of the value of argument identical.