| residuals.nmf | R Documentation |
Returns the residual matrix Y - \hat{Y} from a fitted NMF model.
Requires the original observation matrix Y to be supplied.
For nmfre objects, residuals are computed from the BLUP
reconstruction (Y - X(B_{blup})) by default. Set
type = "fixed" to use fixed-effects only.
## S3 method for class 'nmf'
residuals(object, Y, ...)
## S3 method for class 'nmfae'
residuals(object, Y, ...)
## S3 method for class 'nmfre'
residuals(object, Y, type = c("blup", "fixed"), ...)
## S3 method for class 'nmf.sem'
residuals(object, Y, ...)
object |
A fitted model object. |
Y |
The original observation matrix used for fitting. |
... |
Not used. |
type |
For |
The residual matrix.
nmfkc, nmfae, nmfre,
nmf.sem, fitted.nmf
Y <- matrix(runif(50), 5, 10)
result <- nmfkc(Y, rank = 2)
residuals(result, Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.