# SOLVED: What is the distribution of the squared exponential of two gaussian distributions of odd dimension?

Let $$X,X'$$ follow the $$n$$ dimensional Gaussian distribution (zero mean unit variance for simplicity). My question is: what is the distribution of $$Y = e^{-\|X-X'\|^2}$$, particuarly when $$n$$ is odd?

$$n$$ even case: I believe I know the answer for $$n$$ even. We know (or at least I think I know) that $$Z = \|X-X'\|^2 \sim \chi^2 (n)$$, which has density: $$\rho_Z (z) = \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} z^{\frac{n}{2}-1} e^{-\frac{z}{2}}$$ The density of $$Y$$ will therefore be: $$\begin{array}{rl} \rho_Y (y) &= \frac{dz}{dy} \rho_Z (z) \\ &= \frac{dz}{dy} \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} z^{\frac{n}{2}-1} e^{-\frac{z}{2}} \end{array}$$ where $$y = e^{-z}$$, so $$z = -\log(y)$$, and: $$\begin{array}{rl} \rho_Y (y) &= -\frac{d \log(y)}{dy} \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} (-1)^{\frac{n}{2}-1} \log(y)^{\frac{n}{2}-1} e^{\frac{\log(y)}{2}} \\ &= (-1)^{\frac{n}{2}} \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} \sqrt{\frac{\log(y)^{n-2}}{y}} \end{array}$$

$$n$$ odd case: the above derivation fails as the density becomes complex, so I'm wondering if anyone could suggest a way forward? Or is the density simply ill-defined for $$n$$ odd? (see below)

(the closest answer I found was this one, but this only helps for $$e^{\|X-X'\|^2}$$, not (at least as far as I can tell) for $$e^{-\|X-X'\|^2}$$).

PS: also, does this distribution have a name?

UPDATE: as noted by whuber, I forgot to take the absolute value of the Jacobian. Also note that $$y \in (0,1]$$, so $$(-\log (y))^{\frac{n}{2}-1}$$ is well defined. Corrected derivation is: $$\begin{array}{rl} \rho_Y (y) &= \left| \frac{dz}{dy} \right| \rho_Z (z) \\ &= \left| \frac{dz}{dy} \right| \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} z^{\frac{n}{2}-1} e^{-\frac{z}{2}} \\ &= \left| \frac{d \log(y)}{dy} \right| \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} (-\log(y))^{\frac{n}{2}-1} e^{\frac{\log(y)}{2}} \\ &= \frac{1}{2^{n/2} \Gamma (\frac{n}{2})} \sqrt{\frac{(-\log(y))^{n-2}}{y}} \end{array}$$

• There's nothing special about odd $n:$ you simply forgot to take the absolute value of the Jacobian. – whuber Jun 11 at 11:17
• d'oh - thanks. Also I was forgetting that $y \in (0,1]$ here. I'll update the question. I'm still a little curious if this distribution has a name as it seems to pop up all over the place in machine learning when you start looking (eg think of the gram matrix of an SVM - or any kernel-based method - using and RBF kernel where the inputs are drawn from a Gaussian distribution). – Mat Jun 14 at 0:21