# Map a random variable to a Gaussian

If I have a random variable $$X \in \mathbb{R}^n$$, under which conditions is there a $$C^1$$ function $$\varphi: \mathbb{R}^n \rightarrow \mathbb{R}^n$$ such that $$\varphi(X) \sim \mathcal{N}(0, I_n)$$ (vector of $$n$$ independent normal variables)?

$$X$$ probably has to have a density, to begin with... But I'm kind of stuck there. I know that if $$n=1$$, inverse transform sampling can be used to solve this issue, but I'm having trouble finding a generalization to $$R^n$$.

If $$X \in U$$ where $$U$$ is diffeomorphic to $$\mathbb{R}^n$$, and $$X$$ has a continuous and positive density on $$U$$, then it can be diffeomorphically mapped to $$\mathcal{N}(0, I_n)$$.
Indeed, let $$\varphi_1: U \rightarrow \mathbb{R}^n$$ be a diffeomorphism, and $$X' = \varphi(X)$$. Then $$X'$$ has a continuous positive density on $$\mathbb{R}^n$$. By Theorem 1. in Hyvärinen & Pajunen, 1999, there is a diffeomorphism $$\varphi_2: \mathbb{R}^n \rightarrow (0, 1)^n$$ such that $$X'' = \varphi_2(X') \sim U((0,1)^n)$$. The components of $$X''$$ are independent (see the paper for details) and thus can individually be mapped (via inverse transform sampling) to $$\mathcal{N}(0, 1)$$, which is the same as mapping $$X''$$ to $$\mathcal{N}(0, I_n)$$.