# Jacobian of the unit simplex transform and transforms between spaces of unequal dimensions

I want to derive the determinant of the Jacobian for a transform from \mathbb{R}^{K} to \mathbb{R}^{2^K}

I found that Stan has a transform between two spaces with unequal dimensions and want to learn from that.

How to derive the Jacobian of the unit simplex transform?

The manual mentioned that \vec{x} \in \mathbb{R}^{K} and z \in \mathbb{R}^{K - 1}.

The dimensions of x and z are not the same.

The Jacobian is rectangular, and I can’t derive the determinant of the Jacobian.

This blog (https://tamaspapp.eu/post/jacobian-chain/) has a trick for writing the Jacobian between two space with unequal dimensions. But when I apply the trick to my transform, it doesn’t work. Is it possible to make that trick work in general?

Thanks.

Here is my derivation for the stick breaking transform, assuming the trick works.

Let (x_1, x_2, x_3, ..., x_{K}) be a point on the probability simplex:

• 0 \le x_{n} \le 1
• x_1 + x_2 + x_3 + ... x_{K} = 1

Let z_{l} = \log \frac{ x_{l}}{x_{l+1} + ... + x_{K}}

Let {b_{l} = [1 + \exp(z_{l})]^{-1}}

Let c_{l} = 1 - b_{l} = [1 + \exp(-z_{l})]^{-1}

Then,
x_{m} = \begin{cases} c_{1} & \text{if } m = 1 \\ \prod_{l=1}^{K-1} b_{l} & \text{if } m = K \\ c_{m} \prod_{l=1}^{m-1} b_{l} & \text{otherwise} \end{cases}

For K = 3,

J = \left[ \begin{matrix} a_{11} & a_{12} & 0 \\ a_{21} & a_{22} & 0 \\ a_{31} & a_{32} & 1 \\ \end{matrix} \right]

where a_{ij} = \frac{\partial x_{i}}{\partial z_j}

Since a_{12} = 0, \det(J) = a_{11}a_{22}

For higher K, only the diagonal terms contribute to the determinant.

-\log[\det(J)] = \sum_{l=1}^{K-1} (K-l)\log[b_{l}] + \log[c_{l}]

The trick works in this case.