Closed spinkney closed 10 months ago
For simplex, you should use the square Jacobian $J_s$, not $\sqrt{J^\top J}$. The base measure is the Lebesgue measure on the first $N-1$ elements, so simply drop the last element when computing the Jacobian.
The two Jacobians are related by
$$J = \begin{bmatrix} I{N-1} & -1{N-1} \end{bmatrix}^\top J_s,$$
which is why
$$J^\top J = Js^\top (I{N-1} + 1{N-1}1{N-1}^\top) J_s$$
$$\sqrt{|J^\top J|} = |Js| \sqrt{|I{N-1} + 1_{N-1,N-1}|} = |J_s| \sqrt{1 + N-1} = |J_s| \sqrt{N}.$$
The trick $J^\top J$ works at least when $J$ is a linear transformation of the square Jacobian of interest, but that still might inject constant factors into the Jacobian determinant.
That's very clear, thanks!
When I AD through the stick breaking transform in Julia I need to add
0.5 * log(N)
to get the same log-det-jacobian.