[DOC] Documentation for builtin gnmf function
Example:
```dml
X = rand(rows = 5, cols = 3)
[A, B] = gnmf(X = X, rnk = 2, eps = 10^-8, maxi = 10)
```
Matrix A (Pattern matrix):
0.066 -0.068
0.003 -0.270
0.113 -0.007
0.087 -0.035
0.077 -0.040
Matrix B (Amplitude matrix):
1.043 6.335 7.038
-1.589 -0.115 -0.608
Closes #941.
diff --git a/dev/docs/builtins-reference.md b/dev/docs/builtins-reference.md
index cf55a15..51b67e8 100644
--- a/dev/docs/builtins-reference.md
+++ b/dev/docs/builtins-reference.md
@@ -33,6 +33,7 @@
* [`steplm`-Function](#steplm-function)
* [`slicefinder`-Function](#slicefinder-function)
* [`normalize`-Function](#normalize-function)
+ * [`gnmf`-Function](#gnmf-function)
* [`toOneHot`-Function](#toOneHOt-function)
@@ -438,9 +439,42 @@
### Example
```r
X = rand(rows = 50, cols = 10)
-y = X %*% rand(rows=ncol(X), cols=1)
+y = X %*% rand(rows = ncol(X), cols = 1)
y = normalize(X = X)
+```
+## `gnmf`-Function
+
+The `gnmf`-function does Gaussian Non-Negative Matrix Factorization.
+In this, a matrix X is factorized into two matrices W and H, such that all three matrices have no negative elements.
+This non-negativity makes the resulting matrices easier to inspect.
+
+### Usage
+```r
+gnmf(X, rnk, eps = 10^-8, maxi = 10)
+```
+
+### Arguments
+| Name | Type | Default | Description |
+| :------ | :------------- | -------- | :---------- |
+| X | Matrix[Double] | required | Matrix of feature vectors. |
+| rnk | Integer | required | Number of components into which matrix X is to be factored. |
+| eps | Double | `10^-8` | Tolerance |
+| maxi | Integer | `10` | Maximum number of conjugate gradient iterations. |
+
+
+### Returns
+| Type | Description |
+| :------------- | :---------- |
+| Matrix[Double] | List of pattern matrices, one for each repetition. |
+| Matrix[Double] | List of amplitude matrices, one for each repetition. |
+
+### Example
+```r
+X = rand(rows = 50, cols = 10)
+W = rand(rows = nrow(X), cols = 2, min = -0.05, max = 0.05);
+H = rand(rows = 2, cols = ncol(X), min = -0.05, max = 0.05);
+gnmf(X = X, rnk = 2, eps = 10^-8, maxi = 10)
```
## `toOneHot`-Function