<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-2/"></div></div><div><a data-url="https://www.r-bloggers.com/ratio-of-uniforms-2/" data-counturl="https://www.r-bloggers.com/ratio-of-uniforms-2/" data-count="horizontal" data-text="ratio-of-uniforms [#2]" 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/10/31/ratio-of-uniforms-2/"> 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>F</strong>ollowing my earlier post on Kinderman’s and Monahan’s (1977) ratio-of-uniform method, I must confess I remain quite puzzled by the approach. Or rather by its consequences. When looking at the set A of (u,v)’s in <strong>R⁺</strong>×<strong>X</strong> such that 0≤u²≤<strong>ƒ</strong>(v/u), as discussed in the previous post, it can be represented by its parameterised boundary</p>
<p>u(x)=√<strong>ƒ</strong>(x),v(x)=x√<strong>ƒ</strong>(x)    x in <strong>X</strong></p>
<p>Similarly, since the simulation from <strong>ƒ</strong>(v/u) can also be derived [check Luc Devroye’s <a target="_blank" rel="nofollow" href="http://amzn.to/2dRMdwq">Non-uniform random variate generation</a> in the exercise section 7.3] from a uniform on the set B of (u,v)’s in <strong>R⁺</strong>×<strong>X</strong> such that 0≤u≤<strong>ƒ</strong>(v+u), on the set C of (u,v)’s in <strong>R⁺</strong>×<strong>X</strong> such that 0≤u³≤<strong>ƒ</strong>(v/√u)², or on the set D of (u,v)’s in <strong>R⁺</strong>×<strong>X</strong> such that 0≤u²≤<strong>ƒ</strong>(v/u), which is actually exactly the same as A <em>[and presumably many other versions!, for which I would like to guess the generic rule of construction]</em>, there are many sets on which one can consider running simulations. And one to pick for optimality?! Here are the three sets for a mixture of two normal densities:</p>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/xianblog.files.wordpress.com/2016/10/ratoun.jpg?ssl=1"><img sizes="(max-width: 450px) 100vw, 450px" alt="" class="wp-image-31809" src="https://i1.wp.com/xianblog.files.wordpress.com/2016/10/ratoun.jpg?resize=450%2C450&ssl=1" data-recalc-dims="1"></a>For instance, assuming slice sampling is feasible on every one of those three sets, which one is the most efficient? While I have no clear answer to this question, I found on Sunday night that a generic family of transforms is indexed by a differentiable  monotone function h over the positive half-line, with the uniform distribution being taken over the set</p>
<p>H={(u,v);0≤u≤h(f(v/g(u))_}</p>
<p>when the primitive G of g is the inverse of h, i.e., G(h(x))=x. [Here are the slides I gave at the <a target="_blank" rel="nofollow" href="http://www.warwick.ac.uk/mpollock/devroye">Warwick reading group on Devroye’s book</a>:]</p>
<p><iframe height="369" width="450" allowfullscreen src="https://www.slideshare.net/slideshow/embed_code/67579308"></iframe></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/statistics/r-statistics/">R</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/">Statistics</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/mixtures-of-distributions/">mixtures of distributions</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/pseudo-random-generator/">pseudo-random generator</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/r/">R</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/slice-sampler/">slice sampler</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xianblog.wordpress.com/31807/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/xianblog.wordpress.com/31807/" 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-2/"></div></div><div><a data-url="https://www.r-bloggers.com/ratio-of-uniforms-2/" data-counturl="https://www.r-bloggers.com/ratio-of-uniforms-2/" data-count="vertical" data-text="ratio-of-uniforms [#2]" 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/10/31/ratio-of-uniforms-2/"> 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/IulxLUjgBeo"></a></div>