<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Random Sampling on Home</title>
    <link>https://jordanbchilds.github.io/tags/random-sampling/</link>
    <description>Recent content in Random Sampling on Home</description>
    <image>
      <title>Home</title>
      <url>https://jordanbchilds.github.io/images/profile.JPG</url>
      <link>https://jordanbchilds.github.io/images/profile.JPG</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language><atom:link href="https://jordanbchilds.github.io/tags/random-sampling/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A simple discrete random sampler in C&#43;&#43;</title>
      <link>https://jordanbchilds.github.io/posts/discreterandomsampler/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://jordanbchilds.github.io/posts/discreterandomsampler/</guid>
      <description>&lt;p&gt;Sampling from a finite set of weighted outcomes is a small task that appears surprisingly often in simulation, stochastic modelling, and Monte Carlo methods. In this post we build a compact C++ function for drawing from a discrete distribution, then compare its behaviour with &lt;code&gt;std::discrete_distribution&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We will briefly discuss how to sample a discrete random variable in theory and practice, before constructing our own algorithm and comparing its performance to the &lt;code&gt;std::discrete_distribution&lt;/code&gt; in the C++ standard library. Many hand-coded discrete samplers have been proposed, but often these are unnecessarily clunky and, consequently, slow.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>