Additive logistic transform (unconstrained coordinates to the simplex)
Source:R/03_03_DeCovarT_estimate_ratios_frequentist.R
additive_logistic.RdInverse additive log-ratio map
\(\boldsymbol{\psi}:\boldsymbol{\rho}\mapsto\boldsymbol{p}\) of Aitchison
(\(\mathrm{alr}^{-1}\)): a softmax with the last category \(J\)
pinned as reference (\(\rho_J\equiv 0\)). Solvers and
vcov.decovart_fit() use the isometric log-ratio chart
isometric_logistic() instead. This ALR helper is retained for the
vignette appendix.
Recovers the unconstrained additive log-ratio coordinates
\(\rho_j=\ln(p_j/p_J)\) for \(j=1,\ldots,J-1\), with the last part
\(p_J\) as reference. This is Aitchison's additive log-ratio
(\(\mathrm{alr}\)) transform, equivalently the multinomial-logit link
with reference category \(J\) (see compositions::alr() and
vignette("theory-decovart-generative-model", package = "DeCovarT")).
Value
Numeric vector \(\boldsymbol{p}\in\mathbb{R}^{J}\) on the unit simplex (\(\mathbf{1}^{\mathsf{T}}\boldsymbol{p}=1\), \(\boldsymbol{p}\ge\mathbf{0}\)).
Numeric vector \(\boldsymbol{\rho}\in\mathbb{R}^{J-1}\).
Details
With \(A=\sum_{k=1}^{J-1}\mathrm{e}^{\rho_k}+1\),
$$
p_j=\frac{\mathrm{e}^{\rho_j}}{A}\quad(j<J),\qquad
p_J=\frac{1}{A}.
$$
Equivalently,
\(\boldsymbol{p}=\boldsymbol{\psi}(\boldsymbol{\rho})\) with
\(\boldsymbol{\psi}(\boldsymbol{\rho})\propto
(\mathrm{e}^{\rho_1},\ldots,\mathrm{e}^{\rho_{J-1}},1)^{\mathsf{T}}\).
Jacobians and Hessians of both maps are derived in the package vignette
vignette("theory-decovart-generative-model", package = "DeCovarT").
See also compositions::alrInv().
Numerical stability
Evaluated through the log-sum-exp shift
\(p_i\propto\exp(\tilde{\rho}_i-\max_k\tilde{\rho}_k)\) with
\(\tilde{\boldsymbol{\rho}}=(\rho_1,\ldots,\rho_{J-1},0)\), which is
algebraically identical to the ratio above but never forms
\(\mathrm{e}^{\rho_i}\) directly. The naive quotient overflows to
NaN for \(\rho_i\gtrsim 710\), which unconstrained ascent can
reach when the MLE approaches a simplex face; the shifted form
returns an exact zero instead and keeps
\(\boldsymbol{\Sigma}(\boldsymbol{p})\) positive definite.