Additive logistic transform (unconstrained coordinates to the simplex)
Source:R/03_03_DeCovarT_estimate_ratios_frequentist.R
additive_logistic.RdImplements the reparametrisation \(\boldsymbol{\psi}:\boldsymbol{\rho}\mapsto\boldsymbol{p}\) used in the article, sending unconstrained coordinates \(\boldsymbol{\rho}\in\mathbb{R}^{J-1}\) to cellular proportions \(\boldsymbol{p}\in\Delta^{J-1}\). This is the additive logistic transform of Aitchison, i.e. the inverse additive log-ratio map (\(\mathrm{alr}^{-1}\)), equivalently a softmax with the last category \(J\) pinned as reference (\(\rho_J\equiv 0\)).
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("softmax-alr-derivatives", 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("softmax-alr-derivatives", package = "DeCovarT").
See also compositions::alrInv().