<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/ratio-of-uniforms-4/"></div></div><div><a data-url="https://www.r-bloggers.com/ratio-of-uniforms-4/" data-counturl="https://www.r-bloggers.com/ratio-of-uniforms-4/" data-count="horizontal" data-text="ratio-of-uniforms [#4]" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://xianblog.wordpress.com/2016/12/02/ratio-of-uniforms-4/"> R – Xi'an's Og</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><strong><a target="_blank" rel="nofollow" href="https://i2.wp.com/images-na.ssl-images-amazon.com/images/I/41knkIXE%2BoL._SX330_BO1,204,203,200_.jpg?ssl=1"><img alt="" src="https://i2.wp.com/images-na.ssl-images-amazon.com/images/I/41knkIXE%2BoL._SX330_BO1,204,203,200_.jpg?resize=222%2C333&ssl=1" data-recalc-dims="1"></a>P</strong>ossibly the last post on random number generation by Kinderman and Monahan’s (1977) <em>ratio-of-uniform method</em>. After fiddling with the Gamma(a,1) distribution when a&lt;1 for a while, I indeed figured out a way to produce a bounded set with this method: considering an arbitrary cdf Φ with corresponding pdf φ, the uniform distribution on the set Λ of (u,v)’s in <strong>R⁺</strong>x<strong>X</strong> such that</p>
<p>0≤u≤Φο<strong>ƒ</strong>[φοΦ⁻¹(u)v]</p>
<p>induces the distribution with density proportional to <strong>ƒ</strong> on φοΦ⁻¹(U)V. This set Λ has a boundary that is parameterised as</p>
<p>u=Φο<strong>ƒ</strong>(x),  v=1/φο<strong>ƒ</strong>(x), x∈Χ</p>
<p>which remains bounded in u since Φ is a cdf and in v if φ has fat enough tails. At both 0 and ∞. When <strong>ƒ</strong> is the Gamma(a,1) density this can be achieved if φ behaves like log(x)² near zero and like a inverse power at infinity. Without getting into all the gory details, closed form density φ and cdf Φ can be constructed for all a’s, as shown for a=½ by the boundaries in u and v (yellow) below</p>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/xianblog.files.wordpress.com/2016/11/bunda.jpg?ssl=1"><img sizes="(max-width: 359px) 100vw, 359px" alt="bunda" class="wp-image-32076" src="https://i1.wp.com/xianblog.files.wordpress.com/2016/11/bunda.jpg?resize=359%2C359&ssl=1" data-recalc-dims="1"></a>which leads to a bounded associated set Λ</p>
<p><a target="_blank" rel="nofollow" href="https://i2.wp.com/xianblog.files.wordpress.com/2016/11/ratgamp5.jpg?ssl=1"><img sizes="(max-width: 341px) 100vw, 341px" alt="ratgamp5" class="wp-image-32077" src="https://i2.wp.com/xianblog.files.wordpress.com/2016/11/ratgamp5.jpg?resize=341%2C341&ssl=1" data-recalc-dims="1"></a>At this stage, I remain uncertain of the relevance of such derivations, if only because the set A thus derived is ill-suited for uniform draws proposed on the enclosing square box. And also because a Gamma(a,1) simulation can rather simply be derived from a Gamma(a+1,1) simulation. But, who knows?!, there may be alternative usages of this representation, such as innovative slice samplers. Which means the ratio-of-uniform method may reappear on the ‘Og one of those days…</p>
<p>Filed under: <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/books/">Books</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/pictures/">pictures</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/r-statistics/">R</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/">Statistics</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/university-life/">University life</a> Tagged: <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/luc-devroye/">Luc Devroye</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/non-uniform-random-variate-generation/">Non-Uniform Random Variate Generation</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/random-number-generation/">random number generation</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/ratio-of-uniform-algorithm/">ratio of uniform algorithm</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/university-of-warwick/">University of Warwick</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xianblog.wordpress.com/32075/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/xianblog.wordpress.com/32075/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/ratio-of-uniforms-4/"></div></div><div><a data-url="https://www.r-bloggers.com/ratio-of-uniforms-4/" data-counturl="https://www.r-bloggers.com/ratio-of-uniforms-4/" data-count="vertical" data-text="ratio-of-uniforms [#4]" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://xianblog.wordpress.com/2016/12/02/ratio-of-uniforms-4/"> R – Xi'an's Og</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/ey9LsaYeje8"></a></div>