{"id":1883,"date":"2024-10-08T17:09:41","date_gmt":"2024-10-08T17:09:41","guid":{"rendered":"https:\/\/www.ethanepperly.com\/?p=1883"},"modified":"2024-12-09T20:00:53","modified_gmt":"2024-12-09T20:00:53","slug":"rejection-sampling","status":"publish","type":"post","link":"https:\/\/www.ethanepperly.com\/index.php\/2024\/10\/08\/rejection-sampling\/","title":{"rendered":"Rejection Sampling"},"content":{"rendered":"\n<p>I am delighted to share that my paper <em><a href=\"https:\/\/arxiv.org\/abs\/2410.03969\">Embrace rejection: Kernel matrix approximation with randomly pivoted Cholesky<\/a><\/em> has been released on arXiv, joint with <a href=\"https:\/\/tropp.caltech.edu\">Joel Tropp<\/a> and <a href=\"https:\/\/sites.google.com\/ucsd.edu\/rwebber\/\">Rob Webber<\/a>.<\/p>\n\n\n\n<p>On the occasion of this release, I want to talk about <em><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rejection_sampling\">rejection sampling<\/a><\/em>, one of the most powerful ideas in probabilistic computing. My goal is to provide an accessible and general introduction to this technique, with a more &#8220;applied math&#8221; rather than statistical perspective. I will conclude with some discussion of how we use it in <a href=\"https:\/\/arxiv.org\/abs\/2410.03969\">our paper<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Motivating Application: <a href=\"https:\/\/arxiv.org\/abs\/math\/0702226\">Randomized Kaczmarz<\/a><\/h2>\n\n\n\n<p>Consider the task of solving a <a href=\"https:\/\/en.wikipedia.org\/wiki\/System_of_linear_equations#Matrix_equation\">linear system of equations<\/a> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-bb1076898a88ac5d6a1c74d7932dd5fc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#120;&#32;&#61;&#32;&#98;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"55\" style=\"vertical-align: 0px;\"\/>, where <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-82b2ab6923ce86eb105a1fb622dd7beb_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#32;&#92;&#105;&#110;&#32;&#92;&#114;&#101;&#97;&#108;&#94;&#123;&#110;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#100;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"75\" style=\"vertical-align: -1px;\"\/> is a matrix and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-687661d959fd9cfac193c411ee6bc2a7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#98;&#32;&#92;&#105;&#110;&#32;&#92;&#114;&#101;&#97;&#108;&#94;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"50\" style=\"vertical-align: -1px;\"\/> is a vector. For simplicity, we assume that this system is <em><a href=\"https:\/\/en.wikipedia.org\/wiki\/System_of_linear_equations#Consistency\">consistent<\/a><\/em> (i.e., there exists a solution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4c269341681e03c841aa0aee1e9af79d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#95;&#92;&#115;&#116;&#97;&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"17\" style=\"vertical-align: -3px;\"\/> such that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ec26ddd6af8a38a5d1a25c954b750dcd_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#120;&#95;&#92;&#115;&#116;&#97;&#114;&#32;&#61;&#32;&#98;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"63\" style=\"vertical-align: -3px;\"\/>). The <a href=\"https:\/\/arxiv.org\/abs\/math\/0702226\">randomized Kaczmarz algorithm<\/a> is a mathematically elegant algorithm for solving this problem, due to <a href=\"https:\/\/www.math.ucdavis.edu\/~strohmer\/\">Strohmer<\/a> and <a href=\"https:\/\/www.math.uci.edu\/~rvershyn\/\">Vershynin<\/a>. Beginning with initial solution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1136fcaf224936bce4a566e194cf5e34_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#92;&#103;&#101;&#116;&#115;&#32;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"47\" style=\"vertical-align: -1px;\"\/>, randomized Kaczmarz repeatedly performs the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Sample.<\/strong> Generate a random row index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-06a46a64abb2fc8a9d51631fef84fe19_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> according to the probability distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-7f23f6285f99169e1f5b40c144d3c565_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#73;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;&#32;&#47;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#65;&#125;&#95;&#123;&#92;&#114;&#109;&#32;&#70;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"186\" style=\"vertical-align: -5px;\"\/>. Here, and going forward, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f89af0de755b17f28a88ce9f95c88988_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#105;&#94;&#92;&#116;&#111;&#112;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"19\" style=\"vertical-align: -5px;\"\/> denotes the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>th row of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a1c68b4e06aabf59a565a9f21fa9242d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#92;&#99;&#100;&#111;&#116;&#125;&#95;&#123;&#92;&#114;&#109;&#32;&#70;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"30\" style=\"vertical-align: -5px;\"\/> is the <a href=\"https:\/\/mathworld.wolfram.com\/FrobeniusNorm.html\">Frobenius norm<\/a>.<\/li>\n\n\n\n<li><strong>Update.<\/strong> Set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-8c4436cb0018614a3177a5f7ddaff8d2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#92;&#103;&#101;&#116;&#115;&#32;&#120;&#32;&#43;&#32;&#40;&#98;&#95;&#73;&#32;&#45;&#32;&#97;&#95;&#73;&#94;&#92;&#116;&#111;&#112;&#32;&#120;&#41;&#92;&#99;&#100;&#111;&#116;&#32;&#97;&#95;&#73;&#32;&#47;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#73;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"235\" style=\"vertical-align: -5px;\"\/>.<\/li>\n<\/ol>\n\n\n\n<p>Convergence theory of the randomized Kaczmarz iteration is very well-studied; see, e.g., section 4.1 of <a href=\"https:\/\/arxiv.org\/pdf\/2402.17873\">this survey<\/a> for an introduction.<\/p>\n\n\n\n<p>For this post, we will consider a more basic question: How can we perform the sampling step 1? If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-75a5652acadcd645b180a972b75a9d09_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1b031c8458e71f0e4df82ad61d36c0ca_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: 0px;\"\/> are not very large, this is an easy problem: Simply sweep through all the rows <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4c0a2a967894e2fd9b2da00447811f96_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"14\" style=\"vertical-align: -3px;\"\/> and compute their norms <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-acee8ed513e55ea97a823fc49835cb37_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"38\" style=\"vertical-align: -5px;\"\/>. Then, sampling can be done using any algorithm for sampling from a weighted list of items. But what if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-75a5652acadcd645b180a972b75a9d09_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> is very large? Suppose, even, that it is computationally expensive to read through the matrix, even once, to compute the row norms. What can we do now?<\/p>\n\n\n\n<p>Here is one solution is using rejection sampling, <a href=\"https:\/\/proceedings.neurips.cc\/paper\/2014\/hash\/f29c21d4897f78948b91f03172341b7b-Abstract.html\">due to<\/a> <a href=\"https:\/\/www.google.com\/url?sa=t&amp;source=web&amp;rct=j&amp;opi=89978449&amp;url=https:\/\/www.math.ucla.edu\/~deanna\/&amp;ved=2ahUKEwjzkZ7_vJuKAxULIEQIHQZ3HOUQFnoECBkQAQ&amp;usg=AOvVaw1jsZ6ucMNE6pjBC9GT6bto\">Needell<\/a>, <a href=\"https:\/\/www.google.com\/url?sa=t&amp;source=web&amp;rct=j&amp;opi=89978449&amp;url=https:\/\/oden.utexas.edu\/people\/directory\/rachel--ward\/&amp;ved=2ahUKEwj2ufKCvZuKAxUmEEQIHb4cCG0QFnoECB4QAQ&amp;usg=AOvVaw3b7FckItIwvtAmGnfNtEr_\">Ward<\/a>, and <a href=\"https:\/\/www.google.com\/url?sa=t&amp;source=web&amp;rct=j&amp;opi=89978449&amp;url=https:\/\/www.ttic.edu\/srebro&amp;ved=2ahUKEwigkJ2NvZuKAxUcJkQIHYULEJQQFnoECD4QAQ&amp;usg=AOvVaw0wy4vW0WOHWF9AjHOcPFFR\">Srebro<\/a>. Suppose that we know a bound on the row norms of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>: <p class=\"ql-center-displayed-equation\" style=\"line-height: 22px;\"><span class=\"ql-right-eqno\"> (1) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a80c9da38c2d98b188cb70f64c8637e8_l3.png\" height=\"22\" width=\"254\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;&#32;&#92;&#108;&#101;&#32;&#66;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#101;&#97;&#99;&#104;&#32;&#125;&#32;&#105;&#32;&#61;&#32;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#110;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>For instance, if the entries of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> take values in the range <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-634fe4705a526f221e312cffd3ceda93_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#091;&#45;&#49;&#44;&#49;&#093;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"45\" style=\"vertical-align: -5px;\"\/>, then (1) holds with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-79a3037055af492107b9fc8eb526c283_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#66;&#32;&#61;&#32;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"48\" style=\"vertical-align: 0px;\"\/>. To sample a row <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> with probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-65de536d836a52be5241a2357395368d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;&#47;&#92;&#110;&#111;&#114;&#109;&#123;&#65;&#125;&#95;&#123;&#92;&#114;&#109;&#32;&#70;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"93\" style=\"vertical-align: -5px;\"\/>, we perform the following the rejection sampling procedure:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Propose.<\/strong> Draw a random row index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-0b36f49b642508b6d7dc06181d35cae8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;&#92;&#108;&#101;&#32;&#74;&#92;&#108;&#101;&#32;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"78\" style=\"vertical-align: -3px;\"\/> uniformly at random (i.e., <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a1c2bb7eaffb023a3a873859c3cf09de_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/> is equally likely to be any row index between <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-27e3598fd2d4f0491067f1afaced92e9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"7\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-75a5652acadcd645b180a972b75a9d09_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/>.)<\/li>\n\n\n\n<li><strong>Accept\/reject.<\/strong> Make a random choice: With probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-e7a571623c63ad36b46cdd8c52307ec9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#74;&#32;&#61;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#74;&#125;&#94;&#50;&#47;&#66;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"113\" style=\"vertical-align: -5px;\"\/>, accept and set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-352908d3a8f4132b4bdf6eff767186f8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;&#92;&#103;&#101;&#116;&#115;&#32;&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"49\" style=\"vertical-align: -1px;\"\/>. With the remaining probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-99c8241f9b786ac73eefd1364025ea2e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;&#45;&#112;&#95;&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"48\" style=\"vertical-align: -4px;\"\/>, reject and return to step 1.<\/li>\n<\/ol>\n\n\n\n<p>Why does this procedure work? As an intuitive explanation, notice that each row <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> is equally likely to be proposed and has probability proportional to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-acee8ed513e55ea97a823fc49835cb37_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"38\" style=\"vertical-align: -5px;\"\/> of being accepted. Therefore, under this procedure, each row <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> has probability proportional to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-acee8ed513e55ea97a823fc49835cb37_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"38\" style=\"vertical-align: -5px;\"\/> of being selected, just as desired for randomized Kaczmarz. If this intuitive justification is unsatisfying, we&#8217;ll have a formal derivation of correctness below (in a more general context).<\/p>\n\n\n\n<p>I find rejection sampling to be super neat. In this case, it allows us to use simple ingredients (uniform row sampling and an upper bound on the row norms) to accomplish a more complicated task (sampling according to the squared row norms). We can sample from an interesting probability distribution (the squared row norm distribution) by thinning out samples from a simple distribution. This is a powerful idea that has many applications. (And, I believe, many more applications are waiting to be discovered.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rejection Sampling in General<\/h2>\n\n\n\n<p>Let&#8217;s now discuss rejection sampling in a bit more generality. Say I have a list of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-75a5652acadcd645b180a972b75a9d09_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> things each of which has a <em>weight<\/em> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3853cb9708f805f3c7e9ce724f91bdd4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#92;&#103;&#101;&#32;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"51\" style=\"vertical-align: -3px;\"\/>. Our goal is to choose a random index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-06a46a64abb2fc8a9d51631fef84fe19_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> with probability proportional to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2137eab236d21a59debc8f8e8fc8bcd2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"18\" style=\"vertical-align: -3px;\"\/>, i.e., <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f2a26f9fab24c58ae39efe74a09df5e8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#32;&#73;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#119;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"187\" style=\"vertical-align: -8px;\"\/>. We will call <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-8daecae168d2c5e4e901c89360b57724_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"13\" style=\"vertical-align: 0px;\"\/> the <em>target distribution<\/em>. (Note that we do <em>not<\/em> require the weights <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2137eab236d21a59debc8f8e8fc8bcd2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"18\" style=\"vertical-align: -3px;\"\/> to be normalized to satisfy <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-c38d8003b56cc3b05b1dc8c613cb86ea_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#105;&#32;&#61;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"95\" style=\"vertical-align: -5px;\"\/>.)<\/p>\n\n\n\n<p>Suppose that sampling from the target distribution is challenging, but we can sample from a <em>proposal distribution<\/em> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-7b919ac10b1842ce6c184b39f6af86a6_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: -4px;\"\/>, i.e., we can efficiently generate random <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a1c2bb7eaffb023a3a873859c3cf09de_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/> such that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-74c685a526f37e412b1b88dd87f77df9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#74;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"181\" style=\"vertical-align: -8px;\"\/>. Further, suppose that the proposal distribution dominates the target distribution in the sense that <p class=\"ql-center-displayed-equation\" style=\"line-height: 17px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-7f2901cd8e565853465062e41a59b5bd_l3.png\" height=\"17\" width=\"235\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#119;&#95;&#105;&#32;&#92;&#108;&#101;&#32;&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#101;&#97;&#99;&#104;&#32;&#125;&#32;&#105;&#61;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#110;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>Under this general setting, we can sample <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-06a46a64abb2fc8a9d51631fef84fe19_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> from the target distribution using rejection sampling, similar to above:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Propose.<\/strong> Draw a random row index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a1c2bb7eaffb023a3a873859c3cf09de_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/> from the proposal distribution.<\/li>\n\n\n\n<li><strong>Accept\/reject.<\/strong> Make a random choice: With probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-cabb6018f52f6f28fa002b10dc58ede4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#74;&#32;&#61;&#32;&#119;&#95;&#74;&#47;&#92;&#114;&#104;&#111;&#95;&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"92\" style=\"vertical-align: -5px;\"\/>, accept and set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-352908d3a8f4132b4bdf6eff767186f8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;&#92;&#103;&#101;&#116;&#115;&#32;&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"49\" style=\"vertical-align: -1px;\"\/>. With the remaining probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-99c8241f9b786ac73eefd1364025ea2e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;&#45;&#112;&#95;&#74;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"48\" style=\"vertical-align: -4px;\"\/>, reject and return to step 1.<\/li>\n<\/ol>\n\n\n\n<p>We recognize the squared row-norm sampling above as an example of this general strategy with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-0decb199ea04141fd473b0079123f58f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#61;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"81\" style=\"vertical-align: -5px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f6eb9dec337de2ff8a12ced702bf77ef_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#61;&#32;&#66;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"52\" style=\"vertical-align: -4px;\"\/> for all <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>.<\/p>\n\n\n\n<p>Let us now convince ourselves more carefully that rejection sampling works. On any given execution of the rejection sampling loop, the probability of proposing index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2898fc9e0b9dfa018b8b98bb1b3bcd90_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"88\" style=\"vertical-align: -8px;\"\/>, after which the probability of accepting <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-7c9ade9795466fc811bd28f2c70699c4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#47;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"41\" style=\"vertical-align: -5px;\"\/>. Therefore, the probability of outputting <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> at any given loop is <p class=\"ql-center-displayed-equation\" style=\"line-height: 40px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f8fb5712ddc38527600d4fd51394bfc7_l3.png\" height=\"40\" width=\"401\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#36;&#105;&#36;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#114;&#104;&#111;&#95;&#105;&#125;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#106;&#125;&#32;&#92;&#99;&#100;&#111;&#116;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#119;&#95;&#105;&#125;&#123;&#92;&#114;&#104;&#111;&#95;&#105;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#119;&#95;&#105;&#125;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#106;&#125;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p> The probability that <em>any<\/em> index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> on that loop is accepted is thus <p class=\"ql-center-displayed-equation\" style=\"line-height: 50px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-87004ae4b99269f6917de03d3a4ec86e_l3.png\" height=\"50\" width=\"530\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#97;&#110;&#121;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#36;&#105;&#36;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#105;&#125;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#105;&#125;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>The rejection sampling loop accepts with fixed positive probability each execution, so it eventually accepts with 100% probability. Thus, the probability of accepting <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/> conditional on <em>some<\/em> index being accepted is <p class=\"ql-center-displayed-equation\" style=\"line-height: 47px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-8740003cf2cc5dfd18def3387663bcc2_l3.png\" height=\"47\" width=\"698\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#36;&#105;&#36;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#32;&#92;&#109;&#105;&#100;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#97;&#110;&#121;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#36;&#105;&#36;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#125;&#123;&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#97;&#110;&#121;&#32;&#97;&#99;&#99;&#101;&#112;&#116;&#101;&#100;&#32;&#116;&#104;&#105;&#115;&#32;&#108;&#111;&#111;&#112;&#125;&#92;&#125;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#119;&#95;&#105;&#125;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#106;&#125;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>Therefore, rejection sampling outputs a sample <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-06a46a64abb2fc8a9d51631fef84fe19_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> from the target distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-8daecae168d2c5e4e901c89360b57724_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"13\" style=\"vertical-align: 0px;\"\/> as promised.<\/p>\n\n\n\n<p>As this analysis shows, the probability of accepting on any given execution of the rejection sampling loop is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ea8204649eace1de5a5c587139a65178_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"133\" style=\"vertical-align: -5px;\"\/>, the ratio of the total mass of the target <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2137eab236d21a59debc8f8e8fc8bcd2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"18\" style=\"vertical-align: -3px;\"\/> to the total mass of the proposal <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-04f562916bf44242e3af44c095c135f7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: -4px;\"\/>. Thus, rejection sampling will have a high acceptance rate if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-062e88cc4d4f10e624d2ec10568100a9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#92;&#97;&#112;&#112;&#114;&#111;&#120;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"56\" style=\"vertical-align: -4px;\"\/> and a low acceptance rate if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-eef03ecd666aa81d2e9ba17b6ebfee7d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#92;&#108;&#108;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"60\" style=\"vertical-align: -4px;\"\/>. The conclusion for practice is that rejection sampling is only computationally efficient if one has access to a good proposal distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-04f562916bf44242e3af44c095c135f7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: -4px;\"\/>, that is both easy to sample from and close to the target <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-9e832cc906ff2e31c432905b8db2194e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#92;&#97;&#112;&#112;&#114;&#111;&#120;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"56\" style=\"vertical-align: -4px;\"\/>.<\/p>\n\n\n\n<p>Here, we have presented rejection sampling as a strategy for sampling from a discrete set of items <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ed4bf3ae29424671a5d9641f190fd3ac_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;&#61;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"89\" style=\"vertical-align: -4px;\"\/>, but this not all that rejection sampling can do. Indeed, one can also use rejection sampling for sampling a real-valued parameters <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-5a4828ab3cc2dd7c7cdc912546df5cc4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#92;&#105;&#110;&#32;&#92;&#114;&#101;&#97;&#108;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"45\" style=\"vertical-align: -1px;\"\/> or a multivariate parameter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-451b5a4bf53eb12c9f16f0e0b7904576_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#92;&#105;&#110;&#32;&#92;&#114;&#101;&#97;&#108;&#94;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"53\" style=\"vertical-align: -1px;\"\/> from a given (unnormalized) probability density function (or, if one likes, an unnormalized probability measure).<\/p>\n\n\n\n<p>Before moving on, let us make one final observation. A very convenient thing about rejection sampling is that we only need the <em>unnormalized<\/em> probability weights <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2137eab236d21a59debc8f8e8fc8bcd2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"18\" style=\"vertical-align: -3px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-04f562916bf44242e3af44c095c135f7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: -4px;\"\/> to implement the procedure, even though the total weights <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-b8d97625b76f29f2717e67ba06ebe9f7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"64\" style=\"vertical-align: -8px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-96d95dfd81fa0556fb79bb0d7a98feae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"60\" style=\"vertical-align: -8px;\"\/> are necessary to define the sampling probabilities <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-b83acb62ac2c7f4813883569c9d35b9a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#73;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#119;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#119;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"187\" style=\"vertical-align: -8px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-74c685a526f37e412b1b88dd87f77df9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#74;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#114;&#104;&#111;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"181\" style=\"vertical-align: -8px;\"\/>. This fact is necessary for many applications of rejection sampling. For instance, in the randomized Kaczmarz use, rejection sampling would be much less useful if we needed the total weight <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-6103a55f77b76922f15ba8e344252c0f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#97;&#95;&#105;&#125;&#94;&#50;&#32;&#61;&#32;&#92;&#110;&#111;&#114;&#109;&#123;&#65;&#125;&#95;&#123;&#92;&#114;&#109;&#32;&#70;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"149\" style=\"vertical-align: -5px;\"\/>, as computing <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-74e6def6cf762173d137b38dab12e852_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#110;&#111;&#114;&#109;&#123;&#65;&#125;&#95;&#123;&#92;&#114;&#109;&#32;&#70;&#125;&#94;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"38\" style=\"vertical-align: -5px;\"\/> requires a full pass over the data to compute.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Application: <a href=\"https:\/\/arxiv.org\/abs\/2207.06503\">Randomly pivoted Cholesky<\/a><\/h2>\n\n\n\n<p>Another application of rejection sampling appears is to accelerate <a href=\"https:\/\/arxiv.org\/abs\/2207.06503\">the randomly pivoted Cholesky algorithm<\/a>, the subject of my recent paper. Here, I&#8217;ll provide an overview of the main idea with a focus on the role of rejection sampling in the procedure. See <a href=\"https:\/\/arxiv.org\/abs\/2410.03969\">the paper<\/a> for more details. Warning: Even as simplified here, this section presents a significantly more involved application of rejection sampling than we saw previously with randomized Kaczmarz!<\/p>\n\n\n\n<p>Randomly pivoted Cholesky (RPCholesky) is a simple, but powerful algorithm for computing a <a href=\"https:\/\/www.ethanepperly.com\/index.php\/2021\/10\/26\/big-ideas-in-applied-math-low-rank-matrices\/#low-rank-approximation\">low-rank approximation<\/a> to a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Definite_matrix#Definitions\">symmetric positive semidefinite matrix<\/a> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>, and it can be used to accelerate <a href=\"https:\/\/en.wikipedia.org\/wiki\/Kernel_method\">kernel machine learning algorithms<\/a>.<\/p>\n\n\n\n<p>Conceptually, RPCholesky works as follows. Let <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-6cc4fdf0448b49849776dc7ca238aac1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#48;&#41;&#125;&#32;&#92;&#99;&#111;&#108;&#111;&#110;&#101;&#113;&#113;&#32;&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"72\" style=\"vertical-align: 0px;\"\/> denote the initial matrix and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-34496560b76871fcbcbbfc403d55b8e7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#48;&#41;&#125;&#32;&#92;&#99;&#111;&#108;&#111;&#110;&#101;&#113;&#113;&#32;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"68\" style=\"vertical-align: 0px;\"\/> denote a trivial initial approximation. For <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1b772460389c6b69cc53a46947a03016_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#106;&#61;&#48;&#44;&#49;&#44;&#50;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#107;&#45;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"154\" style=\"vertical-align: -4px;\"\/>, RPCholesky performs the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Random sampling.<\/strong> Draw a random index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-5234d1872de5a4ea5ad6d29ec31a6901_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;&#95;&#123;&#106;&#43;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"31\" style=\"vertical-align: -6px;\"\/> with probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-253a2b34c7e4fc3f3c9f6bae935735b5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#112;&#114;&#111;&#98;&#32;&#92;&#123;&#32;&#73;&#95;&#123;&#106;&#43;&#49;&#125;&#32;&#61;&#32;&#105;&#92;&#125;&#32;&#61;&#32;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#95;&#123;&#105;&#105;&#125;&#32;&#47;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#95;&#123;&#105;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"25\" width=\"231\" style=\"vertical-align: -6px;\"\/>.<\/li>\n\n\n\n<li><strong>Update approximation.<\/strong> Update <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-e84b9120531c7d692db872c604500ac2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#43;&#49;&#41;&#125;&#32;&#92;&#103;&#101;&#116;&#115;&#32;&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#43;&#32;&#97;&#95;&#105;&#94;&#123;&#40;&#106;&#41;&#125;&#40;&#97;&#95;&#105;&#94;&#123;&#40;&#106;&#41;&#125;&#41;&#94;&#92;&#116;&#111;&#112;&#32;&#47;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"246\" style=\"vertical-align: -5px;\"\/>. Here, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ea3afb911017973c2f5cb3dba32c9644_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#105;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"25\" style=\"vertical-align: -5px;\"\/> denotes the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>th column of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3ad648fd233eeb687179d63e20fabe8d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"29\" style=\"vertical-align: 0px;\"\/>.<\/li>\n\n\n\n<li><strong>Update matrix.<\/strong> Update <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-bcbfd2f320c4e81b204e4eae95601be4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#106;&#43;&#49;&#41;&#125;&#32;&#92;&#103;&#101;&#116;&#115;&#32;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#43;&#32;&#97;&#95;&#105;&#94;&#123;&#40;&#106;&#41;&#125;&#40;&#97;&#95;&#105;&#94;&#123;&#40;&#106;&#41;&#125;&#41;&#94;&#92;&#116;&#111;&#112;&#32;&#47;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"246\" style=\"vertical-align: -5px;\"\/>.<\/li>\n<\/ol>\n\n\n\n<p>The result of this procedure is a rank-<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f65286b751f121928913d4aa91d94ee9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#107;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> approximation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1c4bf6d3bbc4d0d14f397a693804b4b1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#107;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"30\" style=\"vertical-align: 0px;\"\/>. With an optimized implementation, RPCholesky requires only <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-a22fd632853f004753c466af46280372_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#79;&#40;&#107;&#94;&#50;&#78;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"61\" style=\"vertical-align: -5px;\"\/> operations and evaluates just <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-01ec0044d47367f533616457679c7f61_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#107;&#43;&#49;&#41;&#78;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"69\" style=\"vertical-align: -5px;\"\/> entries of the input matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>.<\/p>\n\n\n\n<p>The standard RPCholesky algorithm is already fast, but there is room for improvement. The standard RPCholesky method processes the matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> one column <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4c0a2a967894e2fd9b2da00447811f96_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"14\" style=\"vertical-align: -3px;\"\/> at a time, but modern computers are faster at processing <em>blocks<\/em> of columns. Using the power of rejection sampling, we can develop faster versions of RPCholesky that take advantage of blocked computations. These blocked implementations are important: While we could handle a million-by-million matrix using the standard RPCholesky method, blocked implementations can be up to 40<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-fcdf28e01d7e654ffcda2072b6f0aa56_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#116;&#105;&#109;&#101;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"10\" style=\"vertical-align: 0px;\"\/> <a href=\"https:\/\/arxiv.org\/html\/2410.03969v1#S3\">faster<\/a>. In this post, I&#8217;ll describe the simplest way of using rejection sampling to implement RPCholesky.<\/p>\n\n\n\n<p>To set the stage, let&#8217;s first establish some notation and make a few observations. Let <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-62186bd03fe6faec86e20c9673fd1b02_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#83;&#95;&#106;&#32;&#61;&#32;&#92;&#123;&#73;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#73;&#95;&#106;&#92;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"128\" style=\"vertical-align: -6px;\"\/> denote the first <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-fe087f8cefab0bcb3270609914ada26c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"9\" style=\"vertical-align: -4px;\"\/> selected random indices. With a little matrix algebra, one can show that the approximation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3dbcf45b99c488f5990af8612bcf23b5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"29\" style=\"vertical-align: 0px;\"\/> produced by <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-fe087f8cefab0bcb3270609914ada26c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"9\" style=\"vertical-align: -4px;\"\/> steps of RPCholesky obeys the formula<sup class=\"modern-footnotes-footnote \" data-mfn=\"1\" data-mfn-post-scope=\"000000000000057f0000000000000000_1883\"><a href=\"javascript:void(0)\"  role=\"button\" aria-pressed=\"false\" aria-describedby=\"mfn-content-000000000000057f0000000000000000_1883-1\">1<\/a><\/sup><span id=\"mfn-content-000000000000057f0000000000000000_1883-1\" role=\"tooltip\" class=\"modern-footnotes-footnote__note\" tabindex=\"0\" data-mfn=\"1\">For those interested, observe that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3dbcf45b99c488f5990af8612bcf23b5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"29\" style=\"vertical-align: 0px;\"\/> is an example of a <a href=\"https:\/\/www.ethanepperly.com\/index.php\/2022\/10\/11\/low-rank-approximation-toolbox-nystrom-approximation\/\">Nystr\u00f6m approximation<\/a>. The connection between Nystr\u00f6m approximation and Cholesky decomposition is explained in <a href=\"https:\/\/www.ethanepperly.com\/index.php\/2022\/10\/24\/nystrom-cholesky-and-schur\/\">this previous post<\/a> of mine.<\/span> <p class=\"ql-center-displayed-equation\" style=\"line-height: 24px;\"><span class=\"ql-right-eqno\"> (1) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ebc63948bd7d20eda4ccafa74555ba6b_l3.png\" height=\"24\" width=\"264\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#61;&#32;&#65;&#40;&#58;&#44;&#83;&#95;&#106;&#41;&#32;&#65;&#40;&#83;&#95;&#106;&#44;&#83;&#95;&#106;&#41;&#94;&#123;&#45;&#49;&#125;&#65;&#40;&#83;&#95;&#106;&#44;&#58;&#41;&#46;&#32;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>Here, we are using <a href=\"https:\/\/www.mathworks.com\/company\/technical-articles\/matrix-indexing-in-matlab.html\">MATLAB notation<\/a> for indexing the matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>. The residual matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3ad648fd233eeb687179d63e20fabe8d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"29\" style=\"vertical-align: 0px;\"\/> is given by <p class=\"ql-center-displayed-equation\" style=\"line-height: 24px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-dc5136dd307c099cb5fa70663104166b_l3.png\" height=\"24\" width=\"389\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#61;&#32;&#65;&#32;&#45;&#32;&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#61;&#32;&#65;&#32;&#45;&#32;&#65;&#40;&#58;&#44;&#83;&#95;&#106;&#41;&#32;&#65;&#40;&#83;&#95;&#106;&#44;&#83;&#95;&#106;&#41;&#94;&#123;&#45;&#49;&#125;&#65;&#40;&#83;&#95;&#106;&#44;&#58;&#41;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>Importantly for us, observe that we can evaluate the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>th diagonal entry of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-3ad648fd233eeb687179d63e20fabe8d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"29\" style=\"vertical-align: 0px;\"\/> using the formula <p class=\"ql-center-displayed-equation\" style=\"line-height: 25px;\"><span class=\"ql-right-eqno\"> (2) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-f8442521e6a6003a935f35d25aca1c73_l3.png\" height=\"25\" width=\"311\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#95;&#123;&#105;&#105;&#125;&#32;&#61;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#32;&#45;&#32;&#65;&#40;&#105;&#44;&#83;&#95;&#106;&#41;&#32;&#65;&#40;&#83;&#95;&#106;&#44;&#83;&#95;&#106;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#65;&#40;&#83;&#95;&#106;&#44;&#105;&#41;&#46;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>Compared to operating on the full input matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>, evaluating an entry <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-97a7a8178f519b922a65aae65f3a030b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#95;&#123;&#105;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"29\" style=\"vertical-align: -5px;\"\/> is cheap, just requiring some arithmetic involving matrices and vectors of size <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-fe087f8cefab0bcb3270609914ada26c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"9\" style=\"vertical-align: -4px;\"\/>.<\/p>\n\n\n\n<p>Here, we see a situation similar to randomized Kaczmarz. At each step of RPCholesky, we must sample a random index <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-5234d1872de5a4ea5ad6d29ec31a6901_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;&#95;&#123;&#106;&#43;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"31\" style=\"vertical-align: -6px;\"\/> from a target distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-9c60b825e49ef6d0120324eb201a39db_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#61;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"71\" style=\"vertical-align: -5px;\"\/>, but it is expensive to evaluate all of the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-2137eab236d21a59debc8f8e8fc8bcd2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"18\" style=\"vertical-align: -3px;\"\/>&#8216;s. This is a natural setting for rejection sampling. As proposal distribution, we may use the initial diagonal of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/>, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-148453d2c7996fd6d0df361eab285929_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#61;&#32;&#65;&#95;&#123;&#105;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"61\" style=\"vertical-align: -4px;\"\/>. (One may verify that, as required, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-ac42029e8f2678b06f3f543ad12e2c97_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#61;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#94;&#123;&#40;&#106;&#41;&#125;&#32;&#92;&#108;&#101;&#32;&#65;&#95;&#123;&#105;&#105;&#125;&#32;&#61;&#32;&#92;&#114;&#104;&#111;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"158\" style=\"vertical-align: -5px;\"\/> for all <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-4015d3bcae440238eb2e7a73e66bae43_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>.) This leads to a <em>rejection sampling implementation for RPCholesky<\/em>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Sample indices.<\/strong> For <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1b6ff589d387ee141553f4c98436690d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#106;&#61;&#48;&#44;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#107;&#45;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"137\" style=\"vertical-align: -4px;\"\/>, sample random indices <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-5234d1872de5a4ea5ad6d29ec31a6901_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#73;&#95;&#123;&#106;&#43;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"31\" style=\"vertical-align: -6px;\"\/> from the target distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-8e57d2031c6906708e310ac5e67e46fb_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;&#32;&#61;&#32;&#65;&#94;&#123;&#40;&#106;&#41;&#125;&#95;&#123;&#105;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"71\" style=\"vertical-align: -5px;\"\/> using rejection sampling with proposal distribution <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-148453d2c7996fd6d0df361eab285929_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#114;&#104;&#111;&#95;&#105;&#32;&#61;&#32;&#65;&#95;&#123;&#105;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"61\" style=\"vertical-align: -4px;\"\/>. Entries <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-574efc9ddaef87ca00a1049fe5bb0d28_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;&#95;&#123;&#105;&#105;&#125;&#94;&#123;&#40;&#106;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"29\" style=\"vertical-align: -5px;\"\/> are evaluated on an as-needed basis using (2).<\/li>\n\n\n\n<li><strong>Build the approximation.<\/strong> Form the approximation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-1c4bf6d3bbc4d0d14f397a693804b4b1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#65;&#125;&#94;&#123;&#40;&#107;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"30\" style=\"vertical-align: 0px;\"\/> all at once using (1).<\/li>\n<\/ol>\n\n\n\n<p>By using rejection sampling, we have gone from an algorithm which handles the matrix one column at a time to a new algorithm which processes columns of the matrix <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> all at once through the formula (1). In the right situations, this new algorithm can be significantly faster than the original RPCholesky method.<sup class=\"modern-footnotes-footnote \" data-mfn=\"2\" data-mfn-post-scope=\"000000000000057f0000000000000000_1883\"><a href=\"javascript:void(0)\"  role=\"button\" aria-pressed=\"false\" aria-describedby=\"mfn-content-000000000000057f0000000000000000_1883-2\">2<\/a><\/sup><span id=\"mfn-content-000000000000057f0000000000000000_1883-2\" role=\"tooltip\" class=\"modern-footnotes-footnote__note\" tabindex=\"0\" data-mfn=\"2\">In its essence, this rejection sampling algorithm for RPCholesky was first proposed in <a href=\"https:\/\/proceedings.neurips.cc\/paper_files\/paper\/2023\/hash\/cf7ba4b2d14e0f6a0e8247af77745094-Abstract-Conference.html\">this paper of mine<\/a>, which uses rejection sampling to apply RPCholesky to infinite-dimensional positive definite kernel operators. The ability to handle infinite-dimensional sampling problems is another great strength of the rejection sampling approach.<\/span>\n\n\n\n<p>We have now seen two extreme cases: the standard RPCholesky algorithm that processes the columns of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> one at a time and a rejection sampling implementation that operates on the columns of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-11f4f587954b361e7d78940f65b8d70d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"13\" style=\"vertical-align: 0px;\"\/> all at once. In practice, the fastest algorithm sits between these extremes, using rejection sampling to sample column indices in moderate-size blocks (say, between 100 and 1000 columns at a time). This &#8220;goldilocks&#8221; algorithm is the accelerated RPCholesky method that we introduce in our paper. <a href=\"https:\/\/arxiv.org\/html\/2410.03969v1#S3\">Check it out<\/a> for details!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion: Rejection Sampling, an Algorithm Design Tool<\/h2>\n\n\n\n<p>We&#8217;ve now seen two applications, randomized Kaczmarz and randomly pivoted Cholesky, where rejection sampling can be used to speed up an algorithm. In both cases, we wanted to sample from a distribution over <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ethanepperly.com\/wp-content\/ql-cache\/quicklatex.com-75a5652acadcd645b180a972b75a9d09_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> row or column indices, but it was expensive to perform a census to compute the probability weight of each item individually. Rejection sampling offers a different approach, where we generate samples from a cheap-to-sample proposal distribution and only evaluate the probability weights of the proposed items. In the right situations, this rejection sampling approach can lead to significant computational speedups.<\/p>\n\n\n\n<p>Rejection sampling has been used by statistics-oriented folks for decades, but the power of this technique seems less well-known to researchers in applied math, scientific computation, and related areas. I think there are a lot more exciting ways that we can use rejection sampling to design better, faster randomized algorithms.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am delighted to share that my paper Embrace rejection: Kernel matrix approximation with randomly pivoted Cholesky has been released on arXiv, joint with Joel Tropp and Rob Webber. On the occasion of this release, I want to talk about rejection sampling, one of the most powerful ideas in probabilistic computing. My goal is to<a class=\"more-link\" href=\"https:\/\/www.ethanepperly.com\/index.php\/2024\/10\/08\/rejection-sampling\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-1883","post","type-post","status-publish","format-standard","hentry","category-expository","category-research"],"_links":{"self":[{"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/posts\/1883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/comments?post=1883"}],"version-history":[{"count":9,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/posts\/1883\/revisions"}],"predecessor-version":[{"id":2033,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/posts\/1883\/revisions\/2033"}],"wp:attachment":[{"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/media?parent=1883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/categories?post=1883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ethanepperly.com\/index.php\/wp-json\/wp\/v2\/tags?post=1883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}