| nmf.gmm | R Documentation |
This function is experimental and still under development. The interface may change in future versions: argument names, defaults and the contents of the returned object are not yet stable. Code written against it today may need adjusting after an update. The rest of the package does not carry this caveat.
nmf.gmm fits the model
\bm b_n\mid(z_n=k)\sim N_Q(C\bm a_n+\bm\mu_k,\Sigma_k),\qquad
\bm y_n = X\bm b_n+\bm\varepsilon_n,\quad X\ge 0,
by a generalized EM algorithm: a K-component Gaussian mixture is placed
on the latent NMF scores \bm b_n, whose class-conditional mean combines
a covariate regression C\bm a_n (C=\Theta in the paper, the
Q\times R coefficient matrix) with a class shift \bm\mu_k. The
shared basis X stays non-negative and column-normalized. Clustering is
model based, through the posterior responsibilities. K=1 (tied
covariance) reduces exactly to NMF with random effects (nmfre).
Like the rest of the package, nmf.gmm performs optimization
only; use nmf.gmm.inference for standard errors and tests of
C, and nmf.gmm.select to choose K.
nmf.gmm(Y, A = NULL, rank, K = 1, ...)
Y |
Data matrix |
A |
Covariate matrix |
rank |
Integer rank |
K |
Integer number of mixture components. Default 1 (= NMF-RE). |
... |
Additional arguments:
|
An object of class "nmf.gmm": a list with X
(basis), X0 (the column-normalized initial basis the EM started
from), C (=\Theta, Q x R), mu (class means, Q x K),
tau2, sigma2, xi (mixing proportions), gamma
(responsibilities, N x K), cluster (hard labels), loglik,
BIC, ICL, n.params, entropy, Yhat,
objfunc(.iter), iter, converged, stop_by,
K,
rank, cov, dims and runtime. With
class.effects, also class.effects (the freed rows of
A, by name), class.rows (their indices) and C.class
(a Q x |S| x K array of class-specific coefficients; the class-specific
effect in observation space is X %*% C.class[, , k]).
nmf.gmm.inference, nmf.gmm.select,
nmfre (the K=1 special case).
set.seed(1)
Y <- matrix(abs(rnorm(20 * 60)) + 1, 20, 60)
A <- rbind(1, rnorm(60)) # intercept + one covariate
fit <- nmf.gmm(Y, A, rank = 2, K = 2)
fit$BIC
table(fit$cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.