<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Statistics on Abstract Nonsense</title><link>https://abstractnonsense.xyz/tags/statistics/</link><description>Recent content in Statistics on Abstract Nonsense</description><generator>Hugo</generator><language>en-AU</language><managingEditor>hello@abstractnonsense.xyz (Yossi Frenkel)</managingEditor><webMaster>hello@abstractnonsense.xyz (Yossi Frenkel)</webMaster><lastBuildDate>Mon, 18 May 2026 10:21:38 +1000</lastBuildDate><atom:link href="https://abstractnonsense.xyz/tags/statistics/index.xml" rel="self" type="application/rss+xml"/><item><title>Pseudorandom number generation in JAX</title><link>https://abstractnonsense.xyz/microblog/2026-05-17-pseudorandom-number-generation-in-jax/</link><pubDate>Sun, 17 May 2026 00:00:00 +0000</pubDate><author>hello@abstractnonsense.xyz (Yossi Frenkel)</author><guid>https://abstractnonsense.xyz/microblog/2026-05-17-pseudorandom-number-generation-in-jax/</guid><description>&lt;p&gt;Recently I&amp;rsquo;ve been working on a statistics library in &lt;a href="https://github.com/typst/typst"&gt;Typst&lt;/a&gt; called &lt;a href="https://github.com/stochastical/distro"&gt;&lt;code&gt;distro&lt;/code&gt;&lt;/a&gt;&lt;label for="fn0" class="footnote-trigger"&gt;*&lt;/label&gt;&lt;input type="checkbox" id="fn0" class="footnote-checkbox" /&gt;&lt;small class="footnote-aside" id="fn0"&gt;More to come soon&lt;/small&gt;. Typst is architected with an &lt;a href="https://github.com/typst/typst/blob/main/docs/dev/architecture.md#compilation"&gt;incremental&lt;/a&gt; &lt;a href="https://github.com/typst/comemo/"&gt;compiler&lt;/a&gt;, and pairs it with pure functions&lt;label for="fn1" class="footnote-trigger"&gt;*&lt;/label&gt;&lt;input type="checkbox" id="fn1" class="footnote-checkbox" /&gt;&lt;small class="footnote-aside" id="fn1"&gt;Almost all functions in Typst are pure, with a &lt;a href="https://typst.app/docs/reference/foundations/function/#:~:text=Note%20on%20function%20purity"&gt;few exceptions&lt;/a&gt;&lt;/small&gt; to facilitate snappy real-time compilation.&lt;/p&gt;
&lt;p&gt;The problem is, what to do about random number generation when your functions are supposed to be referentially transparent? Well, thankfully that&amp;rsquo;s a solved problem with a neat solution. For instance, &lt;a href="https://docs.jax.dev/en/latest/random-numbers.html#random-numbers-in-jax"&gt;JAX relies&lt;/a&gt; on an explicit &amp;lsquo;key&amp;rsquo; value, that is consumed by the PRNG, and returns an updated state that is then passed back into the PRNG to generate the next random sample.&lt;/p&gt;</description></item></channel></rss>