Let $X$ be a random variable taking values in $\mathbb R^n$ with a probability distribution $\mathbb P$ that has a density $p$.


Consider further a linear mapping $\pi: \mathbb R^n \to \mathbb R^m$, i.e. $\pi$ is an $m \times n$ matrix. We assume $m<n$, i.e. the linear transformation is in general non-invertible!


Now the distribution of the new random variable given by $Y = \pi X$ is given by


$$ \mathbb P\_Y (B \subset \mathbb R^m) := \mathbb P(\pi^{-1}(B)) = \int\_{\pi^{-1}(B)} p \; dx$$


where $\pi^{-1}(B)$ denotes the pre-image of $B$ under $\pi$. 


Question: How does the *density* of the random variable $Y$ look like?
Is it simply:


$$ p\_Y(y) = \int\_{\pi^{-1}(\{y\})} p \; dS$$


or do I need some scaling?


Initially I had the following:


$$ \int\_{B} p\_Y(y) \; dy = \int\_{B} \int\_{\pi^{-1}(\{y\})} p \; dS \, dy = \int\_{\pi^{-1}(B)} p \; dx = \mathbb P\_Y(B),$$


but there seems some scaling missing. Could you please tell me where my mistake is? Thank you



Push-forward density as surface integral
First of all, let us assume that $\pi$ is onto to avoid some unnecessary complications. Then we can find linear coordinates $x=(x\_1,\dotsc, x\_n)$ on $\newcommand{\bR}{\mathbb{R}}$ $\bR^n$ and $y=(y\_1,\dotsc, y\_m)$ on $\bR^m$ such that, in these coordinates, $\pi$ is given by


$$ y\_j=x\_j,.\;\;\forall j=1,\dotsc, m. $$


The probability measure $\newcommand{\bP}{\mathbb{P}}$ $\bP$ then has the form
$$ \bP(dx)= \rho(x) dx. $$


Then 


$$\bP\_Y(dy)= \rho\_Y(y) dy,\;\;\;\rho\_Y(y\_1,\dotsc,y\_m)=\int \rho(y\_1,\dotsc, y\_m, x\_{m+1}, \dotsc x\_n) dx\_{m+1}\cdots dx\_n. $$ 


If $x$ and $y$ are arbitrary *orthonormal* coordinates on $\bR^n$ and resp. $\bR^m$, then $\pi$ is represented by a matrix $A$ and we set


$$J\_\pi:=\sqrt{\det AA^\*}. $$


This quantity $J\_\pi$, called the *Jacobian* of of $\pi$ is *independent* of the choice of orthonormal coordinates $x$ and $y$. 


If $B\subset \bR^m$ is a Borel set, then the coarea formula 


$$ \int\_{\pi^{-1}(B)} \rho(x) dx = \int\_B \;\underbrace{\left(\int\_{\pi^{-1}(y)}\frac{\rho(x)}{J\_\pi} dV\_{\pi^{-1}(y)} (x)\right)}\_{=:\rho\_Y(y)}\; dy, $$ 


where $dV\_{\pi^{-1}(y)}$ denotes the volume element on the affine plane $\pi^{-1}(y)$ induced by the Euclidean metric on $\bR^n$. For more details check the first two pages of [these notes](http://www.nd.edu/~lnicolae/Coarea.pdf).


