Description Usage Arguments Details Value Examples

Rescales an NMF model keeping the fitted target matrix identical.

1 2 3 |

`x` |
an NMF object |

`center` |
either a numeric normalising vector |

`scale` |
scaling coefficient applied to |

Standard NMF models are identifiable modulo a scaling factor, meaning that the basis components and basis profiles can be rescaled without changing the fitted values:

*X = W H = (W D) (D^-1 H)*

with *D= alpha * diag(1/delta_1, ..., 1/delta_r)*

The default call `scale(object)`

rescales the basis NMF object so that each
column of the basis matrix sums up to one.

an NMF object

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
# random 3-rank 10x5 NMF model
x <- rnmf(3, 10, 5)
# rescale based on basis
colSums(basis(x))
colSums(basis(scale(x)))
rx <- scale(x, 'basis', 10)
colSums(basis(rx))
rowSums(coef(rx))
# rescale based on coef
rowSums(coef(x))
rowSums(coef(scale(x, 'coef')))
rx <- scale(x, 'coef', 10)
rowSums(coef(rx))
colSums(basis(rx))
# fitted target matrix is identical but the factors have been rescaled
rx <- scale(x, 'basis')
all.equal(fitted(x), fitted(rx))
all.equal(basis(x), basis(rx))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.