Matsumoto and Yor have recently discovered an interesting
transformation which preserves a bivariate probability measure which is a
product of the generalized inverse Gaussian (GIG) and gamma distributions. This
paper is devoted to a detailed study of this phenomenon. Let $X$ and $Y$ be two
independent positive random variables. We prove (Theorem 4.1) that $U =(X
+Y)^{-1}$ and $V = X^{-1} - (X +Y)^{-1}$ are independent if and only if there
exists $p, a, b > 0$ such that $Y$ is gamma distributed with shape parameter
$p$ and scale parameter $2 a^-1$, and such that $X$ has a GIG distribution with
parameters $-p, a$ and $b$ (the direct part for $a = b$ was obtained in
Matsumoto and Yor). The result is partially extended (Theorem 5.1) to the case
where $X$ and $Y$ are valued in the cone $V_+$ of symmetric positive definite
$(r, r)$ real matrices as follows: under a hypothesis of smoothness of
densities, we prove that $U =(X +Y)^-1$ and $V =X^-1 -(X +Y)^ -1$ are
independent if and only if there exists $p>(r-1)/2$ and $a$ and $b$ in $V_+$
such that $Y$ is Wishart distributed with shape parameter $p$ and scale
parameter $2a^-1$, and such that $X$ has a matrix GIG distribution with
parameters $-p, a$ and $b$. The direct result is also extended to singular
Wishart distributions (Theorem 3.1).