Description Usage Arguments Details Methods (by generic) Examples
basiscor
computes the correlation matrix between basis vectors, i.e.
the columns of its basis matrix – which is the model's first matrix factor.
profcor
computes the correlation matrix between basis profiles,
i.e. the rows of the coefficient matrix – which is the model's second
matrix factor.
1 2 3 |
x |
a matrix or an object with suitable methods |
y |
a matrix or an object with suitable methods |
... |
extra arguments passed to |
Each generic has methods defined for computing correlations between NMF models
and/or compatible matrices.
The computation is performed by the base function cor
.
basiscor:
basiscor(x = NMF,y = matrix)
: Computes the correlations between the basis vectors of x
and
the columns of y
.
basiscor(x = matrix,y = NMF)
: Computes the correlations between the columns of x
and the the basis vectors of y
.
basiscor(x = NMF,y = NMF)
: Computes the correlations between the basis vectors of x
and y
.
basiscor(x = NMF,y = missing)
: Computes the correlations between the basis vectors of x
.
profcor:
profcor(x = NMF,y = matrix)
: Computes the correlations between the basis profiles of x
and
the rows of y
.
profcor(x = matrix,y = NMF)
: Computes the correlations between the rows of x
and the basis
profiles of y
.
profcor(x = NMF,y = NMF)
: Computes the correlations between the basis profiles of x
and y
.
profcor(x = NMF,y = missing)
: Computes the correlations between the basis profiles of x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # generate two random NMF models
a <- rnmf(3, 100, 20)
b <- rnmf(3, 100, 20)
# Compute auto-correlations
basiscor(a)
profcor(a)
# Compute correlations with b
basiscor(a, b)
profcor(a, b)
# try to recover the underlying NMF model 'a' from noisy data
res <- nmf(fitted(a) + rmatrix(a), 3)
# Compute correlations with the true model
basiscor(a, res)
profcor(a, res)
# Compute correlations with a random compatible matrix
W <- rmatrix(basis(a))
basiscor(a, W)
identical(basiscor(a, W), basiscor(W, a))
H <- rmatrix(coef(a))
profcor(a, H)
identical(profcor(a, H), profcor(H, a))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.