next up previous
Next: 3.2.3 Generalized Transformation Method: Up: 3.2 Other Distributions Previous: 3.2.1 Transformation of probability


3.2.2 Transformation Method

Given a probability density $p(x)$:
Find a bijective mapping $y=f(x)$ such that the distribution of $y$ is $p(y)=c\,$:
$\displaystyle p(x)$ $\textstyle =$ $\displaystyle c \, \left\vert \frac{dy}{dx} \right\vert = c \,
\left\vert \frac...
...\;{\rm or} \;\;\;
\left\vert \frac{df(x)}{dx} \right\vert = \frac{1}{c} \, p(x)$  

It is easy to see that
$\displaystyle f(x)$ $\textstyle =$ $\displaystyle P(x) \equiv \int_{a}^{x} p(x') dx'$  

fulfills this condition, with $c=1$.

\fbox{ \begin{minipage}{600pt}
{\bf Transformation method:} \\
Let $p(x)$\ be a...
...e variable $x$\ then has the desired probability density $p(x)$.
\end{minipage}}



EXAMPLE: Let
$\displaystyle p(x)$ $\textstyle =$ $\displaystyle \frac{1}{\pi} \, \frac{1}{1+x^{2}} \;\;\;{\rm (Lorentzian),} \;\;\;\;
x \epsilon (\pm \infty)$  

Then $y=P(x)=1/2+(1/\pi) \, \arctan \, x$, with the inverse $P^{-1}(y)=\tan[\pi(y-1/2)]$. Therefore:

  • Sample $y$ equidistributed in $(0,1)$.
  • Compute $x=\tan[\pi(y-\frac{1}{2})]$.





Geometrical interpretation:
\begin{figure}\includegraphics[height=180pt]{figures/f3tr2.ps}
\end{figure}
$y$ is sampled from an equidistribution $\in (0,1)$ and $x=P^{-1}(y)$.
$\Longrightarrow$ The regions where $P(x)$ is steeper (i.e. $p(x)$ is large) are hit more frequently.



Franz J. Vesely Oct 2005
See also:
"Computational Physics - An Introduction," Kluwer-Plenum 2001