| gradientDesc | R Documentation |
Estimates the row-marker matrix A and the column-marker matrix
B of a binary logistic biplot using a simple (batch) gradient
descent algorithm. This function is mainly provided for pedagogical purposes
and benchmarking; the MM and CG methods in LogBip are
generally faster and more reliable.
gradientDesc(
x,
k = 2,
rate = 0.001,
converg = 0.001,
max_iter,
plot = FALSE,
...
)
x |
A binary matrix. |
k |
Number of dimensions. Default is |
rate |
Learning rate |
converg |
Convergence tolerance: the algorithm stops when the relative
change in the loss function is below this value. Default is |
max_iter |
Maximum number of iterations. |
plot |
Logical; if |
... |
Additional arguments (currently unused). |
The model is
\mathrm{logit}(\pi_{ij}) =
\log\!\left(\frac{\pi_{ij}}{1-\pi_{ij}}\right) =
\mu_j + \sum_{s=1}^k b_{js}\,a_{is} = \mu_j + \mathbf{a}_i^\top \mathbf{b}_j.
The gradient with respect to the full parameter vector is
\nabla\ell =
\left(\frac{\partial\ell}{\partial\boldsymbol{\mu}},\,
\frac{\partial\ell}{\partial\mathbf{A}},\,
\frac{\partial\ell}{\partial\mathbf{B}}\right) =
\left((\boldsymbol{\Pi}-\mathbf{X})^\top,\;
(\boldsymbol{\Pi}-\mathbf{X})\mathbf{B},\;
(\boldsymbol{\Pi}-\mathbf{X})^\top\mathbf{A}\right).
An object of class BiplotML (a named list) containing:
AhatEstimated row-marker matrix.
BhatEstimated column-marker matrix (including intercepts).
methodCharacter string "Gradient Descent".
Giovany Babativa <jgbabativam@unal.edu.co>
Vicente-Villardon, J. L., & Galindo, M. P. (2006). Logistic biplots. In M. Greenacre & J. Blasius (Eds.), Multiple Correspondence Analysis and Related Methods (pp. 503–521). Chapman & Hall.
plotBLB, performanceBLB
data("Methylation")
set.seed(02052020)
outGD <- gradientDesc(x = Methylation, k = 2, max_iter = 10000, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.