I am working on a problem in probability theory and need to define the determinant of a Jacobian of a variable transform; i.e.,
$$ p(x) = p(y) \left|\frac{\partial y}{\partial x}\right|. $$
My input has been specified as $(x, y, z)$ coordinates, but they are constrained to lie on the surface of the unit sphere. My intuition says to map these variables onto two spherical coordinate angles $(\theta, \phi)$, since the radius is known to be 1. However, now I've transformed three variables into two, and so the Jacobian of the transformation is naively rectangular, which wouldn't even have a determinant. Yet I can't straightforwardly drop a variable, since just knowing that $x^2 + y^2 + z^2 = 1$ isn't enough to reconstruct, for example, $z$ given just $x$ and $y$ — I could only reconstruct $z^2$, and then I've lost information about the sign of $z$.
Is there a typical way of handling this situation, or have I misunderstood? Any help appreciated.
More detail
A couple of people have asked for more info. I'll post what I can. I'm doing density estimation on some scattered data, which were given to me in terms of $(x, y, z)$ coordinates and some other variables (which aren't important for this spatial transform I'm trying to do). Since my data are constrained to be on the surface of a sphere, I know I can transform $(x, y, z) \rightarrow (\theta, \phi)$ uniquely. But any density estimate I get — let's call it $p(\theta, \phi)$ — needs to be transformed back to $p(x, y, z)$ to be useful for this application.
My confusion is that, given the transformation of variables formula for probabilities, it doesn't seem valid to transform three variables into two, even if the mapping is unique, because I need $\det J$, where $J$ is the Jacobian, to transform my probabilities correctly.
To make this more concrete, I propose the mapping
$$ \theta = \arctan \frac{\sqrt{x^2 + y^2}}{z} $$
$$ \phi = \arctan \frac{y}{x} $$.
$$ J = \begin{pmatrix} \frac{\partial \theta}{\partial x} & \frac{\partial \theta}{\partial y} & \frac{\partial \theta}{\partial z} \\ \frac{\partial \phi}{\partial x} & \frac{\partial \phi}{\partial y} & \frac{\partial \phi}{\partial z} \end{pmatrix} = \begin{pmatrix} \frac{x z}{\sqrt{x^2+y^2}} & \frac{y z}{\sqrt{x^2+y^2}} & -\sqrt{x^2+y^2} \\ -\frac{y}{x^2+y^2} & \frac{x}{x^2+y^2} & 0 \end{pmatrix} $$
But this Jacobian is rectangular and therefore has no determinant! This is where I get stuck. Even if I derive a density in terms of these angular variables, there's no way to "go back" to the Cartesian ones that I need if I use the formula above.
You are right in that using a 3-dimensional Jacobian makes little sense. Your data is 2-dimensional, except that it can be embedded in 3-dimensions. In other words, you are working with surface-measures.
In your situation, you can have transformations from a 2-dimensional space (at least locally) into your spherical surface. For instance, a typical map would be
$$ (\theta, \phi) = \omega\left(x,y\right) = \left(\arccos(1-x^2-y^2), \arctan(y/x)\right),$$ and another one could be $$ \mathbf{p}(u, v) = \left[\sqrt{u}\cos(2\pi v),\sqrt{u}\sin(2\pi v),\sqrt{1-u}\right],$$ where I have described the result in $\mathbb{R}^3$, but you can prove that it actually maps to the unit sphere $\mathbb{S}^2$.
In both cases, we map from a region of $\mathbb{R}^2$ into $\mathbb{S}^2$. Now, the Jacobian measures the change of a differential surface-area in the input to the output: $$ J = \frac{d\Omega}{dA},$$ where $dA$ denotes a small area around the input parameter space $\mathbb{R}^2$, and $d\Omega$ denotes the spherical area (in steradians) around the output position.
Be careful with the measure on $\mathbb{S}^2$: $$ d\Omega = \sin\theta\cdot d\theta\;d\phi = -d(\cos\theta)\;d\phi.$$
As an example, to calculate the Jacobian of the second example, we could get back into polar-azimuth form by equating: $$ \sin\theta \cos\phi = \sqrt{u}\cos(2\pi v) $$ $$ \sin\theta \sin\phi = \sqrt{u}\sin(2\pi v) $$ $$ \cos\theta = \sqrt{1-u} $$ to see that $$ \theta = \arccos\sqrt{1-u}, \, \phi=2\pi v$$ and therefore $$ d\Omega = -d(\cos\theta)\;d\phi = -\frac{-1}{2\sqrt{1-u}}du\cdot\left(2\pi\cdot dv\right) = \frac{\pi}{\sqrt{1-u}} du\;dv. $$ So the Jacobian is $$ J = \frac{\pi}{\sqrt{1-u}}.$$
A useful tool when working with polar-azimuthal coordinates isn't that convenient is to use: $$ J = \left\| \frac{\partial F}{\partial u} \times \frac{\partial F}{\partial v} \right\|,$$ where $F$ is a map from the parameter space $(u, v)$ into $\mathbb{R}^3$.
To wit: $$\partial_u\mathbf{p} = \left[\frac{1}{2\sqrt{u}}\cos(2\pi v), \frac{1}{2\sqrt{u}}\sin(2\pi v),-\frac{1}{2\sqrt{1-u}}\right],$$
$$\partial_v\mathbf{p} = \left[-2\pi\sqrt{u}\sin(2\pi v), 2\pi\sqrt{u}\cos(2\pi v),0\right],$$ $$\partial_u\mathbf{p}\times\partial_v\mathbf{p} = \left[ \pi\frac{\sqrt{u}}{\sqrt{1-u}}\cos(2\pi v), \pi\frac{\sqrt{u}}{\sqrt{1-u}}\sin(2\pi v), \pi \right],$$ and $$ J = \left\|\partial_u\mathbf{p}\times\partial_v\mathbf{p}\right\| = \pi\cdot\sqrt{\frac{u}{1-u}+1} = \frac{\pi}{\sqrt{1-u}}.$$