Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Inverse transform sampling
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == * As an example, suppose we have a random variable <math> U \sim \mathrm{Unif}(0,1)</math> and a [[cumulative distribution function]] : <math> \begin{align} F(x)=1-\exp(-\sqrt{x}) \end{align} </math> : In order to perform an inversion we want to solve for <math>F(F^{-1}(u))=u</math> : <math> \begin{align} F(F^{-1}(u))&=u \\ 1-\exp\left(-\sqrt{F^{-1}(u)}\right) &= u \\ F^{-1}(u) &= (-\log(1-u))^2 \\ &= (\log(1-u))^2 \end{align} </math> : From here we would perform steps one, two and three. * As another example, we use the [[exponential distribution]] with <math>F_X(x)=1-e^{-\lambda x}</math> for x β₯ 0 (and 0 otherwise). By solving y=F(x) we obtain the inverse function : <math>x = F^{-1}(y) = -\frac{1}{\lambda}\ln(1-y).</math> :It means that if we draw some <math>y_0</math>from a <math> U \sim \mathrm{Unif}(0,1)</math> and compute <math>x_0 = F_X^{-1}(y_0) = -\frac{1}{\lambda}\ln(1-y_0),</math> This <math>x_0</math> has exponential distribution. : The idea is illustrated in the following graph: : [[File:Inverse transformation method for exponential distribution.jpg|thumb|none|400px|Random numbers y<sub>i</sub> are generated from a uniform distribution between 0 and 1, i.e. Y ~ U(0, 1). They are sketched as colored points on the y-axis. Each of the points is mapped according to x=F<sup>β1</sup>(y), which is shown with gray arrows for two example points. In this example, we have used an exponential distribution. Hence, for x β₯ 0, the probability density is <math>\varrho_X(x) = \lambda e^{-\lambda \, x}</math> and the cumulative distribution function is <math>F(x) = 1 - e^{-\lambda \, x}</math>. Therefore, <math>x = F^{-1}(y) = - \frac{\ln(1-y)}{\lambda}</math>. We can see that using this method, many points end up close to 0 and only few points end up having high x-values - just as it is expected for an exponential distribution.]] : Note that the distribution does not change if we start with 1-y instead of y. For computational purposes, it therefore suffices to generate random numbers y in [0, 1] and then simply calculate : <math>x = F^{-1}(y) = -\frac{1}{\lambda}\ln(y).</math>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Inverse transform sampling
(section)
Add topic