<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.2">Jekyll</generator><link href="https://bayes.net/feed.xml" rel="self" type="application/atom+xml" /><link href="https://bayes.net/" rel="alternate" type="text/html" /><updated>2026-07-12T06:58:30+00:00</updated><id>https://bayes.net/feed.xml</id><title type="html">bayes.net</title><subtitle>Tom Adamczewski's blog</subtitle><entry><title type="html">Claude 4 hacked SWE-bench by peeking at future commits</title><link href="https://bayes.net/swebench-hack/" rel="alternate" type="text/html" title="Claude 4 hacked SWE-bench by peeking at future commits" /><published>2025-09-05T00:00:00+00:00</published><updated>2025-09-05T00:00:00+00:00</updated><id>https://bayes.net/swebench-hack</id><content type="html" xml:base="https://bayes.net/swebench-hack/"><![CDATA[<p>In a <a href="/swebench-docker/">previous post</a> about creating a Docker registry of SWE-bench images, I made a brief side note about hypothetical reward hacking:</p>

<blockquote>
  <p>[…] as a side note, it’s worth asking whether the git history should be included at all. It makes sense for the model to have access to the past git history, like a human developer would. However, the model should not have access to <em>future</em> history from after the PR was merged. A sophisticated cheating model could in theory reward hack the evaluation if there is any way to access future history. I believe that is possible in some circumstances even after a <code class="language-plaintext highlighter-rouge">git reset --hard</code> and <code class="language-plaintext highlighter-rouge">git remote remove origin</code>. For example, if version tags are used, the model could <code class="language-plaintext highlighter-rouge">git checkout &lt;tag&gt;</code> a future tag. Or it could access the dangling commits in some way, perhaps with <code class="language-plaintext highlighter-rouge">git fsck --lost-found</code>. I believe this is unlikely to be a problem currently, but could become one with future models.</p>
</blockquote>

<p>Less than two months later, it seems that this behaviour has now been seen in the wild!</p>

<p>A META AI researcher has just posted an <a href="https://github.com/SWE-bench/SWE-bench/issues/465">issue</a> on the SWE-bench repo:</p>

<blockquote>
  <p>We’ve identified multiple loopholes with SWE Bench Verified where agents may look at future repository state (by querying it directly or through a variety of methods), and cases in which future repository state includes either solutions or detailed approaches to solving problems (commit messages and more).</p>

  <p>…
In a trajectory with Claude 4 Sonnet, pytest-dev__pytest-6202, the agent uses <code class="language-plaintext highlighter-rouge">git log --all</code> which leaks future commits that directly fix the issue.</p>
</blockquote>

<p>Claude 4 Sonnet came out in May 2025, and I wrote my post in July. I was quite wrong about how long it would take for models to become sophisticated enough to cheat in this way. They were already doing it. I had never seen a model attempt this loophole, but one man can only read so many SWE-bench traces.</p>

<p>The command <code class="language-plaintext highlighter-rouge">git log --all</code> (which I didn’t know about) shows all commits reachable from any ref. A ref is any <a href="https://git-scm.com/book/ms/v2/Git-Internals-Git-References">reference</a> to the SHA-1 value of a commit, found under <code class="language-plaintext highlighter-rouge">.git/refs</code>, and includes: (1) the heads of branches, (2) tags, (3) remotes, and (4) any manually created refs. As I explained in the previous post, the original SWE-bench authors only removed the default remote, with a code comment: “Remove the remote so the agent won’t see newer commits”. But they didn’t think about other refs, like tags (a fix is <a href="https://github.com/SWE-bench/SWE-bench/issues/465">underway</a>).</p>

<p><code class="language-plaintext highlighter-rouge">git log --all</code> lets a cheating model efficiently find any (non-dangling) commits, without having to look through the refs and figure out which one might point to future history and be usable for cheating. For example, Claude 4 Sonnet cleverly searched for commit messages with keywords relevant to the issue: <code class="language-plaintext highlighter-rouge">git log --oneline --all | grep -i "bracket|parametrize|modpath"</code>.</p>

<p>In the <code class="language-plaintext highlighter-rouge">pytest-6202</code> example, the issue is from November 2019. <code class="language-plaintext highlighter-rouge">git log --all</code> shows commits up to <code class="language-plaintext highlighter-rouge">d0f136f</code> (September 2024), which is tagged as <code class="language-plaintext highlighter-rouge">8.3.3</code>. Indeed <code class="language-plaintext highlighter-rouge">8.3.3</code> seems to be the highest version tag present on the main branch:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ git tag --list
1.0.0
1.0.0b3
1.0.0b6
...many more tags...
8.3.2
8.3.3
8.4.0.dev0
v7.4.3
</code></pre></div></div>

<p>In the example issues I looked at, git tags were the reason the future history was available. This is exactly the vulnerability that had jumped out at me when I looked into how the Docker images are constructed.</p>

<p>In  <code class="language-plaintext highlighter-rouge">pytest-6202</code>, deleting all tags is sufficient to remove the offending commits from <code class="language-plaintext highlighter-rouge">git log --all</code>.  However, a <code class="language-plaintext highlighter-rouge">git fsck --lost-found</code> will uncover the dangling tags and commits (ones not pointed to by any ref).</p>

<p>Here we must get into one subtlety. <code class="language-plaintext highlighter-rouge">git show-ref 8.3.3</code> will show <code class="language-plaintext highlighter-rouge">d430e32</code>, not <code class="language-plaintext highlighter-rouge">d0f136f</code>, the actual September 2024 commit. <code class="language-plaintext highlighter-rouge">d430e32</code> is the SHA-1 of the <a href="https://git-scm.com/book/ms/v2/Git-Internals-Git-References">annotated tag object</a>, which itself points to the actual commit <code class="language-plaintext highlighter-rouge">d0f136f</code>.  <code class="language-plaintext highlighter-rouge">git show-ref --dereference 8.3.3</code> can be used to show <code class="language-plaintext highlighter-rouge">d0f136f</code>.</p>

<p>Even after deleting tags, <code class="language-plaintext highlighter-rouge">git fsck --lost-found</code> will uncover</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ git fsck --lost-found
...
dangling tag d430e325c6d8c7161ae2e468ea5045a163e4c517
...
</code></pre></div></div>

<p>A cheater can then directly do <code class="language-plaintext highlighter-rouge">git checkout d430e32</code>, which moves the <code class="language-plaintext highlighter-rouge">HEAD</code> to the September 2024 commit <code class="language-plaintext highlighter-rouge">d0f136f</code>.  Since <code class="language-plaintext highlighter-rouge">HEAD</code> is a ref, <code class="language-plaintext highlighter-rouge">git log --all</code> will at that point show the entire future history, just like before we deleted the tags (in fact you don’t need the <code class="language-plaintext highlighter-rouge">--all</code> now).</p>

<p>My understanding is that <code class="language-plaintext highlighter-rouge">git gc --prune=now</code> (<a href="https://git-scm.com/docs/git-gc">docs</a>) removes any unreachable objects. The documentation says:</p>

<blockquote>
  <p><code class="language-plaintext highlighter-rouge">git gc</code> tries very hard not to delete objects that are referenced anywhere in your repository. In particular, it will keep not only objects referenced by your current set of branches and tags, but also objects referenced by the index, remote-tracking branches, reflogs (which may reference commits in branches that were later amended or rewound), and anything else in the refs/* namespace.</p>
</blockquote>

<p>The reflog and index are strictly local, so there should be nothing in them just after cloning. We’ve covered branches, tags, and remotes. The only exception I can think of are manually created refs (using <code class="language-plaintext highlighter-rouge">git update-ref</code>), which should be extremely unusual. To mitigate this, one could trust only the <code class="language-plaintext highlighter-rouge">HEAD</code> ref and delete all others.</p>

<p>I spent a couple of hours today trying to find other loopholes that work even after <code class="language-plaintext highlighter-rouge">git gc</code>. I scoured various git internals I had never thought about before, like packfiles (in <code class="language-plaintext highlighter-rouge">.git/objects/pack</code>), or <code class="language-plaintext highlighter-rouge">.git/objects/info/commit-graph</code>. None of these worked. But git is a big program with a lot of arcane features, and I only tried a couple of SWE-bench issues. Can you find a more sophisticated hack?</p>]]></content><author><name></name></author><summary type="html"><![CDATA[I predicted future AI models would someday learn to cheat on SWE-bench. They were already doing it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/claude-hacker.png" /><media:content medium="image" url="https://bayes.net/assets/images/claude-hacker.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to run SWE-bench Verified in one hour on one machine</title><link href="https://bayes.net/swebench-docker/" rel="alternate" type="text/html" title="How to run SWE-bench Verified in one hour on one machine" /><published>2025-07-10T00:00:00+00:00</published><updated>2025-07-10T00:00:00+00:00</updated><id>https://bayes.net/swebench-docker</id><content type="html" xml:base="https://bayes.net/swebench-docker/"><![CDATA[<p><em>I wrote this post for Epoch AI, where I work. You can also read it on the <a href="https://epoch.ai/blog/swebench-docker">Epoch AI blog</a></em></p>

<p>We are releasing a <a href="https://github.com/orgs/epoch-research/packages?repo_name=SWE-bench">public registry</a> of Docker images for SWE-bench, to help the community run more efficient and reproducible SWE-bench evaluations. By making better use of layer caching, we reduced the total size of the registry to 67 GiB for all 2290 SWE-bench images (10x reduction), and to 30 GiB for 500 SWE-bench Verified images (6x reduction). This allows us to run SWE-bench Verified in 62 minutes on a single GitHub actions VM with 32 cores and 128GB of RAM.</p>

<h2 id="background">Background</h2>

<p>SWE-bench is a benchmark designed to evaluate large language models on real-world software engineering tasks. It consists of 2,294 GitHub issues from 12 popular Python repositories, paired with the actual pull requests that resolved those issues.</p>

<p>For each task, the AI system is given access to the repo in its state immediately before the pull request was merged, along with the issue description. The AI system must then modify the codebase to fix the problem. Success is measured by whether the AI system’s solution passes the test suite from after the pull request was merged—meaning the AI system must produce changes that satisfy the same tests that validated the human developer’s solution.</p>

<p><a href="https://openai.com/index/introducing-swe-bench-verified/">SWE-bench Verified</a> is a human-validated subset of 500 problems from the original benchmark.</p>

<p>SWE-bench has traditionally been considered a challenging benchmark to run. For example, the All Hands team <a href="https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed">reports</a> that it originally took them “several days” to run SWE-bench lite (300 examples), or over 10 minutes per sample. By using 32 machines in parallel, they reduced this to “several hours”.</p>

<h2 id="swe-bench-and-docker">SWE-bench and Docker</h2>

<p>During SWE-bench evaluation, the AI system directly modifies a codebase in a sandbox with the necessary dependencies. Each question requires its own sandbox environment to capture the exact state of the repo immediately before the PR was merged, and these environments are specified using Docker images. The <a href="https://github.com/SWE-bench/SWE-bench">SWE-bench repo</a> contains scripts that generate Dockerfiles and their context from the SWE-bench dataset, but without an image registry that stores the actual images, these images must be built from source.</p>

<p>There are two problems with building from source:</p>

<p><strong>Speed:</strong> Building the images takes a long time. When operating on a development machine, you only need to build them once, after which they are cached. However, to run rigorously auditable evaluations at scale, like we do for our <a href="https://epoch.ai/data/ai-benchmarking-dashboard">Benchmarking Hub</a>, it’s necessary to use cloud-based VMs that are ephemeral. In this case, every evaluation run would require building all the images again.</p>

<p><strong>Reproducibility:</strong> The build process relies on external resources (like <code class="language-plaintext highlighter-rouge">apt</code> or PyPI packages), so images built at different times may not be identical, even if the Dockerfiles and local context are the same. In particular, if the Dockerfiles do not pin versions for dependencies (which SWE-bench Dockerfiles generally do not, see below), the image will depend on the dependency resolution at build time. In addition, if a version of some dependency becomes unavailable, or moves to another address, etc., the build will fail. This may become an increasing problem over time, as many of the SWE-bench issues are now quite old (e.g. from 2015).</p>

<p>Therefore, our first contribution is a <a href="https://github.com/orgs/epoch-research/packages?repo_name=SWE-bench">public registry</a> of Docker images for SWE-bench, containing 2290 images for the x86_64 architecture (we were unable to build 4 out of 2294 images). This registry is free for anyone to use.</p>

<p>In addition, we optimized the images so that the total size of the registry is reduced by 6-10x. The rest of this post describes these optimizations.</p>

<h2 id="docker-layering">Docker layering</h2>
<p>The 2294 issues are from 12 repos, so many issues share the same repo. In fact, the distribution is heavily skewed, with Django accounting for 850/2294, or 37% of the issues.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/swebench-docker/img-400-ca96d351f.webp 400w, /generated/_posts/../assets/images/swebench-docker/img-493-ca96d351f.webp 493w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/swebench-docker/img-400-ca96d351f.jpeg 400w, /generated/_posts/../assets/images/swebench-docker/img-493-ca96d351f.jpeg 493w" type="image/jpeg" /><img alt="img.png" src="/generated/_posts/../assets/images/swebench-docker/img-493-ca96d351f.png" width="493" height="427" /></picture>

<figcaption class="caption">
  <p>Distribution of SWE-bench issues by repository, showing Django accounts for 850 out of 2294 total issues.</p>
</figcaption>
<p><br /></p>

<p>In addition, many issues will be close to each other in time, so the codebase will likely be similar. Two Django issues a week apart, for example, will have very similar dependencies. The main difference between them will be the change in application code between the two issues (usually a small fraction of the total codebase).</p>

<p>This is a perfect use case for Docker’s layer caching. What follows is a slightly simplified 1-paragraph explanation of layer caching. Each <code class="language-plaintext highlighter-rouge">RUN</code>, <code class="language-plaintext highlighter-rouge">COPY</code>, or <code class="language-plaintext highlighter-rouge">ADD</code> instruction in a Dockerfile creates a layer. A layer represents a specific modification to the container’s file system. Layers are added from bottom to top. Each layer is cached: if I change a layer, only layers above (that depend on it) will be rebuilt. In other words, if I make a change to a Dockerfile instruction and rebuild, this line and subsequent lines in the Dockerfile will have their layers re-built. Previous lines do not need to run again.<sup id="fnref:metaphor" role="doc-noteref"><a href="#fn:metaphor" class="footnote" rel="footnote">1</a></sup></p>

<p>The SWE-bench Dockerfiles, <a href="https://github.com/SWE-bench/SWE-bench/tree/0c0de95298dc502afa94b49bd8384e5f3ef81790/docs/20240627_docker">created</a> by Princeton researchers and OpenAI staff, do not make good use of layer caching and leave much low-hanging fruit for optimisation.</p>

<p>I will highlight just a few of the optimisations I made. To skip directly to overall results on size and runtime, <a href="#impact-size">click here</a>. If you are interested in the full list of optimisations, it’s in the commit history of <a href="https://github.com/epoch-research/SWE-bench">this repo</a>.</p>

<h3 id="anatomy-of-a-swe-bench-dockerfile">Anatomy of a SWE-bench Dockerfile</h3>
<p>Let’s take a closer look at a typical Django instance, <code class="language-plaintext highlighter-rouge">django__django-13371</code>.<sup id="fnref:cherry" role="doc-noteref"><a href="#fn:cherry" class="footnote" rel="footnote">2</a></sup></p>

<p>All SWE-bench images are  built in three stages, <code class="language-plaintext highlighter-rouge">base</code>, <code class="language-plaintext highlighter-rouge">env</code>, and <code class="language-plaintext highlighter-rouge">instance</code>. Many <code class="language-plaintext highlighter-rouge">instance</code> images depend on a single <code class="language-plaintext highlighter-rouge">env</code> image. For example, the 850 Django images rely on 12 <code class="language-plaintext highlighter-rouge">env</code> images.</p>

<p>The Dockerfiles are all virtually identical and outsource the actual work to a <code class="language-plaintext highlighter-rouge">setup_env.sh</code> and <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> script.</p>

<p>Here is the <code class="language-plaintext highlighter-rouge">base</code> Dockerfile:</p>
<div class="language-Dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Base (ghcr.io/epoch-research/sweb-c7d4d9d4.base.x86_64)</span>
<span class="k">FROM</span><span class="s"> --platform=linux/x86_64 ubuntu:22.04</span>

<span class="c">## ... long apt install command omitted ...</span>

<span class="c"># Download and install conda</span>
<span class="k">RUN </span>wget <span class="s1">'https://repo.anaconda.com/miniconda/Miniconda3-py311_23.11.0-2-Linux-x86_64.sh'</span> <span class="nt">-O</span> miniconda.sh <span class="se">\
</span>    <span class="o">&amp;&amp;</span> bash miniconda.sh <span class="nt">-b</span> <span class="nt">-p</span> /opt/miniconda3
<span class="c"># Add conda to PATH</span>
<span class="k">ENV</span><span class="s"> PATH=/opt/miniconda3/bin:$PATH</span>
<span class="c"># Add conda to shell startup scripts like .bashrc (DO NOT REMOVE THIS)</span>
<span class="k">RUN </span>conda init <span class="nt">--all</span>
<span class="k">RUN </span>conda config <span class="nt">--append</span> channels conda-forge

<span class="k">RUN </span>adduser <span class="nt">--disabled-password</span> <span class="nt">--gecos</span> <span class="s1">'dog'</span> nonroot
</code></pre></div></div>

<p>And here is the <code class="language-plaintext highlighter-rouge">env</code> Dockerfile:</p>

<div class="language-Dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># env (ghcr.io/epoch-research/sweb-c7d4d9d4.env.x86_64.e83e37f52c09532c62acfb)</span>
<span class="k">FROM</span><span class="s"> --platform=linux/x86_64 ghcr.io/epoch-research/sweb-c7d4d9d4.base.x86_64:latest</span>

<span class="k">COPY</span><span class="s"> ./setup_env.sh /root/</span>
<span class="k">RUN </span><span class="nb">chmod</span> +x /root/setup_env.sh
<span class="k">RUN </span>/bin/bash <span class="nt">-c</span> <span class="s2">"source ~/.bashrc &amp;&amp; /root/setup_env.sh"</span>

<span class="k">WORKDIR</span><span class="s"> /testbed/</span>

<span class="c"># Automatically activate the testbed environment</span>
<span class="k">RUN </span><span class="nb">echo</span> <span class="s2">"source /opt/miniconda3/etc/profile.d/conda.sh &amp;&amp; conda activate testbed"</span> <span class="o">&gt;</span> /root/.bashrc
</code></pre></div></div>

<p>Finally, here is the <code class="language-plaintext highlighter-rouge">instance</code> Dockerfile:</p>

<div class="language-Dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># instance (ghcr.io/epoch-research/sweb-c7d4d9d4.eval.x86_64.django__django-13371)</span>
<span class="k">FROM</span><span class="s"> --platform=linux/x86_64 ghcr.io/epoch-research/sweb-c7d4d9d4.env.x86_64.e83e37f52c09532c62acfb:latest</span>

<span class="k">COPY</span><span class="s"> ./setup_repo.sh /root/</span>
<span class="k">RUN </span>/bin/bash /root/setup_repo.sh

<span class="k">WORKDIR</span><span class="s"> /testbed/</span>
</code></pre></div></div>

<p>Side note: although we are here calling <code class="language-plaintext highlighter-rouge">env</code> and <code class="language-plaintext highlighter-rouge">instance</code> different ‘stages’, this is different from a genuine <a href="https://docs.docker.com/build/building/multi-stage/">multi-stage build</a>. For more detail, look at this footnote<sup id="fnref:not-multi-stage" role="doc-noteref"><a href="#fn:not-multi-stage" class="footnote" rel="footnote">3</a></sup>.</p>

<p>Let’s look at the <code class="language-plaintext highlighter-rouge">setup_env.sh</code> and <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> scripts for the Django 13371 instance.</p>

<p>This is the <code class="language-plaintext highlighter-rouge">setup_env.sh</code> script:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># setup_env.sh for `env` image e83e37f52c09532c62acfb</span>
<span class="c"># (used by Django 13371)</span>
<span class="nb">set</span> <span class="nt">-euxo</span> pipefail
<span class="nb">source</span> /opt/miniconda3/bin/activate
conda create <span class="nt">-n</span> testbed <span class="nv">python</span><span class="o">=</span>3.6 <span class="nt">-y</span>
<span class="nb">cat</span> <span class="o">&lt;&lt;</span><span class="sh">'</span><span class="no">EOF_59812759871</span><span class="sh">' &gt; </span><span class="nv">$HOME</span><span class="sh">/requirements.txt
asgiref &gt;= 3.3.2
argon2-cffi &gt;= 16.1.0
...long list of dependencies truncated...
colorama; sys.platform == 'win32'
</span><span class="no">EOF_59812759871


</span>conda activate testbed <span class="o">&amp;&amp;</span> python <span class="nt">-m</span> pip <span class="nb">install</span> <span class="nt">-r</span> <span class="nv">$HOME</span>/requirements.txt
<span class="nb">rm</span> <span class="nv">$HOME</span>/requirements.txt
conda activate testbed
</code></pre></div></div>

<p>And this is the <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> script:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># setup_repo.sh for django__django-13371</span>
<span class="nb">set</span> <span class="nt">-euxo</span> pipefail
git clone <span class="nt">-o</span> origin https://github.com/django/django /testbed
<span class="nb">chmod</span> <span class="nt">-R</span> 777 /testbed
<span class="nb">cd</span> /testbed
git reset <span class="nt">--hard</span> 3a9f192b131f7a9b0fe5783c684b23015fa67cc8
git remote remove origin
<span class="nb">source</span> /opt/miniconda3/bin/activate
conda activate testbed
<span class="nb">echo</span> <span class="s2">"Current environment: </span><span class="nv">$CONDA_DEFAULT_ENV</span><span class="s2">"</span>
python <span class="nt">-m</span> pip <span class="nb">install</span> <span class="nt">-e</span> <span class="nb">.</span>
</code></pre></div></div>

<p>There are numerous things to comment on here, but how do we find the most important optimisations to reduce the overall size of the images required to run SWE-bench?</p>

<p>We can use the fantastic tool <code class="language-plaintext highlighter-rouge">dive</code> (<a href="https://github.com/wagoodman/dive">github.com/wagoodman/dive</a>), which lets us see the layers of an image and their size. We can also see what actually changed on the filesystem in each layer with the file tree view on the right-hand side.</p>

<p>For example, here is the <code class="language-plaintext highlighter-rouge">dive</code> output for the Django 13371 image, focusing on the layer created by <code class="language-plaintext highlighter-rouge">setup_env.sh</code>:</p>

<figure>
<img src="../assets/images/swebench-docker/img_1.png" />
<figcaption class="caption">
    <p>The <code class="language-plaintext highlighter-rouge">dive</code> tool output for the Django 13371 image.</p>
  </figcaption>
</figure>

<p>In the next section, I’ll explain how to interpret this output to suggest optimisations.</p>

<h3 id="moving-the-git-clone-operation">Moving the git clone operation</h3>
<p>One salient feature of the output above can be seen from the layer sizes (top-left corner) alone: the topmost layer, corresponding to <code class="language-plaintext highlighter-rouge">setup_repo.sh</code>, is 330MB. Optimizations to this layer are tens of times more impactful than optimizations to the <code class="language-plaintext highlighter-rouge">setup_env.sh</code> layer, because the <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> layer is different for each instance. (The ratio should be roughly 12:850 for the full SWE-bench, which is 70x, and still well over 10x for SWE-bench Verified)</p>

<p><code class="language-plaintext highlighter-rouge">setup_repo.sh</code> does two major things in terms of disk space:</p>
<ul>
  <li>Cloning the Django repo with its full git history (<code class="language-plaintext highlighter-rouge">git clone -o origin https://github.com/django/django /testbed</code>)</li>
  <li>Installing any additional dependencies required by this specific revision, that were not already present in the <code class="language-plaintext highlighter-rouge">env</code> image (<code class="language-plaintext highlighter-rouge">python -m pip install -e .</code>)</li>
</ul>

<p>Which of these is more important? By looking at the layer contents, we can see that, in this case, very few other dependencies were needed, and cloning the repo took up virtually all the 330MB.</p>

<figure>
<img src="../assets/images/swebench-docker/img_3.png" />
<figcaption class="caption">
    <p>The <code class="language-plaintext highlighter-rouge">dive</code> output for the Django 13371 image, focused on the final (topmost) layer.</p>
  </figcaption>
</figure>

<p>This represents an opportunity for optimization. We can move the <code class="language-plaintext highlighter-rouge">git clone</code> operation to the <code class="language-plaintext highlighter-rouge">env</code> image, so that it is shared across many Django instances. <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> will only need to <code class="language-plaintext highlighter-rouge">git reset --hard</code> to the correct commit. This optimization is especially strong because the git history itself, stored in <code class="language-plaintext highlighter-rouge">.git</code>, represents 291MB of the 330MB layer size.</p>

<p>The new final layer is 40MB:</p>

<figure>
<img src="../assets/images/swebench-docker/img_2.png" />
<figcaption class="caption">
    <p>The optimized final layer reduced from 330MB to 40MB after moving the git clone operation to the env stage.</p>
  </figcaption>
</figure>

<p>The diff between the two codebases, which represents the size of this layer, could no doubt be optimized much further. In this example the diff is the same size as the whole codebase (excluding the git history), because we are using a very naive approach: just cloning the latest version at the <code class="language-plaintext highlighter-rouge">env</code> stage. Instead, we could check out the appropriate revision that should be closer to the revision at the instance stage. However, for this project I kept the changes as simple as possible, in order to more easily be confident that the optimized instance images are still identical to the original ones.</p>

<h4 id="should-the-git-history-be-included">Should the git history be included?</h4>
<p>For this project I focused on pure size optimisations, because the images in the public registry should be identical to those that would be generated by the original build scripts from the SWE-bench authors. However, as a side note, it’s worth asking whether the git history should be included at all. It makes sense for the model to have access to the past git history, like a human developer would. However, the model should not have access to <em>future</em> history from after the PR was merged. A sophisticated cheating model could in theory reward hack the evaluation if there is any way to access future history. I believe that is possible in some circumstances even after a <code class="language-plaintext highlighter-rouge">git reset --hard</code> and <code class="language-plaintext highlighter-rouge">git remote remove origin</code>. For example, if version tags are used, the model could <code class="language-plaintext highlighter-rouge">git checkout &lt;tag&gt;</code> a future tag. Or it could access the dangling commits in some way, perhaps with <code class="language-plaintext highlighter-rouge">git fsck --lost-found</code>. I believe this is unlikely to be a problem currently, but could become one with future models.</p>

<h3 id="the-matplotlib-19-gb-top-layer">The matplotlib 1.9 GB top layer</h3>
<p>The next thing I noticed is that many matplotlib images were among the largest, often weighing in at 9GB. If we look at instance <code class="language-plaintext highlighter-rouge">matplotlib__matplotlib-23913</code>, we can see that <code class="language-plaintext highlighter-rouge">setup_repo.sh</code> is as follows:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># setup_repo.sh for matplotlib__matplotlib-23913</span>
<span class="nb">set</span> <span class="nt">-euxo</span> pipefail
git clone <span class="nt">-o</span> origin https://github.com/matplotlib/matplotlib /testbed
<span class="nb">chmod</span> <span class="nt">-R</span> 777 /testbed
<span class="nb">cd</span> /testbed
git reset <span class="nt">--hard</span> 5c4595267ccd3daf78f5fd05693b7ecbcd575c1e
git remote remove origin
<span class="nb">source</span> /opt/miniconda3/bin/activate
conda activate testbed
<span class="nb">echo</span> <span class="s2">"Current environment: </span><span class="nv">$CONDA_DEFAULT_ENV</span><span class="s2">"</span>
apt-get <span class="nt">-y</span> update <span class="o">&amp;&amp;</span> apt-get <span class="nt">-y</span> upgrade <span class="o">&amp;&amp;</span> <span class="nv">DEBIAN_FRONTEND</span><span class="o">=</span>noninteractive apt-get <span class="nb">install</span> <span class="nt">-y</span> imagemagick ffmpeg texlive texlive-latex-extra texlive-fonts-recommended texlive-xetex texlive-luatex cm-super dvipng
python <span class="nt">-m</span> pip <span class="nb">install</span> <span class="nt">-e</span> <span class="nb">.</span>
</code></pre></div></div>

<p>The penultimate line installs a large number of heavy apt dependencies. This contributes to making the last layer 1,900 MB in size!</p>

<p>Should these commands be at the instance stage? They are taken from the <code class="language-plaintext highlighter-rouge">pre_install</code> key in a config dictionary that looks like this:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># swebench/harness/constants.py
</span>
<span class="c1"># ... 
</span><span class="n">SPECS_MATPLOTLIB</span><span class="p">.</span><span class="n">update</span><span class="p">(</span>
    <span class="p">{</span>
        <span class="n">k</span><span class="p">:</span> <span class="p">{</span>
            <span class="s">"python"</span><span class="p">:</span> <span class="s">"3.8"</span><span class="p">,</span>
            <span class="s">"packages"</span><span class="p">:</span> <span class="s">"requirements.txt"</span><span class="p">,</span>
            <span class="s">"install"</span><span class="p">:</span> <span class="s">"python -m pip install -e ."</span><span class="p">,</span>
            <span class="s">"pre_install"</span><span class="p">:</span> <span class="p">[</span>
                <span class="s">"apt-get -y update &amp;&amp; apt-get -y upgrade &amp;&amp; DEBIAN_FRONTEND=noninteractive apt-get install -y imagemagick ffmpeg libfreetype6-dev pkg-config texlive texlive-latex-extra texlive-fonts-recommended texlive-xetex texlive-luatex cm-super"</span>
            <span class="p">],</span>
            <span class="s">"pip_packages"</span><span class="p">:</span> <span class="p">[</span><span class="s">"pytest"</span><span class="p">,</span> <span class="s">"ipython"</span><span class="p">],</span>
            <span class="s">"test_cmd"</span><span class="p">:</span> <span class="n">TEST_PYTEST</span><span class="p">,</span>
        <span class="p">}</span>
        <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"3.1"</span><span class="p">,</span> <span class="s">"3.2"</span><span class="p">,</span> <span class="s">"3.3"</span><span class="p">,</span> <span class="s">"3.4"</span><span class="p">]</span>
    <span class="p">}</span>
<span class="p">)</span>

<span class="n">SPECS_MATPLOTLIB</span><span class="p">.</span><span class="n">update</span><span class="p">(</span>
    <span class="p">{</span>
        <span class="n">k</span><span class="p">:</span> <span class="p">{</span>
            <span class="s">"python"</span><span class="p">:</span> <span class="s">"3.5"</span><span class="p">,</span>
            <span class="s">"install"</span><span class="p">:</span> <span class="s">"python setup.py build; python setup.py install"</span><span class="p">,</span>
            <span class="s">"pre_install"</span><span class="p">:</span> <span class="p">[</span>
                <span class="s">"apt-get -y update &amp;&amp; apt-get -y upgrade &amp;&amp; apt-get install -y imagemagick ffmpeg"</span>
            <span class="p">],</span>
            <span class="s">"pip_packages"</span><span class="p">:</span> <span class="p">[</span><span class="s">"pytest"</span><span class="p">],</span>
            <span class="s">"execute_test_as_nonroot"</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
            <span class="s">"test_cmd"</span><span class="p">:</span> <span class="n">TEST_PYTEST</span><span class="p">,</span>
        <span class="p">}</span>
        <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"2.0"</span><span class="p">,</span> <span class="s">"2.1"</span><span class="p">,</span> <span class="s">"2.2"</span><span class="p">,</span> <span class="s">"1.0"</span><span class="p">,</span> <span class="s">"1.1"</span><span class="p">,</span> <span class="s">"1.2"</span><span class="p">,</span> <span class="s">"1.3"</span><span class="p">,</span> <span class="s">"1.4"</span><span class="p">,</span> <span class="s">"1.5"</span><span class="p">]</span>
    <span class="p">}</span>
<span class="p">)</span>
</code></pre></div></div>

<p>The <code class="language-plaintext highlighter-rouge">pre_install</code> command only depends on the version <code class="language-plaintext highlighter-rouge">k</code> of matplotlib, not on the specific instance. Therefore, it makes sense to move this command to a deeper layer, i.e. to the <code class="language-plaintext highlighter-rouge">env</code> image. Doing so reduces the size of the topmost layer from 1,900 MB to 110MB, a 17x reduction.</p>

<h3 id="disabling-the-pip-cache-or-how-to-go-insane">Disabling the pip cache (or how to go insane)</h3>
<p>A much simpler optimisation is to disable the pip cache. It’s standard practice in Dockerfiles to pass <code class="language-plaintext highlighter-rouge">--no-cache-dir</code> to pip, so that the pip cache is not stored in the image. I only bring this one up because it led me to an interesting rabbit hole.</p>

<p>There are <code class="language-plaintext highlighter-rouge">pip</code> commands in a number of places in the setup scripts. To keep diffs simple, I thought: better to use the  <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR</code> environment variable, rather than adding the <code class="language-plaintext highlighter-rouge">--no-cache-dir</code> flag to every pip command. This very reasonable idea was about to lose me a day of my life.</p>

<p>I set <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=1</code> and tested it on a few images, and it worked as expected. However, when I wanted to rebuild all the images, I discovered that <em>some</em> would no longer build, with a mysterious traceback looking something like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Traceback (most recent call last):
  File "/local/lib/python3.5/site-packages/pip/_internal/basecommand.py", line 78, in _build_session
    if options.cache_dir else None
  File "/lib/python3.5/posixpath.py", line 89, in join
    genericpath._check_arg_types('join', a, *p)
  File "/lib/python3.5/genericpath.py", line 143, in _check_arg_types
    (funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'int'
</code></pre></div></div>

<p>I was baffled that the behaviour of <code class="language-plaintext highlighter-rouge">pip</code> could change between instances, because <code class="language-plaintext highlighter-rouge">pip</code> is one of the first things installed in the <code class="language-plaintext highlighter-rouge">base</code> image that all others inherit from:</p>

<div class="language-Dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">RUN </span>apt update <span class="o">&amp;&amp;</span> apt <span class="nb">install</span> <span class="nt">-y</span> <span class="se">\
</span>...
python3 \
python3-pip 
</code></pre></div></div>

<p>The traceback did lead me to <a href="https://github.com/pypa/pip/issues/5385">this ancient GitHub issue</a> from 2018. The issue was fixed in <a href="https://github.com/pypa/pip/pull/5884">this PR</a>, which was merged into <code class="language-plaintext highlighter-rouge">pip</code> 19 and later.</p>

<p>However, my base image used a much more recent version of <code class="language-plaintext highlighter-rouge">pip</code>.</p>

<p>After much despair and gnashing of teeth, I eventually discovered that the images use Anaconda at the <code class="language-plaintext highlighter-rouge">env</code> stage like this:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># swebench/harness/test_spec.py
</span><span class="n">cmd</span> <span class="o">=</span> <span class="sa">f</span><span class="s">"conda create -n </span><span class="si">{</span><span class="n">env_name</span><span class="si">}</span><span class="s"> python=</span><span class="si">{</span><span class="n">specs</span><span class="p">[</span><span class="s">'python'</span><span class="p">]</span><span class="si">}</span><span class="s"> -y"</span>
</code></pre></div></div>

<p>Anaconda installs different versions of <code class="language-plaintext highlighter-rouge">pip</code> depending on the Python version. The oldest issues in the SWE-bench dataset are very old. They use ancient versions of Python, and hence of <code class="language-plaintext highlighter-rouge">pip</code>. For example, Django 5470 is from 2015, and the corresponding image uses Python 3.5 and <code class="language-plaintext highlighter-rouge">pip</code> 10.</p>

<p>So, if <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=1</code> crashes pip on pip &lt; 19, how were we supposed to disable the cache? As I found out by GitHub comments from 2016, by setting <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=0</code>!</p>

<figure>
<img src="../assets/images/swebench-docker/img_4.png" />
<figcaption class="caption">
    <p>GitHub <a href="https://github.com/pypa/pip/issues/2897#issuecomment-267380843">comment</a> from 2016 expressing surprise that one needs to set <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=0</code> to disable the pip cache.</p>
  </figcaption>
</figure>

<p>The aforementioned PR (merged into <code class="language-plaintext highlighter-rouge">pip</code> 19) fixes the crash, and causes <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=1</code> to disable the cache as expected. However, backward compatibility was preserved with the “well-known” behaviour that <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=0</code> disables the cache.</p>

<figure>
<img src="../assets/images/swebench-docker/img_5.png" />
<figcaption class="caption">
    <p>GitHub <a href="https://github.com/pypa/pip/issues/5385#issuecomment-415734783">comment</a> from 2018 discussing backward compatibility.</p>
  </figcaption>
</figure>

<p>In summary, I was able to disable the cache for all instances by setting <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=0</code>. Of course, all modern documentation on pip instructs you to set <code class="language-plaintext highlighter-rouge">PIP_NO_CACHE_DIR=1</code> to disable the cache, and doesn’t mention this behaviour. So I had set up a <em>devilishly</em> confusing Dockerfile. I wrote a long code comment explaining the issue, and vowed to never do this again.</p>

<h2 id="impact-size">Impact on size</h2>
<p>The 2294 SWE-bench docker images are sometimes reported to be around 2,000 GB in size. For example, the Princeton/OpenAI team wrote that</p>

<blockquote>
  <p>By default, the harness <code class="language-plaintext highlighter-rouge">cache_level</code> is set to <code class="language-plaintext highlighter-rouge">env</code>, which means that the harness will store the base and environment images, but not the instance images.</p>

  <p>In this setting, the base and environment images will be reused across runs, but take up about 100GB of disk space. At the time of release, we require about 120GB of free disk space to run the harness with any <code class="language-plaintext highlighter-rouge">cache_level</code>. [Note by TA: they mean any <code class="language-plaintext highlighter-rouge">cache_level</code> other than <code class="language-plaintext highlighter-rouge">instance</code>]</p>

  <p>For users who want the fastest possible evaluation times, we recommend setting <code class="language-plaintext highlighter-rouge">cache_level</code> to <code class="language-plaintext highlighter-rouge">instance</code>. In this setting, the harness will store images for all instances […] However, all base, environment, and instance images will be stored, taking up about 2,000GB of disk space.</p>
</blockquote>

<p>The 120GB number (for a cache level other than <code class="language-plaintext highlighter-rouge">instance</code>) has been widely reported by evals professionals, for example:</p>

<figure>
<img src="../assets/images/swebench-docker/image-20250619172345623.png" style="max-width: 500px" />
<figcaption class="caption">
    <p>Screenshot showing reported disk space requirements for SWE-bench evaluations.</p>
  </figcaption>
</figure>

<p>Similarly, the All Hands team <a href="https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed">wrote</a> that</p>
<blockquote>
  <p>because each agent runs in its own environment, it is necessary to create many environments, which requires hundreds of gigabytes of space</p>
</blockquote>

<p>I’m not sure where the 2,000 GB number comes from. When summing the individual sizes of all (original) SWE-bench images, I get 3129 GiB. However, this ignores that many of these images share the same layers! When Docker builds or pulls these images, shared layers are only stored once.</p>

<p>When correctly calculated by summing only the sizes of the <em>unique</em> layers, the size of the unoptimized SWE-bench images comes to 684 GiB, which is nowhere near 2,000 GB. For SWE-bench Verified, the true size of the original images is 189 GiB. (You can reproduce my calculation using the script <code class="language-plaintext highlighter-rouge">get_registry_size.py</code>, and my data is also shared in the <a href="https://github.com/epoch-research/SWE-bench/">repository</a>.)</p>

<p>After all my optimisations, the total size of the SWE-bench images is 67 GiB (10x reduction) while the SWE-bench Verified set fits in 30 GiB (6x reduction).</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th>SWE-bench (2290)</th>
      <th>SWE-bench Verified (500)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Optimised (ours)</td>
      <td><strong>67 GiB</strong></td>
      <td><strong>30 GiB</strong></td>
    </tr>
    <tr>
      <td>Original</td>
      <td><strong>684 GiB</strong></td>
      <td><strong>189 GiB</strong></td>
    </tr>
    <tr>
      <td>Original, reported by SWE-bench authors</td>
      <td>1,800 GiB (2,000 GB)</td>
      <td>N/A</td>
    </tr>
  </tbody>
</table>

<h2 id="running-swe-bench-verified-in-about-an-hour">Running SWE-bench Verified in about an hour</h2>

<p>Using our image registry, we’re able to run SWE-bench Verified in 62 to 73 minutes for many major models. Specifically, we ran the benchmark on a single GitHub actions runner with 32 cores and 128GB of RAM. We gave models a limit of 300,000 tokens per sample for the whole conversation (i.e. summing input and output tokens for every request in the conversation)<sup id="fnref:fntokens" role="doc-noteref"><a href="#fn:fntokens" class="footnote" rel="footnote">4</a></sup>. Here were the runtimes for three major models:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">gemini-2.0-flash-001</code>: 62 minutes</li>
  <li><code class="language-plaintext highlighter-rouge">gpt-4o-2024-11-20</code>: 70 minutes</li>
  <li><code class="language-plaintext highlighter-rouge">claude-3-7-sonnet-20250219</code>: 63 minutes</li>
</ul>

<p>As we have discussed above, OpenHands <a href="https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed">reported</a> evaluation times of 10 minutes per sample on one machine, which they were able to reduce to about 20 seconds per sample by using 32 machines in parallel.</p>

<p>Using our optimized image registry, we achieve speeds of about 8 seconds per sample on a single large machine. This is 77x faster than OpenHands, and still 2.4 times faster than what OpenHands achieved with 32 machines. The comparison isn’t strictly a fair one; while OpenHands didn’t share details of their hardware, they were likely using less powerful machines.</p>

<p>Note that we have high API rate limits on these models, which are necessary to replicate these runtimes. Each eval used 100-150M tokens (of which the majority cached tokens), so we are using roughly 2M tokens per minute during the evaluation.</p>

<h2 id="how-to-use-our-image-registry">How to use our image registry</h2>

<p>Our <a href="https://github.com/orgs/epoch-research/packages?repo_name=SWE-bench">image registry</a> is public, MIT-licensed, and hosted on <a href="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry">GitHub Container Registry</a>. Each image can be accessed by its name, and we follow the same naming pattern as the original SWE-bench authors. At the moment, all images only have the tag <code class="language-plaintext highlighter-rouge">latest</code>.</p>

<p>The naming format is <code class="language-plaintext highlighter-rouge">ghcr.io/epoch-research/swe-bench.eval.&lt;arch&gt;.&lt;instance_id&gt;</code>, for example <code class="language-plaintext highlighter-rouge">ghcr.io/epoch-research/swe-bench.eval.x86_64.astropy__astropy-13236</code>.</p>

<p>For <code class="language-plaintext highlighter-rouge">x86_64</code>, we’re able to build 2290/2294 (99.8%) of the images, and all 500/500 out of the SWE-bench Verified set.</p>

<p>For <code class="language-plaintext highlighter-rouge">arm64</code>, 1819 (out of 2294) images are provided on a best-effort basis, and have not been tested.</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:metaphor" role="doc-endnote">
      <p>Note the potentially confusing metaphor: an image is built by adding layers from bottom to top, so <em>higher</em> layers come <em>later</em> in the Dockerfile, while <em>lower</em> (deeper) layers come <em>earlier</em> in the Dockerfile. <a href="#fnref:metaphor" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:cherry" role="doc-endnote">
      <p>This example isn’t cherry-picked, I chose it at random towards the middle of the Django dataset, when sorted by issue number. (The issue numbers range from around 5000 to around 17,000, and the vast majority are in the 10,000 to 17,000 range.) <a href="#fnref:cherry" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:not-multi-stage" role="doc-endnote">

      <p>As the <a href="https://docs.docker.com/build/building/multi-stage/">docs</a> explain, the purpose of a multi-stage build is to <em>selectively copy artifacts from one stage to another</em>:</p>

      <blockquote>
        <p>With multi-stage builds, you use multiple <code class="language-plaintext highlighter-rouge">FROM</code> statements in your Dockerfile. Each <code class="language-plaintext highlighter-rouge">FROM</code> instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image.</p>
      </blockquote>

      <p>In a multi-stage build, we selectively copy artifacts to make the final stage smaller and more cacheable. In SWE-bench, the stages just build on top of one another without any selective copying. From the point of view of caching and of the final images being produced, it is just as if we put all the instructions in one Dockerfile. The purpose of the three stages from the SWE-bench authors is likely to make the large number of generated Dockerfiles more manageable, and to be able to selectively prune just the <code class="language-plaintext highlighter-rouge">instance</code> stages while running the benchmark on a machine with limited disk space. <a href="#fnref:not-multi-stage" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:fntokens" role="doc-endnote">
      <p>The SWE-bench Verified evaluations on our <a href="https://epoch.ai/data/ai-benchmarking-dashboard">Benchmarking Hub</a> currently set this maximum to 1 million tokens. We also don’t run the eval directly on the images as they are in the registry, but add a few very lightweight layers containing the SWE-Agent tools that we use for our evaluations. For most models, the runtime in production is very similar to the numbers in this blog post; for some reasoning models that create a lot of output, with 1 million tokens we are bottlenecked by API rate limits. For more details on our evaluation setup, see the <a href="https://epoch.ai/data/ai-benchmarking-dashboard">Benchmarking Hub</a>. <a href="#fnref:fntokens" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><summary type="html"><![CDATA[Epoch AI is releasing a public registry of optimized Docker images for SWE-bench. This allows us to run SWE-bench Verified in 62 minutes on a single GitHub actions VM.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/swebench-docker/banner.png" /><media:content medium="image" url="https://bayes.net/assets/images/swebench-docker/banner.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How should we analyse survey forecasts of AI timelines?</title><link href="https://bayes.net/espai/" rel="alternate" type="text/html" title="How should we analyse survey forecasts of AI timelines?" /><published>2024-12-16T00:00:00+00:00</published><updated>2024-12-16T00:00:00+00:00</updated><id>https://bayes.net/espai</id><content type="html" xml:base="https://bayes.net/espai/"><![CDATA[<p style="font-size: smaller"><a href="https://aiimpacts.org/how-should-we-analyse-survey-forecasts-of-ai-timelines">Read at AI Impacts</a></p>

<p>The Expert Survey on Progress in AI (ESPAI) is a large survey of AI researchers about the future of AI, conducted in <a href="https://arxiv.org/abs/1705.08807">2016</a>, <a href="https://wiki.aiimpacts.org/doku.php?id=ai_timelines:predictions_of_human-level_ai_timelines:ai_timeline_surveys:2022_expert_survey_on_progress_in_ai">2022</a>, and <a href="https://arxiv.org/abs/2401.02843">2023</a>. One main focus of the survey is the timing of progress in AI<sup id="fnref:scope" role="doc-noteref"><a href="#fn:scope" class="footnote" rel="footnote">1</a></sup>.</p>

<p>The timing-related results of the survey are usually presented as a cumulative distribution function (CDF) showing probabilities as a function of years, in the aggregated opinion of respondents. Respondents gave triples of (year, probability) pairs for various AI milestones. Starting from these responses, two key steps of processing are required to obtain such a CDF:</p>

<ul>
  <li>Fitting a continuous probability distribution to each response</li>
  <li>Aggregating these distributions</li>
</ul>

<p>These two steps require a number of judgement calls.
In addition, summarising and presenting the results involves many other implicit choices.</p>

<p>In this report, I investigate these choices and their impact on the results of the survey (for the 2023 iteration). I provide recommendations for how the survey results should be analysed and presented in the future.</p>

<h1 id="headline-results">Headline results</h1>

<p>This plot represents a summary of my best guesses as to how the ESPAI data should be analysed and presented.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result-400-ca75d63f2.webp 400w, /generated/_posts/../assets/images/espai/headline_result-600-ca75d63f2.webp 600w, /generated/_posts/../assets/images/espai/headline_result-800-ca75d63f2.webp 800w, /generated/_posts/../assets/images/espai/headline_result-1000-ca75d63f2.webp 1000w, /generated/_posts/../assets/images/espai/headline_result-1500-ca75d63f2.webp 1500w, /generated/_posts/../assets/images/espai/headline_result-2000-ca75d63f2.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result-400-ca75d63f2.jpeg 400w, /generated/_posts/../assets/images/espai/headline_result-600-ca75d63f2.jpeg 600w, /generated/_posts/../assets/images/espai/headline_result-800-ca75d63f2.jpeg 800w, /generated/_posts/../assets/images/espai/headline_result-1000-ca75d63f2.jpeg 1000w, /generated/_posts/../assets/images/espai/headline_result-1500-ca75d63f2.jpeg 1500w, /generated/_posts/../assets/images/espai/headline_result-2000-ca75d63f2.jpeg 2000w" type="image/jpeg" /><img alt="CDF of ESPAI survey showing median and central 50% of expert responses." src="/generated/_posts/../assets/images/espai/headline_result-800-ca75d63f2.png" width="2400" height="1800" /></picture>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold">
</div>
  <div class="accordion" id="compare-headline-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#compare-headline-accordioncontent0" aria-expanded="false" aria-controls="compare-headline-accordioncontent0">
        
<div>See previous</div>


      </button>
    </h2>
    <div id="compare-headline-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/grace_2024_figure_3-400-639725bef.webp 400w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-600-639725bef.webp 600w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-800-639725bef.webp 800w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-1000-639725bef.webp 1000w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-1493-639725bef.webp 1493w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/grace_2024_figure_3-400-639725bef.jpeg 400w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-600-639725bef.jpeg 600w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-800-639725bef.jpeg 800w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-1000-639725bef.jpeg 1000w, /generated/_posts/../assets/images/espai/grace_2024_figure_3-1493-639725bef.jpeg 1493w" type="image/jpeg" /><img alt="Previous headline results" src="/generated/_posts/../assets/images/espai/grace_2024_figure_3-800-639725bef.png" width="1493" height="1941" /></picture>

<p><a href="https://arxiv.org/abs/2401.02843">Thousands of AI Authors on the Future of AI</a>, Figure 3. I added annotations to the 20%, 50%, and 80% points, for comparison with my plot.</p>


      </div>
    </div>
  </div>
  
</div>
  </div>

<p>I differ from previous authors in four main ways:</p>

<ul>
  <li><strong>Show distribution of responses</strong>. Previous summary plots showed a random subset of responses, rather than quantifying the range of opinion among experts. I show a shaded area representing the central 50% of individual-level CDFs (25th to 75th percentile). <a href="#range-of-responses">More</a></li>
  <li><strong>Aggregate task and occupation questions</strong>. Previous analyses only showed task (HLMI) and occupation (FAOL) results separately, whereas I provide a single estimate combining both. By not providing a single headline result, previous approaches made summarization more difficult, and left room for selective interpretations. I find evidence that task automation (HLMI) numbers have been far more widely reported than occupation automation (FAOL). <a href="#aggregating-hlmi-faol">More</a></li>
  <li><strong>Median aggregation</strong>. I’m quite uncertain as to which method is most appropriate in this context for aggregating the individual distributions into a single distribution. The arithmetic mean of probabilities, used by previous authors, is a reasonable option. I choose the median merely because it has the convenient property that we get the same result whether we take the median in the vertical direction (probabilities) or the horizontal (years). <a href="#aggregation">More</a></li>
  <li><strong>Flexible distributions</strong>: I fit individual-level CDF data to “flexible” interpolation-based distributions that can match the input data exactly. The original authors use the Gamma distribution. This change (and distribution fitting in general) makes only a small difference to the aggregate results. <a href="#distribution-fitting">More</a></li>
</ul>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold">
</div>
  <div class="accordion" id="combined-effect-headline-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#combined-effect-headline-accordioncontent0" aria-expanded="false" aria-controls="combined-effect-headline-accordioncontent0">
        
<div>Compare mine (3/4 suggestions) with previous</div>


      </button>
    </h2>
    <div id="combined-effect-headline-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/combined_effect_headline-400-b410acc3d.webp 400w, /generated/_posts/../assets/images/espai/combined_effect_headline-600-b410acc3d.webp 600w, /generated/_posts/../assets/images/espai/combined_effect_headline-800-b410acc3d.webp 800w, /generated/_posts/../assets/images/espai/combined_effect_headline-1000-b410acc3d.webp 1000w, /generated/_posts/../assets/images/espai/combined_effect_headline-1500-b410acc3d.webp 1500w, /generated/_posts/../assets/images/espai/combined_effect_headline-1920-b410acc3d.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/combined_effect_headline-400-b410acc3d.jpeg 400w, /generated/_posts/../assets/images/espai/combined_effect_headline-600-b410acc3d.jpeg 600w, /generated/_posts/../assets/images/espai/combined_effect_headline-800-b410acc3d.jpeg 800w, /generated/_posts/../assets/images/espai/combined_effect_headline-1000-b410acc3d.jpeg 1000w, /generated/_posts/../assets/images/espai/combined_effect_headline-1500-b410acc3d.jpeg 1500w, /generated/_posts/../assets/images/espai/combined_effect_headline-1920-b410acc3d.jpeg 1920w" type="image/jpeg" /><img alt="Direct comparison of 3/4 elements of our approach with previous results" src="/generated/_posts/../assets/images/espai/combined_effect_headline-800-b410acc3d.png" width="1920" height="1440" /></picture>

<p>Combined effect of our approach (3/4 elements), compared with previous results. For legibility, this does not show the range of responses, although I consider this one of the most important innovations over previous analyses.</p>

<table>
  <thead>
    <tr>
      <th>CDF</th>
      <th>Framing of automation</th>
      <th>Distribution family</th>
      <th>Loss function</th>
      <th>Aggregation</th>
      <th>p20</th>
      <th>p50</th>
      <th>p80</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span style="color: blue">Blue (ours)</span></td>
      <td>Aggregate of tasks (HLMI) and occupations (FAOL)</td>
      <td>Flexible</td>
      <td>Not applicable</td>
      <td>Median</td>
      <td>2048</td>
      <td>2073</td>
      <td>2103</td>
    </tr>
    <tr>
      <td><span style="color: orange">Orange (previous)</span></td>
      <td>Tasks (HLMI)</td>
      <td>Gamma</td>
      <td>MSE of probabilities</td>
      <td>Arithmetic mean of probabilities</td>
      <td>2031</td>
      <td>2047</td>
      <td>2110</td>
    </tr>
    <tr>
      <td><span style="color: green">Green (previous)</span></td>
      <td>Occupations (FAOL)</td>
      <td>Gamma</td>
      <td>MSE of probabilities</td>
      <td>Arithmetic mean of probabilities</td>
      <td>2051</td>
      <td>2110</td>
      <td>2843</td>
    </tr>
  </tbody>
</table>

<p>Note: Although previous authors give equal prominence to the orange (tasks, HLMI) and green (occupations, FAOL) results, I find evidence that the orange (tasks, HLMI) curve has been far more widely reported (<a href="#aggregating-hlmi-faol">More</a>).</p>


      </div>
    </div>
  </div>
  
</div>
  </div>

<p>The last two points (aggregation and distribution fitting) directly affect the numerical results. The first two are about how the headline result of the survey should be conceived of and communicated.</p>

<p>These four choices vary in both their <em>impact</em>, and in my <em>confidence</em> that they represent an improvement over previous analyses. The two tables below summarise my views on the topic.</p>

<table>
  <thead>
    <tr>
      <th>Choice</th>
      <th>Impact on understanding and communication of main results</th>
      <th>Confidence it’s an improvement</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Show range of responses (<a href="#range-of-responses">More</a>)</td>
      <td>High</td>
      <td>Very high</td>
    </tr>
    <tr>
      <td>Aggregate FAOL and HLMI (<a href="#aggregating-hlmi-faol">More</a>)</td>
      <td>High</td>
      <td>Moderate</td>
    </tr>
  </tbody>
</table>

<table>
  <thead>
    <tr>
      <th>Choice</th>
      <th>Numerical impact on aggregate CDF</th>
      <th>Confidence it’s an improvement</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Median aggregation (<a href="#aggregation">More</a>)</td>
      <td>High</td>
      <td>Very low</td>
    </tr>
    <tr>
      <td>Flexible distributions (<a href="#distribution-fitting">More</a>)</td>
      <td>Minimal</td>
      <td>High</td>
    </tr>
  </tbody>
</table>

<p>Even if you disagree with these choices, you can still benefit from my work! The <a href="#codebase">code</a> used to implement these new variations is open source. It provides user-friendly configuration objects that make it easy to run your own analysis and produce your own plots. The source data is included in version control. AI Impacts plans to use this code when analysing future iterations of ESPAI. I also welcome engagement from the wider research community.</p>

<h2 id="suggested-textual-description">Suggested textual description</h2>

<p>If you need a textual description of the results in the plot, I would recommend:</p>

<blockquote>
  <p>Experts were asked when it will be feasible to automate all tasks or occupations. The median expert thinks this is 20% likely by 2048, and 80% likely by 2103. There was substantial disagreement among experts. For automation by 2048, the middle half of experts assigned it a probability between 1% and a 60% (meaning ¼ assigned it a chance lower than 1%, and ¼ gave a chance higher than 60%). For automation by 2103, the central half of experts forecasts ranged from a 25% chance to a 100% chance.<sup id="fnref:language" role="doc-noteref"><a href="#fn:language" class="footnote" rel="footnote">2</a></sup></p>
</blockquote>

<p>This description still contains big simplifications (e.g. using “the median expert thinks” even though no expert directly answered questions about 2048 or 2103). However, it communicates both:</p>

<ul>
  <li>The uncertainty represented by the aggregated CDF (using the 60% belief interval from 20% to 80%)</li>
  <li>The range of disagreement among experts (using the central 50% of responses)</li>
</ul>

<p>In some cases, this may be too much information. I recommend if at all possible that the results should not be reduced to the single number of the year by which experts expect a 50% chance of advanced AI. Instead, emphasise that we have a probability distribution over years by giving two points on the distribution. So if a very concise summary is required, you could use:</p>

<blockquote>
  <p>Surveyed experts think it’s unlikely (20%) it will become feasible to automate all tasks or occupations by 2048, but it probably will (80%) by 2103.</p>
</blockquote>

<p>If even greater simplicity is required, I would urge something like the following, over just using the median year:</p>

<blockquote>
  <p>AI experts think full automation is most likely to become feasible between 2048 and 2103.</p>
</blockquote>

<h1 class="no_toc" id="contents">Contents</h1>
<ol id="markdown-toc">
  <li><a href="#headline-results" id="markdown-toc-headline-results">Headline results</a>    <ol>
      <li><a href="#suggested-textual-description" id="markdown-toc-suggested-textual-description">Suggested textual description</a></li>
    </ol>
  </li>
  <li><a href="#the-distribution-of-raw-responses" id="markdown-toc-the-distribution-of-raw-responses">The distribution of raw responses</a>    <ol>
      <li><a href="#example-retail-salesperson-occupation" id="markdown-toc-example-retail-salesperson-occupation">Example: Retail Salesperson occupation</a></li>
      <li><a href="#timing-of-human-level-performance" id="markdown-toc-timing-of-human-level-performance">Timing of human-level performance</a></li>
    </ol>
  </li>
  <li><a href="#aggregation" id="markdown-toc-aggregation">Aggregation</a>    <ol>
      <li><a href="#possible-methods" id="markdown-toc-possible-methods">Possible methods</a></li>
      <li><a href="#mean-vs-median-aggregation" id="markdown-toc-mean-vs-median-aggregation">Mean vs Median aggregation</a></li>
      <li><a href="#why-the-mean-and-median-differ" id="markdown-toc-why-the-mean-and-median-differ">Why the mean and median differ</a></li>
      <li><a href="#aside-the-winsorized-geometric-mean-of-odds" id="markdown-toc-aside-the-winsorized-geometric-mean-of-odds">Aside: the winsorized geometric mean of odds</a></li>
    </ol>
  </li>
  <li><a href="#distribution-fitting" id="markdown-toc-distribution-fitting">Distribution fitting</a>    <ol>
      <li><a href="#why-fit-a-distribution" id="markdown-toc-why-fit-a-distribution">Why fit a distribution?</a></li>
      <li><a href="#limitations-of-previous-analyses" id="markdown-toc-limitations-of-previous-analyses">Limitations of previous analyses</a>        <ol>
          <li><a href="#constraints-of-gamma-distribution" id="markdown-toc-constraints-of-gamma-distribution">Constraints of Gamma distribution</a></li>
          <li><a href="#inappropriate-loss-function" id="markdown-toc-inappropriate-loss-function">Inappropriate loss function</a></li>
        </ol>
      </li>
      <li><a href="#flexible-distributions" id="markdown-toc-flexible-distributions">Flexible distributions</a></li>
      <li><a href="#other-distributions" id="markdown-toc-other-distributions">Other distributions</a></li>
    </ol>
  </li>
  <li><a href="#range-of-responses" id="markdown-toc-range-of-responses">Displaying the distribution of responses</a></li>
  <li><a href="#aggregating-hlmi-faol" id="markdown-toc-aggregating-hlmi-faol">Aggregating across the task and occupation framings</a></li>
  <li><a href="#codebase" id="markdown-toc-codebase">Codebase</a></li>
</ol>

<h1 id="the-distribution-of-raw-responses">The distribution of raw responses</h1>

<p>Even readers who are familiar with ESPAI may only have seen the results after processing. It can be helpful to look at the raw data, i.e. respondent’s answers to questions before any processing, to remind ourselves how the survey was conducted.</p>

<p>All questions about how soon a milestone would be reached were framed in two ways: fixed-years and fixed-probabilities. Half of respondents were asked to estimate the probability that a milestone would be reached by a given year (“fixed-years framing”), while the other half were asked to estimate the year by which the milestone would be feasible with a given probability (“fixed-probabilities framing”).</p>

<h2 id="example-retail-salesperson-occupation">Example: Retail Salesperson occupation</h2>
<p>Responses about one such milestone (say, the occupation of retail salesperson in the example below), if shown as a scatterplot, form three horizontal lines for fixed probabilities, and three vertical lines for fixed years. These correspond to the six questions being asked about the milestone:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-400-3419bf229.webp 400w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-600-3419bf229.webp 600w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-800-3419bf229.webp 800w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1000-3419bf229.webp 1000w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1500-3419bf229.webp 1500w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1920-3419bf229.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-400-3419bf229.jpeg 400w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-600-3419bf229.jpeg 600w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-800-3419bf229.jpeg 800w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1000-3419bf229.jpeg 1000w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1500-3419bf229.jpeg 1500w, /generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-1920-3419bf229.jpeg 1920w" type="image/jpeg" /><img alt="Scatterplot of survey responses for automating retail salesperson occupation, showing fixed probabilities and fixed years." src="/generated/_posts/../assets/images/espai/raw_scatter_retail_salesperson-800-3419bf229.png" width="1920" height="1440" /></picture>

<p>The scatterplot is a helpful reminder of the data’s shape in its rawest form. However, all scatterplots will form three horizontal and three vertical lines. We can show more structured information about the distribution of responses for each of the six questions by using six box and whisker plots<sup id="fnref:whiskers" role="doc-noteref"><a href="#fn:whiskers" class="footnote" rel="footnote">3</a></sup>, as shown below:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-400-01fad8fce.webp 400w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-600-01fad8fce.webp 600w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-800-01fad8fce.webp 800w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1000-01fad8fce.webp 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1500-01fad8fce.webp 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1920-01fad8fce.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-400-01fad8fce.jpeg 400w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-600-01fad8fce.jpeg 600w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-800-01fad8fce.jpeg 800w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1000-01fad8fce.jpeg 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1500-01fad8fce.jpeg 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-1920-01fad8fce.jpeg 1920w" type="image/jpeg" /><img alt="Box plots showing probability and year distributions for automating retail salesperson occupation." src="/generated/_posts/../assets/images/espai/raw_boxplot_retail_salesperson-800-01fad8fce.png" width="1920" height="1440" /></picture>

<p>We can see several useful things in this set of box plots:</p>

<ul>
  <li><strong>There is a large framing effect, whereby the fixed-years framing produces later predictions</strong>. (This effect is familiar from previous analyses of ESPAI, where it has been shown to occur systematically).
    <ul>
      <li>For example, the prediction (2043, 50%) is the <em>85th percentile</em> of responses for the 50% question in the fixed-probabilities framing, while the same prediction is the <em>median</em> response for the 2043 question in the fixed-years framing.</li>
      <li>When asked about 2073 in the fixed-years framing, the median response was 90%, which is much later than even the 85th percentile response to the 90% question int the fixed-probabilities framing.</li>
    </ul>
  </li>
  <li><strong>Responses follow a skewed distribution</strong>
    <ul>
      <li>For all three questions in the fixed-probabilities framing, the responses have a large right skew</li>
      <li>In the fixed-years framing, the 2033 question produces a right skew (up skew in the boxplot), whereas the 2073 question produces a left-skew (down skew in the boxplot), with more than 25% of respondents giving a probability of 100%.</li>
    </ul>
  </li>
  <li><strong>There is a wide range of responses, indicating substantial disagreement among respondents</strong>. For example, when asked about 2043, the interval (centred on the median) that contains half of responses ranged from a 30% chance to a 90% chance. The interval that contains 70% of responses ranged from a 10% chance to a 98% chance.</li>
</ul>

<p>We can now look at the distribution of raw responses for the timing of human-level performance.</p>

<h2 id="timing-of-human-level-performance">Timing of human-level performance</h2>
<p>When the survey investigated the timing of human-level performance, the question was framed in two ways, as tasks, and as occupations<sup id="fnref:other_hlmi_faol_differences" role="doc-noteref"><a href="#fn:other_hlmi_faol_differences" class="footnote" rel="footnote">4</a></sup>:</p>

<ul>
  <li>“High-Level Machine Intelligence” (HLMI): when unaided machines can accomplish every <strong>task</strong> better and more cheaply than human workers.</li>
  <li>“Full Automation of Labor” (FAOL): when for any <strong>occupation</strong>, machines could be built to carry it out  better and more cheaply than human workers.</li>
</ul>

<p>We can now take each of these in turn (expand the collapsible sections below).</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold"><div>Raw data</div>
</div>
  <div class="accordion" id="raw-data-outer-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-outer-accordioncontent0" aria-expanded="false" aria-controls="raw-data-outer-accordioncontent0">
        
<div>Full Automation of Labor (FAOL)</div>


      </button>
    </h2>
    <div id="raw-data-outer-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold">
</div>
  <div class="accordion" id="raw-data-faol-inner-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-faol-inner-accordioncontent0" aria-expanded="false" aria-controls="raw-data-faol-inner-accordioncontent0">
        
<div>Box Plot</div>


      </button>
    </h2>
    <div id="raw-data-faol-inner-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_FAOL-400-931918384.webp 400w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-600-931918384.webp 600w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-800-931918384.webp 800w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1000-931918384.webp 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1500-931918384.webp 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1920-931918384.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_FAOL-400-931918384.jpeg 400w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-600-931918384.jpeg 600w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-800-931918384.jpeg 800w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1000-931918384.jpeg 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1500-931918384.jpeg 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_FAOL-1920-931918384.jpeg 1920w" type="image/jpeg" /><img alt="Box plots for FAOL in the fixed-years and fixed-probabilities framings." src="/generated/_posts/../assets/images/espai/raw_boxplot_FAOL-800-931918384.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-faol-inner-accordioncontent1" aria-expanded="false" aria-controls="raw-data-faol-inner-accordioncontent1">
        <div>Fixed Probabilities</div>


      </button>
    </h2>
    <div id="raw-data-faol-inner-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        
<p>In the fixed probabilities framing, respondents were asked for the number of years until a 10%, 50%, and 90% probability of FAOL.</p>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Probability of FAOL</th>
      <th style="text-align: right">Mean response</th>
      <th style="text-align: right">15th percentile response</th>
      <th style="text-align: right">Median response</th>
      <th style="text-align: right">85th percentile response</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">10%</td>
      <td style="text-align: right">508177</td>
      <td style="text-align: right">10</td>
      <td style="text-align: right">40</td>
      <td style="text-align: right">100</td>
    </tr>
    <tr>
      <td style="text-align: left">50%</td>
      <td style="text-align: right">783590</td>
      <td style="text-align: right">20</td>
      <td style="text-align: right">70</td>
      <td style="text-align: right">200</td>
    </tr>
    <tr>
      <td style="text-align: left">90%</td>
      <td style="text-align: right">1.01197e+06</td>
      <td style="text-align: right">35</td>
      <td style="text-align: right">100</td>
      <td style="text-align: right">500</td>
    </tr>
  </tbody>
</table>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-faol-inner-accordioncontent2" aria-expanded="false" aria-controls="raw-data-faol-inner-accordioncontent2">
        <div>Fixed Years</div>


      </button>
    </h2>
    <div id="raw-data-faol-inner-accordioncontent2" class="accordion-collapse collapse" aria-labelledby="heading2">
      <div class="accordion-body">
        
<p>In the fixed years framing, respondents were asked for the probability of FAOL within 10, 20, and 50 years.</p>

<table>
  <thead>
    <tr>
      <th style="text-align: right">Years until FAOL</th>
      <th style="text-align: left">Mean response</th>
      <th style="text-align: left">15th percentile response</th>
      <th style="text-align: left">Median response</th>
      <th style="text-align: left">85th percentile response</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: right">10</td>
      <td style="text-align: left">6.02%</td>
      <td style="text-align: left">0.00%</td>
      <td style="text-align: left">0.00%</td>
      <td style="text-align: left">10.00%</td>
    </tr>
    <tr>
      <td style="text-align: right">20</td>
      <td style="text-align: left">12.30%</td>
      <td style="text-align: left">0.00%</td>
      <td style="text-align: left">2.00%</td>
      <td style="text-align: left">30.00%</td>
    </tr>
    <tr>
      <td style="text-align: right">50</td>
      <td style="text-align: left">24.66%</td>
      <td style="text-align: left">0.00%</td>
      <td style="text-align: left">10.00%</td>
      <td style="text-align: left">60.00%</td>
    </tr>
  </tbody>
</table>


      </div>
    </div>
  </div>
  
</div>
  </div>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-outer-accordioncontent1" aria-expanded="false" aria-controls="raw-data-outer-accordioncontent1">
        <div>High Level Machine Intelligence (HLMI)</div>


      </button>
    </h2>
    <div id="raw-data-outer-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        
<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold">
</div>
  <div class="accordion" id="raw-data-hlmi-inner-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-hlmi-inner-accordioncontent0" aria-expanded="false" aria-controls="raw-data-hlmi-inner-accordioncontent0">
        
<div>Box Plot</div>


      </button>
    </h2>
    <div id="raw-data-hlmi-inner-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_HLMI-400-ff157ddef.webp 400w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-600-ff157ddef.webp 600w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-800-ff157ddef.webp 800w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1000-ff157ddef.webp 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1500-ff157ddef.webp 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1920-ff157ddef.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/raw_boxplot_HLMI-400-ff157ddef.jpeg 400w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-600-ff157ddef.jpeg 600w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-800-ff157ddef.jpeg 800w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1000-ff157ddef.jpeg 1000w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1500-ff157ddef.jpeg 1500w, /generated/_posts/../assets/images/espai/raw_boxplot_HLMI-1920-ff157ddef.jpeg 1920w" type="image/jpeg" /><img alt="Box plots for HLMI in the fixed-years and fixed-probabilities framings." src="/generated/_posts/../assets/images/espai/raw_boxplot_HLMI-800-ff157ddef.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-hlmi-inner-accordioncontent1" aria-expanded="false" aria-controls="raw-data-hlmi-inner-accordioncontent1">
        <div>Fixed Probabilities</div>


      </button>
    </h2>
    <div id="raw-data-hlmi-inner-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        
<p>In the fixed probabilities framing, respondents were asked for the number of years until a 10%, 50%, and 90% probability of HLMI.</p>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Probability of HLMI</th>
      <th style="text-align: right">Mean response</th>
      <th style="text-align: right">15th percentile response</th>
      <th style="text-align: right">Median response</th>
      <th style="text-align: right">85th percentile response</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">10%</td>
      <td style="text-align: right">41.19</td>
      <td style="text-align: right">2</td>
      <td style="text-align: right">5</td>
      <td style="text-align: right">20</td>
    </tr>
    <tr>
      <td style="text-align: left">50%</td>
      <td style="text-align: right">1307.74</td>
      <td style="text-align: right">7</td>
      <td style="text-align: right">20</td>
      <td style="text-align: right">50</td>
    </tr>
    <tr>
      <td style="text-align: left">90%</td>
      <td style="text-align: right">457537</td>
      <td style="text-align: right">15</td>
      <td style="text-align: right">50</td>
      <td style="text-align: right">100</td>
    </tr>
  </tbody>
</table>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#raw-data-hlmi-inner-accordioncontent2" aria-expanded="false" aria-controls="raw-data-hlmi-inner-accordioncontent2">
        <div>Fixed Years</div>


      </button>
    </h2>
    <div id="raw-data-hlmi-inner-accordioncontent2" class="accordion-collapse collapse" aria-labelledby="heading2">
      <div class="accordion-body">
        
<p>In the fixed years framing, respondents were asked for the probability of HLMI within 10, 20, and 40 years.</p>

<table>
  <thead>
    <tr>
      <th style="text-align: right">Years until HLMI</th>
      <th style="text-align: left">Mean response</th>
      <th style="text-align: left">15th percentile response</th>
      <th style="text-align: left">Median response</th>
      <th style="text-align: left">85th percentile response</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: right">10</td>
      <td style="text-align: left">18.25%</td>
      <td style="text-align: left">0.00%</td>
      <td style="text-align: left">10.00%</td>
      <td style="text-align: left">50.00%</td>
    </tr>
    <tr>
      <td style="text-align: right">20</td>
      <td style="text-align: left">34.70%</td>
      <td style="text-align: left">4.00%</td>
      <td style="text-align: left">30.00%</td>
      <td style="text-align: left">75.00%</td>
    </tr>
    <tr>
      <td style="text-align: right">40</td>
      <td style="text-align: left">54.58%</td>
      <td style="text-align: left">10.00%</td>
      <td style="text-align: left">50.00%</td>
      <td style="text-align: left">95.00%</td>
    </tr>
  </tbody>
</table>


      </div>
    </div>
  </div>
  
</div>
  </div>


      </div>
    </div>
  </div>
  
</div>
  </div>

<h1 id="aggregation">Aggregation</h1>

<h2 id="possible-methods">Possible methods</h2>
<p>All previous analyses produced the aggregate distribution by taking the average of CDF values, that is, by taking the mean of probability values at each year.</p>

<p>There are many other possible aggregation methods. We can put these into two categories:</p>

<ul>
  <li>vertical methods like the above aggregate probability values at each year</li>
  <li>horizontal methods aggregate year values at each probability</li>
</ul>

<p>This figure illustrates both methods on a very simple example with two CDFs to aggregate.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/illustrate_agg_methods-400-3cdbda1b5.webp 400w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-600-3cdbda1b5.webp 600w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-800-3cdbda1b5.webp 800w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-1000-3cdbda1b5.webp 1000w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-1500-3cdbda1b5.webp 1500w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-2000-3cdbda1b5.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/illustrate_agg_methods-400-3cdbda1b5.jpeg 400w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-600-3cdbda1b5.jpeg 600w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-800-3cdbda1b5.jpeg 800w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-1000-3cdbda1b5.jpeg 1000w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-1500-3cdbda1b5.jpeg 1500w, /generated/_posts/../assets/images/espai/illustrate_agg_methods-2000-3cdbda1b5.jpeg 2000w" type="image/jpeg" /><img alt="Diagram showing vertical and horizontal methods for aggregating CDFs." src="/generated/_posts/../assets/images/espai/illustrate_agg_methods-800-3cdbda1b5.png" width="4500" height="1800" /></picture>

<p>For both vertical and horizontal aggregation, we need not take the mean of values. In principle any aggregation function could be used, of which the mean and median are only the two most obvious examples.</p>

<p>When it comes to aggregating probabilities (vertical aggregation), there are additional complications. The topic has been well studied, and many aggregation methods have been proposed.</p>

<p>A full assessment of the topic would take us far beyond the scope of this report, so I will only briefly mention one prominent recommendation: taking the geometric mean of odds. The core observation is that the arithmetic mean of probabilities ignores information from extreme predictions. This can be seen with a simple example. In scenario A, we aggregate the two predictions (1%, 10%), whereas in scenario B the two predictions are (0.1%, 10%). The arithmetic mean of probabilities is close to 5% in both cases (5.5% for A and 5.05% for B). It gives very little weight to the difference between 1% and 0.1%, which is after all a factor of 10. The geometric mean of odds reacts much more strongly to this much more extreme prediction, being about 3.2% in scenario A, and 1.0% in scenario B.</p>

<p>This behaviour of the geometric mean of odds is theoretically appealing, but it is only advisable if extreme predictions are really to be taken at face value. We might worry that these predictions are much more overconfident.</p>

<p>As a further complication, in the case of ESPAI, in practise we cannot apply the geometric mean of odds. This is because for nearly every year (every vertical line) we might consider, many of the respondents’ fitted CDFs take values indistinguishable from 0 or 1. This causes the geometric mean of odds to immediately become 0 or 1<sup id="fnref:zero_one" role="doc-noteref"><a href="#fn:zero_one" class="footnote" rel="footnote">5</a></sup>.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/geomean_odds_bad-400-7e0a03b14.webp 400w, /generated/_posts/../assets/images/espai/geomean_odds_bad-600-7e0a03b14.webp 600w, /generated/_posts/../assets/images/espai/geomean_odds_bad-800-7e0a03b14.webp 800w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1000-7e0a03b14.webp 1000w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1500-7e0a03b14.webp 1500w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1920-7e0a03b14.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/geomean_odds_bad-400-7e0a03b14.jpeg 400w, /generated/_posts/../assets/images/espai/geomean_odds_bad-600-7e0a03b14.jpeg 600w, /generated/_posts/../assets/images/espai/geomean_odds_bad-800-7e0a03b14.jpeg 800w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1000-7e0a03b14.jpeg 1000w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1500-7e0a03b14.jpeg 1500w, /generated/_posts/../assets/images/espai/geomean_odds_bad-1920-7e0a03b14.jpeg 1920w" type="image/jpeg" /><img alt="Visualization showing the problems with using the geometric mean of odds for aggregation, where extreme probabilities lead to the aggregate CDF reaching 0 or 1." src="/generated/_posts/../assets/images/espai/geomean_odds_bad-800-7e0a03b14.png" width="1920" height="1440" /></picture>

<p>Aggregating years is also problematic. Because the input is bounded on the left but not the right, the arithmetic mean of responses is inevitably dominated by extremely large values. This method would produce a CDF where any probability of the event is essentially infinitely many years away. We might hope to address this problem by using the geometric mean of years, but this in turn suffers from numerical and conceptual issues similar to those of the geometric mean of odds. Ultimately, taking the median of years is the only method of aggregating years I was able to apply.</p>

<p>The median of years and median of probabilities give the same answer. This makes intuitive sense since CDFs are strictly increasing<sup id="fnref:median-theorem" role="doc-noteref"><a href="#fn:median-theorem" class="footnote" rel="footnote">6</a></sup>. So I simply call this the “median”.</p>

<h2 id="mean-vs-median-aggregation">Mean vs Median aggregation</h2>
<p>As a result of these difficulties, I will present only the following aggregation methods:</p>

<ul>
  <li>(Arithmetic) mean of probabilities</li>
  <li>Median of probabilities</li>
</ul>

<p>These plots use the Gamma distribution with the mean square error (MSE) of probabilities as the loss function, so the mean aggregation line corresponds to the results of previous analyses.</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold"><div>Mean vs Median aggregation</div>
</div>
  <div class="accordion" id="mean-vs-median-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent0" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent0">
        
<div>Full automation of labor (FAOL)</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_faol-400-327ae02db.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-600-327ae02db.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-800-327ae02db.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1000-327ae02db.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1500-327ae02db.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1920-327ae02db.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_faol-400-327ae02db.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-600-327ae02db.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-800-327ae02db.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1000-327ae02db.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1500-327ae02db.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol-1920-327ae02db.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for FAOL." src="/generated/_posts/../assets/images/espai/compare_agg_methods_faol-800-327ae02db.png" width="1920" height="1440" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-400-b0e8ab94e.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-600-b0e8ab94e.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-800-b0e8ab94e.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1000-b0e8ab94e.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1500-b0e8ab94e.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1920-b0e8ab94e.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-400-b0e8ab94e.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-600-b0e8ab94e.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-800-b0e8ab94e.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1000-b0e8ab94e.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1500-b0e8ab94e.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-1920-b0e8ab94e.jpeg 1920w" type="image/jpeg" /><img alt="Extended comparison of mean and median aggregation for FAOL with additional data points." src="/generated/_posts/../assets/images/espai/compare_agg_methods_faol_2800-800-b0e8ab94e.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent1" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent1">
        <div>High Level Machine Intelligence (HLMI)</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-400-c9de403f1.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-600-c9de403f1.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-800-c9de403f1.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1000-c9de403f1.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1500-c9de403f1.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1920-c9de403f1.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-400-c9de403f1.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-600-c9de403f1.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-800-c9de403f1.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1000-c9de403f1.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1500-c9de403f1.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-1920-c9de403f1.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for HLMI." src="/generated/_posts/../assets/images/espai/compare_agg_methods_hlmi-800-c9de403f1.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent2" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent2">
        <div>Truck Driver</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent2" class="accordion-collapse collapse" aria-labelledby="heading2">
      <div class="accordion-body">
        <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-400-226379173.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-600-226379173.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-800-226379173.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1000-226379173.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1500-226379173.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1920-226379173.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-400-226379173.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-600-226379173.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-800-226379173.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1000-226379173.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1500-226379173.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-1920-226379173.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for Truck Driver occupation." src="/generated/_posts/../assets/images/espai/compare_agg_methods_TRUCK_DRIVER-800-226379173.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading3">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent3" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent3">
        <div>Surgeon</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent3" class="accordion-collapse collapse" aria-labelledby="heading3">
      <div class="accordion-body">
        <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-400-cb2d9e8bb.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-600-cb2d9e8bb.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-800-cb2d9e8bb.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1000-cb2d9e8bb.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1500-cb2d9e8bb.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1920-cb2d9e8bb.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-400-cb2d9e8bb.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-600-cb2d9e8bb.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-800-cb2d9e8bb.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1000-cb2d9e8bb.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1500-cb2d9e8bb.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-1920-cb2d9e8bb.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for Surgeon occupation." src="/generated/_posts/../assets/images/espai/compare_agg_methods_SURGEON-800-cb2d9e8bb.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading4">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent4" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent4">
        <div>Retail Salesperson</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent4" class="accordion-collapse collapse" aria-labelledby="heading4">
      <div class="accordion-body">
        <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-400-72672d778.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-600-72672d778.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-800-72672d778.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1000-72672d778.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1500-72672d778.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1920-72672d778.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-400-72672d778.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-600-72672d778.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-800-72672d778.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1000-72672d778.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1500-72672d778.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-1920-72672d778.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for Retail Salesperson occupation." src="/generated/_posts/../assets/images/espai/compare_agg_methods_RETAIL_SALESPERSON-800-72672d778.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading5">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mean-vs-median-accordioncontent5" aria-expanded="false" aria-controls="mean-vs-median-accordioncontent5">
        <div>AI Researcher</div>


      </button>
    </h2>
    <div id="mean-vs-median-accordioncontent5" class="accordion-collapse collapse" aria-labelledby="heading5">
      <div class="accordion-body">
        <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-400-72b23373a.webp 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-600-72b23373a.webp 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-800-72b23373a.webp 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1000-72b23373a.webp 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1500-72b23373a.webp 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1920-72b23373a.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-400-72b23373a.jpeg 400w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-600-72b23373a.jpeg 600w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-800-72b23373a.jpeg 800w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1000-72b23373a.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1500-72b23373a.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-1920-72b23373a.jpeg 1920w" type="image/jpeg" /><img alt="Comparison of mean and median aggregation methods for AI Researcher occupation." src="/generated/_posts/../assets/images/espai/compare_agg_methods_AI_RESEARCHER-800-72b23373a.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
</div>
  </div>

<p>We see a notable pattern in each of these cases. As we go from left to right, the median always starts below the mean (i.e. the median initially gives later predictions), but eventually overtakes the mean (i.e. the median eventually gives earlier predictions). Median aggregation also always gives rise to a more confident probability distribution: one whose probability mass is more concentrated.</p>

<h2 id="why-the-mean-and-median-differ">Why the mean and median differ</h2>
<p>When the mean is very different from the median, this means that the distribution of responses is highly skewed. We can illustrate this by displaying a histogram of CDF values for a given year.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-400-637fdc5f8.webp 400w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-600-637fdc5f8.webp 600w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-800-637fdc5f8.webp 800w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-1000-637fdc5f8.webp 1000w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-1500-637fdc5f8.webp 1500w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-2000-637fdc5f8.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-400-637fdc5f8.jpeg 400w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-600-637fdc5f8.jpeg 600w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-800-637fdc5f8.jpeg 800w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-1000-637fdc5f8.jpeg 1000w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-1500-637fdc5f8.jpeg 1500w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-2000-637fdc5f8.jpeg 2000w" type="image/jpeg" /><img alt="Histogram showing distribution of FAOL CDF values, comparing mean and median aggregation." src="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_FAOL-800-637fdc5f8.png" width="2160" height="1440" /></picture>

<p>The results for automation of all occupations (FAOL) are quite interesting. For the years 2040 and 2060, the results are extremely skewed. A large majority assigns very low probabilities, but there is a right tail of high probabilities, which causes the mean to greatly exceed the median. For the years 2080 and 2100, a bimodal distribution emerges. We have a big cluster with probabilities near zero and a big cluster with probabilities near 1. Opinion is extremely polarised. By 2200 the median exceeds the mean. When we reach 2500, a majority think FAOL is near-certain, but a significant left tail causes the mean to lag far behind the median.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-400-a7e43ec26.webp 400w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-600-a7e43ec26.webp 600w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-800-a7e43ec26.webp 800w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-1000-a7e43ec26.webp 1000w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-1500-a7e43ec26.webp 1500w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-2000-a7e43ec26.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-400-a7e43ec26.jpeg 400w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-600-a7e43ec26.jpeg 600w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-800-a7e43ec26.jpeg 800w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-1000-a7e43ec26.jpeg 1000w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-1500-a7e43ec26.jpeg 1500w, /generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-2000-a7e43ec26.jpeg 2000w" type="image/jpeg" /><img alt="Histogram showing distribution of HLMI CDF values, comparing mean and median aggregation." src="/generated/_posts/../assets/images/espai/mean_vs_median_cdf_slice_histogram_HLMI-800-a7e43ec26.png" width="2160" height="1440" /></picture>

<p>With task automation (HLMI), we see the same basic pattern (repeated everywhere): the median at first trails behind the mean, and for later years and higher probabilities, the median overtakes the mean. However, skewness is less extreme than for FAOL, and we do not see a strongly bimodal histogram (extreme polarisation) at any point.</p>

<h2 id="aside-the-winsorized-geometric-mean-of-odds">Aside: the winsorized geometric mean of odds</h2>
<p>There is one way to use the geometric mean of odds that avoids the problem of zeroes and ones. This is to winsorize the data: to replace the most extreme values with less extreme values. For example, we could replace all values less than 0.1 with 0.1, and all values greater than 0.9 with 0.9.</p>

<p>Of course, this introduces a highly subjective choice that massively affects the results. We could replace all values less than 0.01 with 0.01, or all values less than 0.001 with 0.001. Therefore, I do not consider this technique suitable for the creation of headline result.</p>

<p>However, it lets us do some potentially interesting explorations. Winsorising essentially means we do not trust the most extreme predictions. We can now explore what the geometric mean of odds would look like under various degrees of winsorisation. e.g. what does it look like if we ignore all predictions more extreme than 1:100? What about 1:1000?</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-400-8452e51e5.webp 400w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-600-8452e51e5.webp 600w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-800-8452e51e5.webp 800w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1000-8452e51e5.webp 1000w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1500-8452e51e5.webp 1500w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1920-8452e51e5.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-400-8452e51e5.jpeg 400w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-600-8452e51e5.jpeg 600w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-800-8452e51e5.jpeg 800w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1000-8452e51e5.jpeg 1000w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1500-8452e51e5.jpeg 1500w, /generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-1920-8452e51e5.jpeg 1920w" type="image/jpeg" /><img alt="Plot showing how winsorization levels affect geometric mean aggregation for FAOL." src="/generated/_posts/../assets/images/espai/winsorized_geomean_FAOL-800-8452e51e5.png" width="1920" height="1440" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-400-7f4093598.webp 400w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-600-7f4093598.webp 600w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-800-7f4093598.webp 800w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1000-7f4093598.webp 1000w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1500-7f4093598.webp 1500w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1920-7f4093598.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-400-7f4093598.jpeg 400w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-600-7f4093598.jpeg 600w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-800-7f4093598.jpeg 800w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1000-7f4093598.jpeg 1000w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1500-7f4093598.jpeg 1500w, /generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-1920-7f4093598.jpeg 1920w" type="image/jpeg" /><img alt="Plot showing how winsorization levels affect geometric mean aggregation for HLMI." src="/generated/_posts/../assets/images/espai/winsorized_geomean_HLMI-800-7f4093598.png" width="1920" height="1440" /></picture>

<p>Very informally, we can see that for HLMI (tasks) and FAOL (occupations), the arithmetic mean of probabilities roughly corresponds to the geometric mean of odds with a winsorisation level of about 1:10. We’ve already discussed the well-known effect that the arithmetic mean of probabilities ignores more extreme predictions, compared to the geometric mean of odds. For this particular data, we can roughly quantify this effect, and see that it is equivalent to ignoring all predictions &lt;10% and &gt;90%. I find this to be quite an extreme level of winsorisation. Consider, for example, that the fixed-probabilities framing explicitly asked for predictions at the 10% and 90% levels – it would be odd to simultaneously consider these probabilities too extreme to be trusted.</p>

<h1 id="distribution-fitting">Distribution fitting</h1>

<p>All previous analyses of the ESPAI data fitted each respondent’s CDF data (triples of (year, probability)) to a Gamma distribution before aggregating these distributions.</p>

<h2 id="why-fit-a-distribution">Why fit a distribution?</h2>

<p>Creating a full continuous distribution from three CDF points necessarily imposes some assumptions that were not present in the data. And recall, the respondents just gave numbers in text fields, and never saw the distribution that was later fitted to their CDF data.</p>

<p>So to begin with, it’s worth asking: why fit a distribution at all?</p>

<p>If we are only looking at a particular framing and question, for example FAOL with fixed years, it may indeed be preferable to look directly at the raw data. This allows us to talk strictly about what respondents said, without any additional assumptions. Even in this restricted setting, however, we might want to be able to get predictions for other years or probabilities than those respondents were asked about; this requires a full CDF. A simple example where this is required is for making comparisons across different iterations of the ESPAI survey in the fixed-years setting. Each survey asks for predictions about a fixed number of years <em>from the date of the survey</em>. So the fixed-years question asks about different calendar years each time the survey is made.</p>

<p>A more fundamental problem for the raw data approach is that we wish to aggregate the results of different framings into a single estimate. We can only aggregate across the fixed-years and fixed-probability framings by aggregating full distributions. In addition, even within the fixed-years framing, we cannot aggregate the occupations (FAOL) and tasks (HLMI) framings, because different years were used (10, 20, and 40 years for HLMI and 10, 20, and 50 years for FAOL).</p>

<h2 id="limitations-of-previous-analyses">Limitations of previous analyses</h2>

<h3 id="constraints-of-gamma-distribution">Constraints of Gamma distribution</h3>

<p>While creating a full CDF from three points inevitably imposes assumptions not present in the data, we might think that, at a minimum, it would be desirable to have this CDF pass through the three points.</p>

<p>Previous analyses used a Gamma distribution. The gamma distribution is a 2-parameter distribution that is able to exactly match 2 points of CDF data, but not 3 points. The gamma distribution (and any 2-parameter distribution) necessarily loses information and distorts the expert’s beliefs even for the points where we know exactly what they believe.</p>

<p>Here are 9 examples from the fixed-probabilities framing<sup id="fnref:plot-fn" role="doc-noteref"><a href="#fn:plot-fn" class="footnote" rel="footnote">7</a></sup>. They are representative of the bottom half of fits (from the 50th to 90th percentile). Each subplot shows an example where the fitted gamma CDF (shown as a gray curve) attempts to match three points from a respondent’s data (shown as red crosses).</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-400-52fe1713e.webp 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-600-52fe1713e.webp 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-800-52fe1713e.webp 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-1000-52fe1713e.webp 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-1500-52fe1713e.webp 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-2000-52fe1713e.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-400-52fe1713e.jpeg 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-600-52fe1713e.jpeg 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-800-52fe1713e.jpeg 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-1000-52fe1713e.jpeg 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-1500-52fe1713e.jpeg 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-2000-52fe1713e.jpeg 2000w" type="image/jpeg" /><img alt="Gamma distribution fits to fixed probabilities survey data, showing respondent points and Gamma CDFs." src="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_False-800-52fe1713e.png" width="2670" height="2769" /></picture>

<p>First, we can see that the gamma is not flexible enough to match the three points. While the median fit (A1) is acceptable, some fits are poor.</p>

<h3 id="inappropriate-loss-function">Inappropriate loss function</h3>
<p>In addition, if we look carefully we can see an interesting systematic pattern in the poor fits. We can see that when the Gamma has trouble fitting the data, it prefers to fit two points well, even at the expense of a very poor fit on the third point, rather than choosing a middle ground with an acceptable fit on all three points. This begins to be visible in row B (67th to 87th percentile), and becomes blatantly clear in row C (84th to 95th percentile). In fact, in C2 and C3, the Gamma fits two points exactly and completely ignores the third. When this happens, the worst-fit point is always the 0.9 or 0.1 point, never the 0.5 point.</p>

<p>The errors at the 0.1 and 0.9 points can completely change the nature of the prediction. This becomes clear if we go to odds space, and express the odds ratio between the data and the gamma CDF.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-400-648afb1c2.webp 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-600-648afb1c2.webp 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-800-648afb1c2.webp 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-1000-648afb1c2.webp 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-1500-648afb1c2.webp 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-2000-648afb1c2.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-400-648afb1c2.jpeg 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-600-648afb1c2.jpeg 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-800-648afb1c2.jpeg 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-1000-648afb1c2.jpeg 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-1500-648afb1c2.jpeg 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-2000-648afb1c2.jpeg 2000w" type="image/jpeg" /><img alt="Gamma distribution fits to fixed probabilities survey data, showing respondent points and Gamma CDFs, with annotations" src="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_probabilities_annotations_True-800-648afb1c2.png" width="2662" height="2769" /></picture>

<p>While a 2x odds ratio (e.g. in B2) is already substantial, when we move to the worst 15% of the fits, the odds ratio for the worst of the three points becomes astronomical.</p>

<p>The reason this happens is that the loss function used in previous work is not the appropriate one.</p>

<p>Previous analyses used mean squared error (MSE) of probabilities as their loss function: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>L</mi><mtext>MSE</mtext></msub><mo>=</mo><msub><mo>∑</mo><mi>i</mi></msub><mo stretchy="false">(</mo><msub><mi>p</mi><mi>i</mi></msub><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo>^</mo></mover><mi>i</mi></msub><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">L_{\text{MSE}} = \sum_i (p_i - \hat{p}_i)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">MSE</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0497em;vertical-align:-0.2997em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.162em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">p</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1667em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">p_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> are the probabilities from the respondent’s data and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mover accent="true"><mi>p</mi><mo>^</mo></mover><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\hat{p}_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">p</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1667em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> are the probabilities from the fitted CDF. This loss function treats all probability differences equally, regardless of where they occur in the distribution. For instance, it considers a deviation of 0.05 to be equally bad whether it occurs at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.5</mn></mrow><annotation encoding="application/x-tex">p=0.5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.5</span></span></span></span> or at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.99</mn></mrow><annotation encoding="application/x-tex">p=0.99</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.99</span></span></span></span>.</p>

<p>This is inappropriate when fitting CDF data. Consider the case depicted in C2, where the respondent thinks the event in question is 90% likely by 150 years from the date of the survey. Meanwhile, the Gamma CDF fitted by MSE gives a probability of 99.98% at 150 years. This dramatic departure from the respondent’s beliefs is represented in the 777x odds ratio. A 777x odds ratio at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.5</mn></mrow><annotation encoding="application/x-tex">p=0.5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.5</span></span></span></span> would mean changing from even odds (1:1) to odds of 777:1, or a probability of &gt;99.8%. (A 13x odds ratio, as seen for the 0.1 point in C1 (84th percentile), would mean changing from even odds to odds of 13:1, or a probability of 93%.)</p>

<p>The appropriate loss function for CDF data is the log loss, also known as the cross-entropy loss: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>L</mi><mtext>log</mtext></msub><mo>=</mo><mo>−</mo><msub><mo>∑</mo><mi>i</mi></msub><mo stretchy="false">[</mo><msub><mi>p</mi><mi>i</mi></msub><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><msub><mover accent="true"><mi>p</mi><mo>^</mo></mover><mi>i</mi></msub><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mi>i</mi></msub><mo stretchy="false">)</mo><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo>^</mo></mover><mi>i</mi></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">L_{\text{log}} = -\sum_i [p_i \log(\hat{p}_i) + (1-p_i)\log(1-\hat{p}_i)]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">log</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0497em;vertical-align:-0.2997em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.162em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mopen">[</span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">p</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1667em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">p</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1667em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)]</span></span></span></span>. This loss function naturally accounts for the fact that probability differences near 0 and 1 represent much larger differences in beliefs than the same probability differences near 0.5.<sup id="fnref:kl-divergence" role="doc-noteref"><a href="#fn:kl-divergence" class="footnote" rel="footnote">8</a></sup></p>

<p>As expected from this theoretical argument, we can see that the log loss, unlike the MSE of probabilities, does not display the pathological behaviour of ignoring the 0.1 or 0.9 point, and so avoids extreme odds ratios (see especially C1-C3):</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-400-1c7e7df7a.webp 400w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-600-1c7e7df7a.webp 600w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-800-1c7e7df7a.webp 800w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-1000-1c7e7df7a.webp 1000w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-1500-1c7e7df7a.webp 1500w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-2000-1c7e7df7a.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-400-1c7e7df7a.jpeg 400w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-600-1c7e7df7a.jpeg 600w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-800-1c7e7df7a.jpeg 800w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-1000-1c7e7df7a.jpeg 1000w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-1500-1c7e7df7a.jpeg 1500w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-2000-1c7e7df7a.jpeg 2000w" type="image/jpeg" /><img alt="Comparison of log loss and MSE on Gamma distribution fits for fixed probabilities framing." src="/generated/_posts/../assets/images/espai/9_cdfs_gamma_loss_Fixed_probabilities-800-1c7e7df7a.png" width="2670" height="2769" /></picture>

<p>As an informal analysis, this plot suggests that the MSE leads to extremely poor fits on &gt;15% of the data, but also that most of the MSE fits are close to the log loss fits.</p>

<p>When we create the aggregate CDF, we see hardly any impact of the loss function:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-400-9fd702584.webp 400w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-600-9fd702584.webp 600w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-800-9fd702584.webp 800w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1000-9fd702584.webp 1000w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1500-9fd702584.webp 1500w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1920-9fd702584.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-400-9fd702584.jpeg 400w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-600-9fd702584.jpeg 600w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-800-9fd702584.jpeg 800w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1000-9fd702584.jpeg 1000w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1500-9fd702584.jpeg 1500w, /generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-1920-9fd702584.jpeg 1920w" type="image/jpeg" /><img alt="Aggregate CDFs for HLMI and FAOL using Gamma and flexible distributions." src="/generated/_posts/../assets/images/espai/gamma_effect_of_loss_aggregate_HLMI_FAOL-800-9fd702584.png" width="1920" height="1440" /></picture>

<h2 id="flexible-distributions">Flexible distributions</h2>

<p>Regardless of the loss function used, we know that the Gamma distribution cannot match the three points of CDF data given by the expert<sup id="fnref:gengamma" role="doc-noteref"><a href="#fn:gengamma" class="footnote" rel="footnote">9</a></sup>. When we use any such distribution, our results do not merely reflect the expert’s beliefs, they also reflect the mathematical constraint we imposed upon those beliefs.</p>

<p>Overriding expert responses in this way may be appropriate when we have a strong theoretical justification to impose a particular distribution family. For example, if we have a strong reason to believe that experts think (or ought to think) of a variable as a sum of many small independent contributions, we may wish to impose a normal distribution, even if the responses they gave us are incompatible with a normal distribution.</p>

<p>However, the authors of previous analyses did not justify the choice of the gamma distribution at any point. In addition, I am not aware of any strong argument to impose a particular distribution family in this case.</p>

<p>While creating a full CDF from three points inevitably imposes assumptions not present in the data, at a minimum, it would be desirable to have this CDF pass through the three points.</p>

<p>To achieve this, I used proprietary probability distributions which I call ‘flexible distributions’. I developed these over the last several years, for precisely the class of use cases faced by ESPAI. These distributions have the following properties:</p>

<ul>
  <li>Always exactly match three CDF points (or indeed an arbitrary number of them)…</li>
  <li>…while taking a simple and smooth shape</li>
  <li>Can be unbounded, or given an upper or lower bound, or both</li>
</ul>

<p>The distributions I used in this analysis are based on <a href="https://en.wikipedia.org/wiki/Interpolation">interpolation</a> theory. The full mathematical and algorithmic details are proprietary, and the distributions are available as a service at <a href="https://makedistribution.com/">MakeDistribution.com</a>. However, you can see how these distributions behave with the free interactive web UI below (select interpolation-based families under expert settings). In addition, to make this work reproducible, the specific fitted CDFs used in the ESPAI analysis are open source<sup id="fnref:os-impl" role="doc-noteref"><a href="#fn:os-impl" class="footnote" rel="footnote">10</a></sup>.</p>

<details>
<summary style="cursor: pointer;">
<span style="text-decoration: underline;">Try the MakeDistribution interface</span>
</summary>
<iframe style="width: 125%;
  max-width: 95vw;
  min-width: 100%;
  left: 50%;
  transform: translateX(-50%);
  position: relative;
  border: 1px solid grey;
  border-radius: 5px;
  height: 770px;" src="https://makedistribution.com/playground/"></iframe>
</details>

<p>This plot compares Gamma distribution fits versus flexible distribution fits for fixed probabilities framing, displaying respondent points and Gamma CDFs.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-400-629bacd6f.webp 400w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-600-629bacd6f.webp 600w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-800-629bacd6f.webp 800w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-1000-629bacd6f.webp 1000w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-1500-629bacd6f.webp 1500w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-2000-629bacd6f.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-400-629bacd6f.jpeg 400w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-600-629bacd6f.jpeg 600w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-800-629bacd6f.jpeg 800w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-1000-629bacd6f.jpeg 1000w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-1500-629bacd6f.jpeg 1500w, /generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-2000-629bacd6f.jpeg 2000w" type="image/jpeg" /><img alt="Comparison of Gamma and flexible distribution fits for fixed probabilities framing." src="/generated/_posts/../assets/images/espai/9_cdfs_gamma_vs_flexible_Fixed_probabilities-800-629bacd6f.png" width="2670" height="2769" /></picture>

<p>When we aggregate the individual distributions, however, we find that the choice of distribution has a very limited impact, barely any more than the impact of the loss function.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-400-eed21f095.webp 400w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-600-eed21f095.webp 600w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-800-eed21f095.webp 800w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1000-eed21f095.webp 1000w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1500-eed21f095.webp 1500w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1920-eed21f095.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-400-eed21f095.jpeg 400w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-600-eed21f095.jpeg 600w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-800-eed21f095.jpeg 800w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1000-eed21f095.jpeg 1000w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1500-eed21f095.jpeg 1500w, /generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-1920-eed21f095.jpeg 1920w" type="image/jpeg" /><img alt="Aggregate CDFs for HLMI and FAOL using Gamma and flexible distributions." src="/generated/_posts/../assets/images/espai/gamma_vs_flexible_aggregate_HLMI_FAOL-800-eed21f095.png" width="1920" height="1440" /></picture>

<p>It may be somewhat surprising to see so little difference in aggregate, when we consider that there appeared to be systematic patterns in the poor gamma fits<sup id="fnref:patterns-bias" role="doc-noteref"><a href="#fn:patterns-bias" class="footnote" rel="footnote">11</a></sup>. However, this might be explained by the fact that the majority of fits were of acceptable quality.</p>

<p>I ran many variations of this analysis (and so can you, using the open-source <a href="#codebase">codebase</a>). None showed a dramatic effect of the distribution family.</p>

<h2 id="other-distributions">Other distributions</h2>

<p>In addition to flexible distributions, I also investigated the use of alternative ‘traditional’ distributions, such as the Weibull or Generalised gamma<sup id="fnref:gengamma:1" role="doc-noteref"><a href="#fn:gengamma" class="footnote" rel="footnote">9</a></sup>. For each distribution family, I tried fitting them both with the MSE of probabilities loss used by previous authors, and with the log loss. These had little impact on the aggregate CDF, which might be considered unsurprising since even the flexible distribution did not have large effects on aggregate results.</p>

<h1 id="range-of-responses">Displaying the distribution of responses</h1>

<p>What is the range of opinion<sup id="fnref:disagreement_vs_framing" role="doc-noteref"><a href="#fn:disagreement_vs_framing" class="footnote" rel="footnote">12</a></sup> among experts? Previous analyses gave only an informal sense of this by displaying a few dozen randomly selected CDFs:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/grace_2018_figure_1-400-77b68b37c.webp 400w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-600-77b68b37c.webp 600w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-800-77b68b37c.webp 800w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1000-77b68b37c.webp 1000w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1500-77b68b37c.webp 1500w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1658-77b68b37c.webp 1658w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/grace_2018_figure_1-400-77b68b37c.jpeg 400w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-600-77b68b37c.jpeg 600w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-800-77b68b37c.jpeg 800w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1000-77b68b37c.jpeg 1000w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1500-77b68b37c.jpeg 1500w, /generated/_posts/../assets/images/espai/grace_2018_figure_1-1658-77b68b37c.jpeg 1658w" type="image/jpeg" /><img alt="Scatterplot of previous ESPAI survey CDFs." src="/generated/_posts/../assets/images/espai/grace_2018_figure_1-800-77b68b37c.png" width="1658" height="1058" /></picture>

<p><em><a href="https://arxiv.org/pdf/1705.08807">When Will AI Exceed Human Performance? Evidence from AI Experts</a></em>, Figure 1.</p>

<p>Their plots also included a 95% bootstrap confidence interval for the mean CDF. This is a measure of statistical variability in the estimate of the mean due to the finite sample size, not a measure of the dispersion of responses. Since ESPAI sample sizes are quite large, and the mean hence quite precisely estimated, I believe this bootstrap confidence interval is of secondary importance.</p>

<p>I dispense with the bootstrap CI and instead use the shaded area around the aggregate CDF to show the distribution of responses, specifically the central half of CDFs, from the 25th to the 75th percentile. This is a more systematic and quantitative alternative to displaying a random subset of individual CDFs.</p>

<p>It is clear that authors of previous ESPAI analyses are well aware of what the bootstrap CI measures and interpret it correctly. However, it’s possible that some casual readers did not become fully aware of this. For the avoidance of doubt, the 95% bootstrap CI is radically different (and radically more narrow) than the interval containing 95% of individual CDFs. The latter would cover almost the entire plot:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-400-9d7505984.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-600-9d7505984.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1000-9d7505984.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1500-9d7505984.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1920-9d7505984.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-400-9d7505984.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-600-9d7505984.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1000-9d7505984.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1500-9d7505984.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1920-9d7505984.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 95% of individual CDFs for HLMI" src="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.png" width="1920" height="1440" /></picture>

<p>The degree of disagreement among respondents is such that instead of 95%, I show the central 50% in my plots. This is the widest interval that I found sufficiently visually informative. More typical intervals like the central 80% or 70% would cover such a wide range of predictions as to be less informative.</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold"><div>Distribution of responses</div>
</div>
  <div class="accordion" id="range-of-responses-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent0" aria-expanded="false" aria-controls="range-of-responses-accordioncontent0">
        
<div>Full automation of labor (FAOL): central <strong>95%</strong> (2.5th to 97.5th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-400-d60089c8a.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-600-d60089c8a.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-800-d60089c8a.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1000-d60089c8a.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1500-d60089c8a.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1920-d60089c8a.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-400-d60089c8a.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-600-d60089c8a.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-800-d60089c8a.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1000-d60089c8a.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1500-d60089c8a.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-1920-d60089c8a.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 95% of individual CDFs for FAOL" src="/generated/_posts/../assets/images/espai/range_of_responses_95_FAOL-800-d60089c8a.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent1" aria-expanded="false" aria-controls="range-of-responses-accordioncontent1">
        <div>Full automation of labor (FAOL): central <strong>80%</strong> (10th to 90th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-400-ec23db928.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-600-ec23db928.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-800-ec23db928.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1000-ec23db928.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1500-ec23db928.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1920-ec23db928.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-400-ec23db928.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-600-ec23db928.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-800-ec23db928.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1000-ec23db928.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1500-ec23db928.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-1920-ec23db928.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 80% of individual CDFs for FAOL" src="/generated/_posts/../assets/images/espai/range_of_responses_80_FAOL-800-ec23db928.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent2" aria-expanded="false" aria-controls="range-of-responses-accordioncontent2">
        <div>Full automation of labor (FAOL): central <strong>70%</strong> (15th to 85th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent2" class="accordion-collapse collapse" aria-labelledby="heading2">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-400-8fe080a68.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-600-8fe080a68.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-800-8fe080a68.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1000-8fe080a68.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1500-8fe080a68.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1920-8fe080a68.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-400-8fe080a68.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-600-8fe080a68.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-800-8fe080a68.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1000-8fe080a68.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1500-8fe080a68.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-1920-8fe080a68.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 70% of individual CDFs for FAOL" src="/generated/_posts/../assets/images/espai/range_of_responses_70_FAOL-800-8fe080a68.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading3">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent3" aria-expanded="false" aria-controls="range-of-responses-accordioncontent3">
        <div>Full automation of labor (FAOL): central <strong>50%</strong> (25th to 75th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent3" class="accordion-collapse collapse" aria-labelledby="heading3">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-400-4c95edc16.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-600-4c95edc16.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-800-4c95edc16.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1000-4c95edc16.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1500-4c95edc16.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1920-4c95edc16.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-400-4c95edc16.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-600-4c95edc16.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-800-4c95edc16.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1000-4c95edc16.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1500-4c95edc16.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-1920-4c95edc16.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 50% of individual CDFs for FAOL" src="/generated/_posts/../assets/images/espai/range_of_responses_50_FAOL-800-4c95edc16.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading4">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent4" aria-expanded="false" aria-controls="range-of-responses-accordioncontent4">
        <div>High Level Machine Intelligence (HLMI): central <strong>95%</strong> (2.5th to 97.5th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent4" class="accordion-collapse collapse" aria-labelledby="heading4">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-400-9d7505984.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-600-9d7505984.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1000-9d7505984.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1500-9d7505984.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1920-9d7505984.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-400-9d7505984.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-600-9d7505984.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1000-9d7505984.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1500-9d7505984.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-1920-9d7505984.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 95% of individual CDFs for HLMI" src="/generated/_posts/../assets/images/espai/range_of_responses_95_HLMI-800-9d7505984.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading5">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent5" aria-expanded="false" aria-controls="range-of-responses-accordioncontent5">
        <div>High Level Machine Intelligence (HLMI): central <strong>80%</strong> (10th to 90th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent5" class="accordion-collapse collapse" aria-labelledby="heading5">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-400-8cc7c751c.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-600-8cc7c751c.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-800-8cc7c751c.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1000-8cc7c751c.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1500-8cc7c751c.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1920-8cc7c751c.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-400-8cc7c751c.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-600-8cc7c751c.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-800-8cc7c751c.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1000-8cc7c751c.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1500-8cc7c751c.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-1920-8cc7c751c.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 80% of individual CDFs for HLMI" src="/generated/_posts/../assets/images/espai/range_of_responses_80_HLMI-800-8cc7c751c.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading6">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent6" aria-expanded="false" aria-controls="range-of-responses-accordioncontent6">
        <div>High Level Machine Intelligence (HLMI): central <strong>70%</strong> (15th to 85th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent6" class="accordion-collapse collapse" aria-labelledby="heading6">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-400-e62c6d1b4.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-600-e62c6d1b4.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-800-e62c6d1b4.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1000-e62c6d1b4.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1500-e62c6d1b4.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1920-e62c6d1b4.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-400-e62c6d1b4.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-600-e62c6d1b4.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-800-e62c6d1b4.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1000-e62c6d1b4.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1500-e62c6d1b4.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-1920-e62c6d1b4.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 70% of individual CDFs for HLMI" src="/generated/_posts/../assets/images/espai/range_of_responses_70_HLMI-800-e62c6d1b4.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading7">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#range-of-responses-accordioncontent7" aria-expanded="false" aria-controls="range-of-responses-accordioncontent7">
        <div>High Level Machine Intelligence (HLMI): central <strong>50%</strong> (25th to 75th percentile)</div>


      </button>
    </h2>
    <div id="range-of-responses-accordioncontent7" class="accordion-collapse collapse" aria-labelledby="heading7">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-400-9c67a3736.webp 400w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-600-9c67a3736.webp 600w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-800-9c67a3736.webp 800w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1000-9c67a3736.webp 1000w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1500-9c67a3736.webp 1500w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1920-9c67a3736.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-400-9c67a3736.jpeg 400w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-600-9c67a3736.jpeg 600w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-800-9c67a3736.jpeg 800w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1000-9c67a3736.jpeg 1000w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1500-9c67a3736.jpeg 1500w, /generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-1920-9c67a3736.jpeg 1920w" type="image/jpeg" /><img alt="Shaded area showing central 50% of individual CDFs for HLMI" src="/generated/_posts/../assets/images/espai/range_of_responses_50_HLMI-800-9c67a3736.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
</div>
  </div>

<h1 id="aggregating-hlmi-faol">Aggregating across the task and occupation framings</h1>

<p>Before being asked for their forecasts, respondents were shown the following definitions for HLMI (High-Level Machine Intelligence) and FAOL (Full Automation of Labor):</p>

<p>HLMI (tasks):</p>
<blockquote>
  <p>High-level machine intelligence (HLMI) is achieved when unaided machines can accomplish every task better and more cheaply than human workers. Ignore aspects of tasks for which being a human is intrinsically advantageous, e.g., being accepted as a jury member. Think feasibility, not adoption.</p>
</blockquote>

<p>FAOL (occupations):</p>
<blockquote>
  <p>Say an occupation becomes fully automatable when unaided machines can accomplish it better and more cheaply than human workers. Ignore aspects of occupations for which being a human is intrinsically advantageous, e.g., being accepted as a jury member. Think feasibility, not adoption.
Say we have reached ‘full automation of labor’ when all occupations are fully automatable. That is, when for any occupation, machines could be built to carry out the task better and more cheaply than human workers.</p>
</blockquote>

<p>The two questions are very similar. The main difference is that HLMI is phrased in terms of tasks, while FAOL asks about occupations. In principle, we should expect the same prediction on both questions. As noted by the authors,</p>

<blockquote>
  <p>since occupations might naturally be understood either as complex tasks, composed of tasks, or closely connected with one of these, achieving HLMI seems to either imply having already achieved FAOL, or suggest being close.</p>
</blockquote>

<p>So it is legitimate to think of these as two different framings of the same question.</p>

<p>Despite their similarity, these framings yield very different predictions. The figures below show the result of using my preferred settings (median aggregation, flexible distributions), except that HLMI and FAOL are shown separately instead of aggregated:</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div class="fw-bold"><div>HLMI vs FAOL</div>
</div>
  <div class="accordion" id="hlmi-vs-faol-accordion">
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#hlmi-vs-faol-accordioncontent0" aria-expanded="false" aria-controls="hlmi-vs-faol-accordioncontent0">
        
<div>Full automation of labor (FAOL)</div>


      </button>
    </h2>
    <div id="hlmi-vs-faol-accordioncontent0" class="accordion-collapse collapse" aria-labelledby="heading0">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result_FAOL-400-309704ca2.webp 400w, /generated/_posts/../assets/images/espai/headline_result_FAOL-600-309704ca2.webp 600w, /generated/_posts/../assets/images/espai/headline_result_FAOL-800-309704ca2.webp 800w, /generated/_posts/../assets/images/espai/headline_result_FAOL-1000-309704ca2.webp 1000w, /generated/_posts/../assets/images/espai/headline_result_FAOL-1500-309704ca2.webp 1500w, /generated/_posts/../assets/images/espai/headline_result_FAOL-2000-309704ca2.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result_FAOL-400-309704ca2.jpeg 400w, /generated/_posts/../assets/images/espai/headline_result_FAOL-600-309704ca2.jpeg 600w, /generated/_posts/../assets/images/espai/headline_result_FAOL-800-309704ca2.jpeg 800w, /generated/_posts/../assets/images/espai/headline_result_FAOL-1000-309704ca2.jpeg 1000w, /generated/_posts/../assets/images/espai/headline_result_FAOL-1500-309704ca2.jpeg 1500w, /generated/_posts/../assets/images/espai/headline_result_FAOL-2000-309704ca2.jpeg 2000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/espai/headline_result_FAOL-800-309704ca2.png" width="2400" height="1800" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#hlmi-vs-faol-accordioncontent1" aria-expanded="false" aria-controls="hlmi-vs-faol-accordioncontent1">
        <div>High Level Machine Intelligence (HLMI)</div>


      </button>
    </h2>
    <div id="hlmi-vs-faol-accordioncontent1" class="accordion-collapse collapse" aria-labelledby="heading1">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result_HLMI-400-767c2d218.webp 400w, /generated/_posts/../assets/images/espai/headline_result_HLMI-600-767c2d218.webp 600w, /generated/_posts/../assets/images/espai/headline_result_HLMI-800-767c2d218.webp 800w, /generated/_posts/../assets/images/espai/headline_result_HLMI-1000-767c2d218.webp 1000w, /generated/_posts/../assets/images/espai/headline_result_HLMI-1500-767c2d218.webp 1500w, /generated/_posts/../assets/images/espai/headline_result_HLMI-2000-767c2d218.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/headline_result_HLMI-400-767c2d218.jpeg 400w, /generated/_posts/../assets/images/espai/headline_result_HLMI-600-767c2d218.jpeg 600w, /generated/_posts/../assets/images/espai/headline_result_HLMI-800-767c2d218.jpeg 800w, /generated/_posts/../assets/images/espai/headline_result_HLMI-1000-767c2d218.jpeg 1000w, /generated/_posts/../assets/images/espai/headline_result_HLMI-1500-767c2d218.jpeg 1500w, /generated/_posts/../assets/images/espai/headline_result_HLMI-2000-767c2d218.jpeg 2000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/espai/headline_result_HLMI-800-767c2d218.png" width="2400" height="1800" /></picture>


      </div>
    </div>
  </div>
  
    <div class="accordion-item">
    <h2 class="accordion-header" id="heading2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#hlmi-vs-faol-accordioncontent2" aria-expanded="false" aria-controls="hlmi-vs-faol-accordioncontent2">
        <div>Comparison of HLMI and FAOL</div>


      </button>
    </h2>
    <div id="hlmi-vs-faol-accordioncontent2" class="accordion-collapse collapse" aria-labelledby="heading2">
      <div class="accordion-body">
        
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_hlmi_faol-400-35afec9b7.webp 400w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-600-35afec9b7.webp 600w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-800-35afec9b7.webp 800w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1000-35afec9b7.webp 1000w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1500-35afec9b7.webp 1500w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1920-35afec9b7.webp 1920w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/compare_hlmi_faol-400-35afec9b7.jpeg 400w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-600-35afec9b7.jpeg 600w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-800-35afec9b7.jpeg 800w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1000-35afec9b7.jpeg 1000w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1500-35afec9b7.jpeg 1500w, /generated/_posts/../assets/images/espai/compare_hlmi_faol-1920-35afec9b7.jpeg 1920w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/espai/compare_hlmi_faol-800-35afec9b7.png" width="1920" height="1440" /></picture>


      </div>
    </div>
  </div>
  
</div>
  </div>

<p>Previous analyses never aggregated the task and occupation results, only presenting them separately. Recall that using their methodology<sup id="fnref:theirmeth" role="doc-noteref"><a href="#fn:theirmeth" class="footnote" rel="footnote">13</a></sup>, the authors reported the median year for all human tasks was 2047, while for occupations it was 2116 (a difference of 69 years!).</p>

<p>Presenting results separately allows for a deeper understanding for patient and sophisticated readers. However, we must be realistic: it is very likely that a single “headline” result will be most widely spread and remembered. Attempting to prevent this by <em>only</em> presenting HLMI (tasks) and FAOL (occupations) separately is largely futile, in my opinion. While it may sometimes encourage nuance, more often it will make it easier for readers to choose whichever of the two results best fits their preconceptions.</p>

<p>Indeed, my brief investigation suggests that citations of the 2023 survey results are strongly biased towards tasks (HLMI) over occupations (FAOL). Out of the 20 articles<sup id="fnref:articles-table" role="doc-noteref"><a href="#fn:articles-table" class="footnote" rel="footnote">14</a></sup> on the first two pages of Google Scholar citations of the 2024 preprint, 7 reported at least one of HLMI or FAOL. Among these</p>

<ul>
  <li>6 out of 7 (85%) reported tasks (HLMI) only</li>
  <li>1 out of 7 (15%) reported tasks and occupations</li>
  <li>None (0%) reported occupations (FAOL) only</li>
</ul>

<p>Therefore, I consider it preferable, when providing headline results, to aggregate accross HLMI and FAOL to provide a single estimate of when all tasks or occupations will be automatable.</p>

<p>I achieve this by simply including answers to both questions prior to aggregation, i.e. no special form of aggregation is used for aggregating tasks (HLMI) and occupations (FAOL). Since more respondents were asked about tasks than occupations, I achieve equal weight by resampling from the occupations (FAOL) responses.</p>

<h1 id="codebase">Codebase</h1>

<p>For this analysis, I wrote a fully new codebase, available at <strong><a href="https://github.com/tadamcz/espai">github.com/tadamcz/espai</a></strong>. This was necessary because system used for previous analyses relied on a collection of Jupyter notebooks that required manually running cells in a specific, undocumented order to achieve results.</p>

<p>This new codebase, written in Python, makes our analyses reproducible for the first time. The codebase includes a robust test suite.</p>

<p>We are open sourcing the codebase and invite scrutiny and contributions from other researchers. It provides user-friendly configuration objects that make it easy for you to run your own variations of the analysis and produce your own plots.</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:scope" role="doc-endnote">
      <p>Timing will be my sole focus. I ignore ESPAI’s questions about whether the overall impact of AI will be positive or negative, the preferred rate of progress, etc. <a href="#fnref:scope" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:language" role="doc-endnote">
      <p>This uses plain language as much as possible. Depending on your audience, you may wish to replace “central half” with “interquartile range”, or use phrases like “75th percentile”. Also, you can round 2048 to 2050 and 2103 to 2100 without losing anything of value. <a href="#fnref:language" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:whiskers" role="doc-endnote">
      <p>Note that the ‘whiskers’ of our box plot are slightly nonstandard: they show the 15th and 85th percentile responses. Whiskers are more commonly used to represent the 1.5 IQR value: from above the upper quartile (75th percentile), a distance of 1.5 times the interquartile range (IQR) is measured out and a whisker is drawn <em>up to</em> the largest observed data point from the dataset that falls within this distance. <a href="#fnref:whiskers" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:other_hlmi_faol_differences" role="doc-endnote">
      <p>As a further subtlety, “the question sets do differ beyond definitions: only the HLMI questions are preceded by the instruction to “assume that human scientific activity continues without major negative disruption,” and the FAOL block asks a sequence of questions about the automation of specific occupations before asking about full automation of labor” (<a href="https://arxiv.org/abs/2401.02843">Thousands of AI Authors on the Future of AI</a>) <a href="#fnref:other_hlmi_faol_differences" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:zero_one" role="doc-endnote">
      <p>In reality there are even more complications that I elide in the main text. If a set of probabilities contains both values of exactly 1, and values of exactly 0, the geometric mean of odds is undefined. If a one is present and there are no zeroes, the aggregate is one; and a zero is present and there are no ones, the aggregate is zero. However, floating point numbers by design have much more precision near zero than near one. For example, we can represent extremely small numbers like <code class="language-plaintext highlighter-rouge">1e-18</code>, but <code class="language-plaintext highlighter-rouge">1 - 1e-18</code> just gets represented as <code class="language-plaintext highlighter-rouge">1.0</code>. This means that very high probabilities get represented as 1 when equally extreme low probabilities do not get represented as zero. As a result, high probabilities get an “unfair advantage”. It should be possible to circumvent some of these problems by using alternative representations of the probabilities. However, many respondents directly give probabilities of 0% or 100% (as opposed to their fitted CDFs merely reaching these values). This poses a more fundamental problem for the geometric mean of odds. <a href="#fnref:zero_one" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:median-theorem" role="doc-endnote">
      <p>I believe this is probably a theorem (with the possible exception of some degenerate cases),  but I am not entirely sure since I have not attempted to actually write down or locate a proof. If you’ve got a proof or counter-example please contact me. <a href="#fnref:median-theorem" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:plot-fn" role="doc-endnote">

      <p>I give examples only for the fixed-probabilities framing in the main text because it’s easier to explain in the context of the loss functions we are using, which all use probabilities. However, we can see similar phenomena when looking at the fixed-years data. These are 9 plots representative of the bottom half of fixed-years Gamma fits. <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-400-e3ca9eefe.webp 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-600-e3ca9eefe.webp 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-800-e3ca9eefe.webp 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-1000-e3ca9eefe.webp 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-1500-e3ca9eefe.webp 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-2000-e3ca9eefe.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-400-e3ca9eefe.jpeg 400w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-600-e3ca9eefe.jpeg 600w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-800-e3ca9eefe.jpeg 800w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-1000-e3ca9eefe.jpeg 1000w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-1500-e3ca9eefe.jpeg 1500w, /generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-2000-e3ca9eefe.jpeg 2000w" type="image/jpeg" /><img alt="Gamma distribution fits to fixed years survey data, showing respondent points and Gamma CDFs." src="/generated/_posts/../assets/images/espai/9_prev_gamma_fits_Fixed_years_annotations_True-800-e3ca9eefe.png" width="2670" height="2768" /></picture>
 Since I am in this section aiming for expository clarity rather than the greatest rigour, I also elided the following complication in the main text. All distributions shown are Gammas fitted by previous authors, using the MSE of probabilities as the loss function. However, to produce the ranking of fits used to select which examples to plot, I used a different loss function. This was the MSE of years (horizontal direction) for the fixed-years plot, and the log loss for the fixed-probabilities plot. These loss functions make my examples more intuitive, while still being somewhat systematic (instead of cherry-picking examples). <a href="#fnref:plot-fn" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:kl-divergence" role="doc-endnote">

      <p>The log loss can be motivated by analogy to the Kullback-Leibler (KL) divergence between discrete distributions. For each point in a respondent’s CDF data, we can think of it as a binary probability distribution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>p</mi><mo separator="true">,</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(p, 1-p)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span></span></span></span>. The fitted CDF gives us another binary distribution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>q</mi><mo separator="true">,</mo><mn>1</mn><mo>−</mo><mi>q</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(q, 1-q)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span></span></span></span> at that point. The KL divergence between these distributions would be</p>

      <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>D</mi><mrow><mi>K</mi><mi>L</mi></mrow></msub><mo stretchy="false">(</mo><mi>p</mi><mi mathvariant="normal">∥</mi><mi>q</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>p</mi><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>p</mi><mi mathvariant="normal">/</mi><mi>q</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>q</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>p</mi><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>p</mi><mo stretchy="false">)</mo><mo>−</mo><mi>p</mi><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>q</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mo>−</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>q</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
D_{KL}(p\|q) &amp;= p \log(p/q) + (1-p)\log((1-p)/(1-q)) \\
&amp;= p\log(p) - p\log(q) + (1-p)\log(1-p) - (1-p)\log(1-q)
\end{align*}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3em;vertical-align:-1.25em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.75em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.07153em;">K</span><span class="mord mathnormal mtight">L</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.25em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.75em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">((</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mord">/</span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">))</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.25em;"><span></span></span></span></span></span></span></span></span></span></span></span>

      <p>The log loss <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mo stretchy="false">[</mo><mi>p</mi><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>q</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>q</mi><mo stretchy="false">)</mo><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">-[p\log(q) + (1-p)\log(1-q)]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mopen">[</span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mclose">)]</span></span></span></span> differs from this only by dropping the terms that don’t depend on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span>, and thus has the same minimum. However, this is merely an intuitive motivation: we are not actually comparing two discrete distributions, but rather measuring how well our continuous CDF matches specific points. <a href="#fnref:kl-divergence" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:gengamma" role="doc-endnote">
      <p>Note that although the generalised gamma distribution has three parameters, as far as I can tell it does not have the flexibility to fit three arbitrary points of CDF data. I came to this conclusion by extensive empirical investigation, but I haven’t been able to locate or write a proof to conclusively establish this one way or another. Please write to me if you know the answer. By the way, I don’t know of any parametric 3-parameter distribution that has this property. I used flexible distributions for ESPAI because they are the only solution I am aware of. <a href="#fnref:gengamma" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:gengamma:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a></p>
    </li>
    <li id="fn:os-impl" role="doc-endnote">
      <p>The code uses the paid MakeDistribution API, but a copy of all API responses needed to perform the analysis is stored in the repository. <a href="#fnref:os-impl" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:patterns-bias" role="doc-endnote">

      <p>I informally explored possible biases in the Gamma fits using the following histograms of residuals. While several of the residual distributions seem clearly biased, they also in most cases have 80% of the probability mass quite close to a residual of zero. I still do not fully understand why the effect of this data on aggregate CDFs is so muted, but I have not prioritised a more rigorous analysis.</p>
      <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-400-f5cb72cdc.webp 400w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-600-f5cb72cdc.webp 600w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-800-f5cb72cdc.webp 800w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-1000-f5cb72cdc.webp 1000w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-1500-f5cb72cdc.webp 1500w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-2000-f5cb72cdc.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-400-f5cb72cdc.jpeg 400w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-600-f5cb72cdc.jpeg 600w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-800-f5cb72cdc.jpeg 800w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-1000-f5cb72cdc.jpeg 1000w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-1500-f5cb72cdc.jpeg 1500w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-2000-f5cb72cdc.jpeg 2000w" type="image/jpeg" /><img alt="Histogram of residuals for Gamma fits in FAOL." src="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_FAOL-800-f5cb72cdc.png" width="4500" height="3000" /></picture>

      <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-400-45e5a09c1.webp 400w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-600-45e5a09c1.webp 600w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-800-45e5a09c1.webp 800w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-1000-45e5a09c1.webp 1000w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-1500-45e5a09c1.webp 1500w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-2000-45e5a09c1.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-400-45e5a09c1.jpeg 400w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-600-45e5a09c1.jpeg 600w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-800-45e5a09c1.jpeg 800w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-1000-45e5a09c1.jpeg 1000w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-1500-45e5a09c1.jpeg 1500w, /generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-2000-45e5a09c1.jpeg 2000w" type="image/jpeg" /><img alt="Histogram of residuals for Gamma fits in HLMI." src="/generated/_posts/../assets/images/espai/prev_fits_bias_hist_HLMI-800-45e5a09c1.png" width="4500" height="3000" /></picture>
      <p><a href="#fnref:patterns-bias" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:disagreement_vs_framing" role="doc-endnote">

      <p>Due to the large framing effects of both tasks vs occupations, and fixed-years vs fixed-probabilities, which have been consistently observed, one may reasonably quarrel with describing this plot as showing “disagreement among respondents” or “the range of opinion among experts”. Part of why the range is so wide is that responses are highly sensitive to framing. Rather than saying experts <em>disagree</em> per se, purists might wish to say that expert opinion is undefined or unstable.</p>

      <p>This is a rather philosophical point. The more practical version of it is to ask whether we should aggregate accross these framings, or just present them separately.</p>

      <p>My position (further discussed <a href="#aggregating-hlmi-faol">here</a>) is that while disaggregated results should also be available, aggregation is necessary to produce useful results. Aggregating things that have some commonalities and some differences is indeed inherent to science. While previous authors presented HLMI and FAOL separately, they did not present fixed-years and fixed-probabilities separately, which would be required if we take the anti-aggregation argument to its full conclusion. <a href="#fnref:disagreement_vs_framing" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:theirmeth" role="doc-endnote">
      <p>Their methodology is different from what I used in the plots above, but yields very similar results for the median year. <a href="#fnref:theirmeth" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:articles-table" role="doc-endnote">
      <p>Here is the full table:</p>

      <table>
        <thead>
          <tr>
            <th>Title</th>
            <th>Year</th>
            <th>Link</th>
            <th>Citation</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Artificial intelligence: Arguments for catastrophic risk</td>
            <td>2024</td>
            <td><a href="https://compass.onlinelibrary.wiley.com/doi/abs/10.1111/phc3.12964">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>Safety cases for frontier AI</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2410.21572">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Me, myself and AI: How gender, personality and emotions determine willingness to use Strong AI for self-improvement</td>
            <td>2024</td>
            <td><a href="https://www.sciencedirect.com/science/article/pii/S0040162524005584">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>Theory Is All You Need: AI, Human Cognition, and Causal Reasoning</td>
            <td>2024</td>
            <td><a href="https://www.bu.edu/dbi/files/2024/08/FelinHolwegAug2024_SSRN.pdf">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Shared Awareness Across Domain‐Specific Artificial Intelligence</td>
            <td>2024</td>
            <td><a href="https://onlinelibrary.wiley.com/doi/abs/10.1002/aisy.202300740">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Existential risk from transformative AI: an economic perspective</td>
            <td>2024</td>
            <td><a href="https://journals.vilniustech.lt/index.php/TEDE/article/view/21525">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>Theory is all you need: AI, human cognition, and decision making</td>
            <td>2024</td>
            <td><a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4737265">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Generative artificial intelligence usage by researchers at work</td>
            <td>2024</td>
            <td><a href="https://www.sciencedirect.com/science/article/pii/S0736585324000911">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>AI Horizon Scanning, White Paper p3395, IEEE-SA. Part I: Areas of Attention</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2410.01808">Link</a></td>
            <td>Two tasks (build a payment processing site, fine-tune an LLM)</td>
          </tr>
          <tr>
            <td>Generative AI, Ingenuity, and Law</td>
            <td>2024</td>
            <td><a href="https://ieeexplore.ieee.org/abstract/document/10598190/">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>AI Emergency Preparedness: Examining the federal government’s ability to detect and respond to AI-related national security threats</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2407.17347">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Transformative AI, existential risk, and real interest rates</td>
            <td>2024</td>
            <td><a href="https://basilhalperin.com/papers/agi_emh.pdf">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>Misrepresented Technological Solutions in Imagined Futures: The Origins and Dangers of AI Hype in the Research Community</td>
            <td>2024</td>
            <td><a href="https://ojs.aaai.org/index.php/AIES/article/view/31737">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Eliciting the Priors of Large Language Models using Iterated In-Context Learning</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2406.01860">Link</a></td>
            <td>HLMI only</td>
          </tr>
          <tr>
            <td>Strategic Insights from Simulation Gaming of AI Race Dynamics</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2410.03092">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Evolutionary debunking and value alignment</td>
            <td>2024</td>
            <td><a href="https://globalprioritiesinstitute.org/wp-content/uploads/Michael-T.-Dale-and-Bradford-Saad-Evolutionary-debunking-and-value-alignment.pdf">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Robust Technology Regulation</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2408.17398">Link</a></td>
            <td>Extinction risk only</td>
          </tr>
          <tr>
            <td>Interpreting Affine Recurrence Learning in GPT-style Transformers</td>
            <td>2024</td>
            <td><a href="https://arxiv.org/abs/2410.17438">Link</a></td>
            <td>No numbers</td>
          </tr>
          <tr>
            <td>Malicious use of AI and challenges to psychological security: Future risks</td>
            <td>2024</td>
            <td><a href="https://russiancouncil.ru/en/analytics-and-comments/analytics/malicious-use-of-ai-and-challenges-to-psychological-security-future-risks/">Link</a></td>
            <td>HLMI and FAOL</td>
          </tr>
          <tr>
            <td>Grow Your Artificial Intelligence Competence</td>
            <td>2024</td>
            <td><a href="https://ieeexplore.ieee.org/abstract/document/10685842/">Link</a></td>
            <td>No numbers</td>
          </tr>
        </tbody>
      </table>
      <p><a href="#fnref:articles-table" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><summary type="html"><![CDATA[This report examines how to interpret AI timeline forecasts from AI experts. I consider how distribution fitting and aggregation methods influence results, and provide recommendations for how survey results should be analysed and presented in the future.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/espai/metatag.png" /><media:content medium="image" url="https://bayes.net/assets/images/espai/metatag.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Elevated computing</title><link href="https://bayes.net/elevated-computing/" rel="alternate" type="text/html" title="Elevated computing" /><published>2023-08-03T00:00:00+00:00</published><updated>2023-08-03T00:00:00+00:00</updated><id>https://bayes.net/elevated-computing</id><content type="html" xml:base="https://bayes.net/elevated-computing/"><![CDATA[<p>I made a mount to lift my laptop off the surface of my desk:</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div id="mount-carousel" class="carousel carousel-dark slide">
    <div class="carousel-indicators">
      
        <button type="button" data-bs-target="#mount-carousel" data-bs-slide-to="0" class=" active"></button>
      
        <button type="button" data-bs-target="#mount-carousel" data-bs-slide-to="1" class=""></button>
      
        <button type="button" data-bs-target="#mount-carousel" data-bs-slide-to="2" class=""></button>
      
        <button type="button" data-bs-target="#mount-carousel" data-bs-slide-to="3" class=""></button>
      
        <button type="button" data-bs-target="#mount-carousel" data-bs-slide-to="4" class=""></button>
      
    </div>
    <div class="carousel-inner">
      
        <div class="carousel-item  active" style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3308-400-dcd5a0ce9.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-600-dcd5a0ce9.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-800-dcd5a0ce9.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-1000-dcd5a0ce9.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-1500-dcd5a0ce9.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-2000-dcd5a0ce9.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3308-400-dcd5a0ce9.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-600-dcd5a0ce9.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-800-dcd5a0ce9.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-1000-dcd5a0ce9.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-1500-dcd5a0ce9.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3308-2000-dcd5a0ce9.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3308" src="/generated/_posts/../assets/images/laptop-mount/IMG_3308-800-dcd5a0ce9.jpg" width="4032" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3316-400-edeb48d16.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-600-edeb48d16.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-800-edeb48d16.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-1000-edeb48d16.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-1500-edeb48d16.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-2000-edeb48d16.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3316-400-edeb48d16.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-600-edeb48d16.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-800-edeb48d16.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-1000-edeb48d16.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-1500-edeb48d16.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3316-2000-edeb48d16.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3315" src="/generated/_posts/../assets/images/laptop-mount/IMG_3316-800-edeb48d16.jpg" width="4032" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3312-400-bcdbc5f08.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-600-bcdbc5f08.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-800-bcdbc5f08.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-1000-bcdbc5f08.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-1500-bcdbc5f08.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-2000-bcdbc5f08.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3312-400-bcdbc5f08.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-600-bcdbc5f08.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-800-bcdbc5f08.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-1000-bcdbc5f08.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-1500-bcdbc5f08.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3312-2000-bcdbc5f08.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3312" src="/generated/_posts/../assets/images/laptop-mount/IMG_3312-800-bcdbc5f08.jpg" width="4032" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3331-400-801364899.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-600-801364899.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-800-801364899.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-1000-801364899.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-1500-801364899.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-2000-801364899.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3331-400-801364899.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-600-801364899.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-800-801364899.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-1000-801364899.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-1500-801364899.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3331-2000-801364899.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3331" src="/generated/_posts/../assets/images/laptop-mount/IMG_3331-800-801364899.jpg" width="3024" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_0116-400-20f3a1ee0.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-600-20f3a1ee0.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-800-20f3a1ee0.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-1000-20f3a1ee0.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-1500-20f3a1ee0.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-2000-20f3a1ee0.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_0116-400-20f3a1ee0.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-600-20f3a1ee0.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-800-20f3a1ee0.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-1000-20f3a1ee0.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-1500-20f3a1ee0.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_0116-2000-20f3a1ee0.jpeg 2000w" type="image/jpeg" /><img alt="IMG_0116.HEIC" src="/generated/_posts/../assets/images/laptop-mount/IMG_0116-800-20f3a1ee0.jpg" width="4032" height="3024" /></picture>

        </div>
      
    </div>
    <button class="carousel-control-prev btn-danger" type="button" data-bs-target="#mount-carousel" data-bs-slide="prev">
      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Previous</span>
    </button>
    <button class="carousel-control-next" type="button" data-bs-target="#mount-carousel" data-bs-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Next</span>
    </button>
  </div>
</div>

<style>
  .carousel-item {
    aspect-ratio: 1/1;
  }
  .carousel-item picture img {
    position: absolute;
    min-height: 100%;
    min-width: 100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
</style>

<p>I operate my laptop with its lid closed, using only an external monitor. The downside is that the closed laptop is a useless rectangle that takes up a lot of precious desk space. This type of product would have solved 80% of the problem:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-400-58b35e685.webp 400w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-600-58b35e685.webp 600w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-800-58b35e685.webp 800w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-1000-58b35e685.webp 1000w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-1500-58b35e685.webp 1500w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-400-58b35e685.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-600-58b35e685.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-800-58b35e685.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-1000-58b35e685.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-1500-58b35e685.jpeg 1500w" type="image/jpeg" /><img alt="best-vertical-laptop-stand-macbook.jpg" src="/generated/_posts/../assets/images/laptop-mount/best-vertical-laptop-stand-macbook-800-58b35e685.jpg" width="1500" height="1000" /></picture>

<p>However, even <em>more</em> space could be saved by removing the laptop from the desk entirely. A pole or stand of some sort is already needed anyway to hold up the monitor, so why not use it to hold the laptop as well?</p>

<p>My solution consists of two repurposed commercially available products, along with a piece of 6mm birch plywood to hold them together.</p>

<p>Attached to the monitor pole, we have a VESA mount that can tilt and swivel. Instead of holding a monitor, it’s holding the wooden plank.</p>

<p class="small-img"><a href="https://www.google.com/search?q=AV+Link+PMB100+35mm+Pole+Mount+Bracket+For+TV+%26+Monitor+Screens,+Black"><picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/vesa-400-d1fa7988d.webp 400w, /generated/_posts/../assets/images/laptop-mount/vesa-600-d1fa7988d.webp 600w, /generated/_posts/../assets/images/laptop-mount/vesa-679-d1fa7988d.webp 679w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/vesa-400-d1fa7988d.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/vesa-600-d1fa7988d.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/vesa-679-d1fa7988d.jpeg 679w" type="image/jpeg" /><img alt="vesa" src="/generated/_posts/../assets/images/laptop-mount/vesa-679-d1fa7988d.jpg" width="679" height="642" /></picture>
</a></p>

<p>On the other side of the plank, we have 4 pieces of metal sold as an under-desk laptop mount:</p>

<p class="small-img"><a href="https://www.google.com/search?q=JEMACHE+Under+Desk+Laptop+Mount,+Metal+Under+Table+Desk+Holder+for+Laptop,+Mac+Mini,+MacBook,+Keyboard+with+Anti-Scratch+Silicone+(Black)"><picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/under-desk-400-1f2c0a253.webp 400w, /generated/_posts/../assets/images/laptop-mount/under-desk-600-1f2c0a253.webp 600w, /generated/_posts/../assets/images/laptop-mount/under-desk-679-1f2c0a253.webp 679w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/under-desk-400-1f2c0a253.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/under-desk-600-1f2c0a253.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/under-desk-679-1f2c0a253.jpeg 679w" type="image/jpeg" /><img alt="under-desk" src="/generated/_posts/../assets/images/laptop-mount/under-desk-679-1f2c0a253.jpg" width="679" height="574" /></picture>
</a></p>

<h1 id="details">Details</h1>

<p>To keep the setup compact, we want the pole-to-VESA piece to be as short as possible. There are zillions of pole-mounted VESA monitor arms to choose from, but finding something <em>without</em> the arm was a bit more difficult.</p>

<p>All inputs were sourced from the internet:</p>

<ul>
  <li>I ordered the wood cut to measure from <code class="language-plaintext highlighter-rouge">woodsheets.com</code> , which cost £8.60 including shipping.</li>
  <li>The pole mount was <a href="https://www.google.com/search?q=AV+Link+PMB100+35mm+Pole+Mount+Bracket+For+TV+%26+Monitor+Screens,+Black">£13.77 from Amazon</a></li>
  <li>The under-desk mounting solution was <a href="https://www.google.com/search?q=JEMACHE+Under+Desk+Laptop+Mount,+Metal+Under+Table+Desk+Holder+for+Laptop,+Mac+Mini,+MacBook,+Keyboard+with+Anti-Scratch+Silicone+(Black)">£16.99 from Amazon</a></li>
</ul>

<p>I used linseed oil to give the wood a nicer finish; this is of course optional but the aesthetic improvement is significant.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/varnish-before-400-f8948a73c.webp 400w, /generated/_posts/../assets/images/laptop-mount/varnish-before-600-f8948a73c.webp 600w, /generated/_posts/../assets/images/laptop-mount/varnish-before-800-f8948a73c.webp 800w, /generated/_posts/../assets/images/laptop-mount/varnish-before-1000-f8948a73c.webp 1000w, /generated/_posts/../assets/images/laptop-mount/varnish-before-1500-f8948a73c.webp 1500w, /generated/_posts/../assets/images/laptop-mount/varnish-before-2000-f8948a73c.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/varnish-before-400-f8948a73c.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/varnish-before-600-f8948a73c.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/varnish-before-800-f8948a73c.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/varnish-before-1000-f8948a73c.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/varnish-before-1500-f8948a73c.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/varnish-before-2000-f8948a73c.jpeg 2000w" type="image/jpeg" /><img alt="varnish-before.JPG" src="/generated/_posts/../assets/images/laptop-mount/varnish-before-800-f8948a73c.jpg" width="3024" height="3024" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/varnish-after-400-801364899.webp 400w, /generated/_posts/../assets/images/laptop-mount/varnish-after-600-801364899.webp 600w, /generated/_posts/../assets/images/laptop-mount/varnish-after-800-801364899.webp 800w, /generated/_posts/../assets/images/laptop-mount/varnish-after-1000-801364899.webp 1000w, /generated/_posts/../assets/images/laptop-mount/varnish-after-1500-801364899.webp 1500w, /generated/_posts/../assets/images/laptop-mount/varnish-after-2000-801364899.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/varnish-after-400-801364899.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/varnish-after-600-801364899.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/varnish-after-800-801364899.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/varnish-after-1000-801364899.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/varnish-after-1500-801364899.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/varnish-after-2000-801364899.jpeg 2000w" type="image/jpeg" /><img alt="varnish-after.JPG" src="/generated/_posts/../assets/images/laptop-mount/varnish-after-800-801364899.jpg" width="3024" height="3024" /></picture>

</div>

<p>The “under-desk” bits come with little silicon-ish pads to avoid scratching the laptop. Similarly, I put plastic caps on the screw heads on the laptop side:</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3120-400-037dc0f4d.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-600-037dc0f4d.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-800-037dc0f4d.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-1000-037dc0f4d.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-1500-037dc0f4d.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-2000-037dc0f4d.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3120-400-037dc0f4d.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-600-037dc0f4d.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-800-037dc0f4d.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-1000-037dc0f4d.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-1500-037dc0f4d.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3120-2000-037dc0f4d.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3120" src="/generated/_posts/../assets/images/laptop-mount/IMG_3120-800-037dc0f4d.jpg" width="3024" height="3024" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3119-400-437561f48.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-600-437561f48.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-800-437561f48.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-1000-437561f48.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-1500-437561f48.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-2000-437561f48.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3119-400-437561f48.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-600-437561f48.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-800-437561f48.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-1000-437561f48.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-1500-437561f48.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3119-2000-437561f48.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3119" src="/generated/_posts/../assets/images/laptop-mount/IMG_3119-800-437561f48.jpg" width="3024" height="3024" /></picture>

</div>

<p>Had I realised these would be needed, I would probably have chosen to use glue instead of screws to attach the wood to the VESA mount.</p>

<p>After completing this project, I also mounted a 3.5 inch external hard drive enclosure in a similar way. I glued it directly to the VESA mount. Arbitrary objects could be thus held aloft. The scope of this innovation has no limits currently known to science.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3329-400-a445189b1.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-600-a445189b1.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-800-a445189b1.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-1000-a445189b1.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-1500-a445189b1.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-2000-a445189b1.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3329-400-a445189b1.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-600-a445189b1.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-800-a445189b1.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-1000-a445189b1.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-1500-a445189b1.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3329-2000-a445189b1.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3329" src="/generated/_posts/../assets/images/laptop-mount/IMG_3329-800-a445189b1.jpg" width="4032" height="3024" /></picture>

<p>As I have two poles, I put the hard drive on the other pole, but it would have comfortably fit on the first pole.</p>

<h1 id="previous-versions-of-this-idea">Previous versions of this idea</h1>

<p>For my previous attempt, I hand-sawed a piece of scrap wood from a previous project. This looked tolerable, but for £8.60 it was worth having another piece cut to size:</p>

<picture class="small-img"><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3118-400-8a8d94b21.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-600-8a8d94b21.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-800-8a8d94b21.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-1000-8a8d94b21.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-1500-8a8d94b21.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-2000-8a8d94b21.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_3118-400-8a8d94b21.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-600-8a8d94b21.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-800-8a8d94b21.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-1000-8a8d94b21.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-1500-8a8d94b21.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_3118-2000-8a8d94b21.jpeg 2000w" type="image/jpeg" /><img alt="IMG_3118" src="/generated/_posts/../assets/images/laptop-mount/IMG_3118-800-8a8d94b21.jpg" width="4032" height="3024" /></picture>

<p>My initial idea was to use a VESA mount and a cheap laptop sleeve. I used this for several months:</p>

<div class="bootstrap-styles bootstrap-reboot">
  <div id="sleeve-carousel" class="carousel carousel-dark slide">
    <div class="carousel-indicators">
      
        <button type="button" data-bs-target="#sleeve-carousel" data-bs-slide-to="0" class=" active"></button>
      
        <button type="button" data-bs-target="#sleeve-carousel" data-bs-slide-to="1" class=""></button>
      
        <button type="button" data-bs-target="#sleeve-carousel" data-bs-slide-to="2" class=""></button>
      
    </div>
    <div class="carousel-inner">
      
        <div class="carousel-item  active" style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1589-400-e3b294717.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-600-e3b294717.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-800-e3b294717.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-1000-e3b294717.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-1500-e3b294717.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-2000-e3b294717.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1589-400-e3b294717.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-600-e3b294717.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-800-e3b294717.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-1000-e3b294717.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-1500-e3b294717.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1589-2000-e3b294717.jpeg 2000w" type="image/jpeg" /><img alt="IMG_1589.JPG" src="/generated/_posts/../assets/images/laptop-mount/IMG_1589-800-e3b294717.jpg" width="4032" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1590-400-fd01ccfcc.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-600-fd01ccfcc.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-800-fd01ccfcc.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-1000-fd01ccfcc.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-1500-fd01ccfcc.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-2000-fd01ccfcc.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1590-400-fd01ccfcc.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-600-fd01ccfcc.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-800-fd01ccfcc.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-1000-fd01ccfcc.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-1500-fd01ccfcc.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1590-2000-fd01ccfcc.jpeg 2000w" type="image/jpeg" /><img alt="IMG_1590" src="/generated/_posts/../assets/images/laptop-mount/IMG_1590-800-fd01ccfcc.jpg" width="4032" height="3024" /></picture>

        </div>
      
        <div class="carousel-item " style="object-fit: contain">
          <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1862-400-d4faf383e.webp 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-600-d4faf383e.webp 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-800-d4faf383e.webp 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-1000-d4faf383e.webp 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-1500-d4faf383e.webp 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-2000-d4faf383e.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/laptop-mount/IMG_1862-400-d4faf383e.jpeg 400w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-600-d4faf383e.jpeg 600w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-800-d4faf383e.jpeg 800w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-1000-d4faf383e.jpeg 1000w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-1500-d4faf383e.jpeg 1500w, /generated/_posts/../assets/images/laptop-mount/IMG_1862-2000-d4faf383e.jpeg 2000w" type="image/jpeg" /><img alt="IMG_1862" src="/generated/_posts/../assets/images/laptop-mount/IMG_1862-800-d4faf383e.jpg" width="4032" height="3024" /></picture>

        </div>
      
    </div>
    <button class="carousel-control-prev btn-danger" type="button" data-bs-target="#sleeve-carousel" data-bs-slide="prev">
      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Previous</span>
    </button>
    <button class="carousel-control-next" type="button" data-bs-target="#sleeve-carousel" data-bs-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Next</span>
    </button>
  </div>
</div>

<style>
  .carousel-item {
    aspect-ratio: 1/1;
  }
  .carousel-item picture img {
    position: absolute;
    min-height: 100%;
    min-width: 100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
</style>

<p>However, inserting and removing the laptop was rather inconvenient because the sleeve lacks rigidity. With the wood-based solution, it’s a simple one-handed process. The sleeve also has worse heat dissipation, despite the addition of aeration holes.</p>]]></content><author><name></name></author><category term="DIY" /><category term="how to" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/laptop-mount/meta-tag.JPG" /><media:content medium="image" url="https://bayes.net/assets/images/laptop-mount/meta-tag.JPG" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to run Cronicle (a cron replacement) in a Docker container</title><link href="https://bayes.net/cronicle/" rel="alternate" type="text/html" title="How to run Cronicle (a cron replacement) in a Docker container" /><published>2022-05-07T00:00:00+00:00</published><updated>2022-05-07T00:00:00+00:00</updated><id>https://bayes.net/cronicle</id><content type="html" xml:base="https://bayes.net/cronicle/"><![CDATA[<p>I really don’t like cron jobs and crontab:</p>
<ul>
  <li>crontab has a horrible syntax (it’s <a href="https://en.wikipedia.org/wiki/Cron">from 1975</a>…)</li>
  <li>logging the output of jobs needs to be specified manually</li>
  <li>viewing logs is inconvenient (even just for checking whether a job ran or not!)</li>
  <li>cron jobs run in a minimal environment that’s inconvenient to modify</li>
</ul>

<p><a href="https://github.com/jhuckaby/Cronicle">Cronicle</a> is a friendlier alternative (“a task scheduler with a web based front-end UI”).</p>

<p><strong>Very important</strong>: the default username/password for the web interface is <code class="language-plaintext highlighter-rouge">admin</code>/<code class="language-plaintext highlighter-rouge">admin</code>. This could let anyone run arbitrary shell commands on your server! Change the password immediately after setting up.</p>

<p>Here’s how to run Cronicle Dockerized.</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">-d</span> <span class="se">\</span>
  <span class="nt">-v</span> /cronicle-data/data:/opt/cronicle/data:rw <span class="se">\</span>
  <span class="nt">-v</span> /cronicle-data/logs:/opt/cronicle/logs:rw <span class="se">\</span>
  <span class="nt">-v</span> /cronicle-data/plugins:/opt/cronicle/plugins:rw <span class="se">\</span>
  <span class="nt">-v</span> /cronicle-data/app:/app:rw <span class="se">\</span>
  <span class="nt">--hostname</span> your_hostname.com <span class="nt">-p</span> 11531:3012 <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">CRONICLE_base_app_url</span><span class="o">=</span><span class="s1">'http://your_hostname.com:11531'</span> <span class="se">\</span>
  <span class="nt">--name</span> cronicle <span class="se">\</span>
  bluet/cronicle-docker:latest
</code></pre></div></div>

<p>You can now point <code class="language-plaintext highlighter-rouge">http://your_hostname.com</code> to the correct IP address and visit <code class="language-plaintext highlighter-rouge">http://your_hostname.com:11531</code> in your browser to access a web interface for Cronicle.</p>

<p>Comments:</p>
<ul>
  <li>11531 is a port number chosen randomly. You should generally use 80, the default port used by web browsers; for me that port is occupied by other applications I run on the host web server.</li>
  <li>The source for the Docker image <code class="language-plaintext highlighter-rouge">bluet/cronicle-docker</code> is <a href="https://github.com/bluet/docker-cronicle-docker">here</a>.</li>
  <li>On 7 May 2022, I confirmed that these steps work on brand new server, with revision <a href="https://github.com/bluet/docker-cronicle-docker/tree/3e4211e8902bcd17c6192f6ed1f2a8f3cf0e24ba"><code class="language-plaintext highlighter-rouge">3e4211e</code></a> of <code class="language-plaintext highlighter-rouge">bluet/cronicle-docker</code>.</li>
</ul>]]></content><author><name></name></author><category term="software" /><category term="docker" /><category term="how to" /><summary type="html"><![CDATA[I really don’t like cron jobs and crontab: crontab has a horrible syntax (it’s from 1975…) logging the output of jobs needs to be specified manually viewing logs is inconvenient (even just for checking whether a job ran or not!) cron jobs run in a minimal environment that’s inconvenient to modify]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/cronicle.png" /><media:content medium="image" url="https://bayes.net/assets/images/cronicle.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How much of the fall in fertility could be explained by lower mortality?</title><link href="https://bayes.net/fertility-mortality/" rel="alternate" type="text/html" title="How much of the fall in fertility could be explained by lower mortality?" /><published>2021-08-05T00:00:00+00:00</published><updated>2021-08-05T00:00:00+00:00</updated><id>https://bayes.net/fertility-mortality</id><content type="html" xml:base="https://bayes.net/fertility-mortality/"><![CDATA[<p><a href="https://ourworldindata.org/child-mortality#when-more-infants-survive-fertility-goes-down"><picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-400-d852f09da.webp 400w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-600-d852f09da.webp 600w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-800-d852f09da.webp 800w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-1000-d852f09da.webp 1000w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-1500-d852f09da.webp 1500w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-2000-d852f09da.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-400-d852f09da.jpeg 400w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-600-d852f09da.jpeg 600w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-800-d852f09da.jpeg 800w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-1000-d852f09da.jpeg 1000w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-1500-d852f09da.jpeg 1500w, /generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-2000-d852f09da.jpeg 2000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/ourworldindata_scatter-fertility-vs-infant-survival-800-d852f09da.png" width="3000" height="2142" /></picture>
</a></p>

<p>Many people think that lower child mortality causes fertility to decline.</p>

<p>One prominent theory for this relationship, as described by <a href="https://ourworldindata.org/child-mortality#when-more-infants-survive-fertility-goes-down">Our World in Data</a><sup id="fnref:quote-context" role="doc-noteref"><a href="#fn:quote-context" class="footnote" rel="footnote">1</a></sup>, is that “infant survival reduces the parents’ demand for children”<sup id="fnref:aside-1" role="doc-noteref"><a href="#fn:aside-1" class="footnote" rel="footnote">2</a></sup>. (Infants are children under 1 years old).</p>

<p>In this article, I want to look at how we can precisify that theory, and what magnitude the effect could possibly take. What fraction of the decline in birth rates could the theory explain?</p>

<p><strong>Important.</strong> I don’t want to make claims here about how parents <em>actually</em> make fertility choices. I only want to examine the implications of various models, and specifically how much of the observed changes in fertility the models could explain.</p>

<h2 id="constant-number-of-children">Constant number of children</h2>
<p>One natural interpretation of “increasing infant survival reduces the parents’ demand for children” is that parents are adjusting the number of births to keep the number of surviving children constant.</p>

<p>Looking at Our World in Data’s graph, we can see that in most of the countries depicted, the infant survival rate went from about 80% to essentially 100%. This is a factor of 1.25. Meanwhile, there were 1/3 as many births. If parents were adjusting the number of births to keep the number of surviving children constant, the decline in infant mortality would explain a change in births by a factor of 1/1.25=0.8, a -0.2 change that is only <strong>30%</strong> of the -2/3 change in births.</p>

<p>The basic mathematical reason this happens is that even when mortality is tragically high, the survival rate is still thankfully much closer to 1 than to 0, so even a very large proportional fall in mortality will only amount to a small proportional increase in survival.</p>

<p>Some children survive infancy but die later in childhood. Although Our World in Data’s quote focuses on infant mortality, it makes sense to consider older children too. I’ll look at under-5 mortality, which generally has better data than older age groups, and also captures a large fraction of all child mortality<sup id="fnref:over-5-data" role="doc-noteref"><a href="#fn:over-5-data" class="footnote" rel="footnote">3</a></sup>.</p>

<h3 id="england-1861-1951">England (1861-1951)</h3>
<p>England is a country with an early demographic transition and good data available.</p>

<p><a href="https://link.springer.com/content/pdf/10.1007/s00148-004-0208-z.pdf">Doepke 2005</a> quotes the following numbers:</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th>1861</th>
      <th>1951</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Infant mortality</td>
      <td>16%</td>
      <td>3%</td>
    </tr>
    <tr>
      <td>1-5yo mortality</td>
      <td>13%</td>
      <td>0.5%</td>
    </tr>
    <tr>
      <td>0-5 yo mortality</td>
      <td>27%</td>
      <td>3.5%</td>
    </tr>
    <tr>
      <td><strong>Survival to 5 years</strong></td>
      <td><strong>73%</strong></td>
      <td><strong>96.5%</strong></td>
    </tr>
  </tbody>
  <tbody>
    <tr>
      <td>Fertility</td>
      <td>4.9</td>
      <td>2.1</td>
    </tr>
  </tbody>
</table>

<p>Fertility fell by 57%, while survival to 5 years rose by 32%. Hence, if parents aim to keep the number of surviving children constant, the change in child survival can <a href="https://docs.google.com/spreadsheets/d/1vsQLOVcay-nYTfEZFVST4yO3NiETo2EoafF5PybGBd4/edit#gid=0&amp;range=D45">explain <strong>43%</strong></a><sup id="fnref:file" role="doc-noteref"><a href="#fn:file" class="footnote" rel="footnote">4</a></sup> of the actual fall in fertility. (It would have explained only 23% had we erroneously considered only the change in infant survival.)</p>

<h3 id="sub-saharan-africa-1990-2017">Sub-Saharan Africa (1990-2017)</h3>
<p>If we look now at sub-Saharan Africa data from the World Bank, the 1990-2017 change in fertility is from 6.3 to 4.8, a 25% decrease, whereas the 5-year survival rate went from 0.82 to 0.92, a 12% increase. So the fraction of the actual change in fertility that could be explained by the survival rate is <strong>44%</strong>. (This would have been 23% had we looked only at infant survival).</p>

<p><img src="../assets/images/fertility.svg" alt="" />
<em><a href="https://docs.google.com/spreadsheets/d/1vsQLOVcay-nYTfEZFVST4yO3NiETo2EoafF5PybGBd4/edit#gid=0">Source data and calculations</a></em></p>

<p>So far, we have seen that this very simple theory of parental decision-making can explain 30-44% of the decline in fertility, while also noticing that considering childhood mortality beyond infancy was important to giving the theory its full due.</p>

<p>However, in more sophisticated models of fertility choices, the theory looks worse.</p>

<h2 id="a-more-sophisticated-model-of-fertility-decisions">A more sophisticated model of fertility decisions</h2>
<p>Let us imagine that instead of holding it constant, parents treat the number of surviving children as one good among many in an optimization problem.</p>

<p>An increase in the child survival rate can be seen as a decrease in the cost of surviving children. Parents will then substitute away from other goods and increase their target number of surviving children. If your child is less likely to die as an infant, you may decide to aim to have <em>more</em> children: the risk of experiencing the loss of a child is lower.<sup id="fnref:aside-99" role="doc-noteref"><a href="#fn:aside-99" class="footnote" rel="footnote">5</a></sup></p>

<p>For a more formal analysis, we can turn to the <a href="https://www.jstor.org/stable/pdf/1912563.pdf">Barro and Becker (1989)</a> model of fertility. I’ll be giving a simplified version of the presentation in <a href="https://link.springer.com/content/pdf/10.1007/s00148-004-0208-z.pdf">Doepke 2005</a>.</p>

<p>In this model, parents care about their own consumption as well as their number of surviving children. The parents maximise<sup id="fnref:uf" role="doc-noteref"><a href="#fn:uf" class="footnote" rel="footnote">6</a></sup></p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>U</mi><mo stretchy="false">(</mo><mi>c</mi><mo separator="true">,</mo><mi>n</mi><mo stretchy="false">)</mo><mo>=</mo><mi>u</mi><mo stretchy="false">(</mo><mi>c</mi><mo stretchy="false">)</mo><mo>+</mo><msup><mi>n</mi><mi>ϵ</mi></msup><mi>V</mi></mrow><annotation encoding="application/x-tex">U(c,n) = u(c) + n^\epsilon V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="mopen">(</span><span class="mord mathnormal">c</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">n</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">u</span><span class="mopen">(</span><span class="mord mathnormal">c</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7144em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7144em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">ϵ</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span></span>

<p>where</p>

<ul>
  <li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> is the number of surviving children and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span> is the value of a surviving child</li>
  <li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ϵ</mi></mrow><annotation encoding="application/x-tex">\epsilon</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">ϵ</span></span></span></span>  is a constant <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∈</mo><mo stretchy="false">(</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\in (0,1)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mclose">)</span></span></span></span></li>
  <li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo stretchy="false">(</mo><mi>c</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">u(c)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">u</span><span class="mopen">(</span><span class="mord mathnormal">c</span><span class="mclose">)</span></span></span></span> is the part of utility that depends on consumption<sup id="fnref:uc" role="doc-noteref"><a href="#fn:uc" class="footnote" rel="footnote">7</a></sup></li>
</ul>

<p>The income of a parent is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span></span></span></span>, and there is a cost per birth of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> and an additional cost of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span> per surviving child<sup id="fnref:aside-2" role="doc-noteref"><a href="#fn:aside-2" class="footnote" rel="footnote">8</a></sup>. The parents choose <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>, the number of births. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span> is the probability of survival of a child, so that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi>s</mi><mi>b</mi></mrow><annotation encoding="application/x-tex">n=sb</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">b</span></span></span></span>.</p>

<p>Consumption is therefore <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi><mo>=</mo><mi>w</mi><mo>−</mo><mo stretchy="false">(</mo><mi>p</mi><mo>+</mo><mi>q</mi><mi>s</mi><mo stretchy="false">)</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">c=w-(p+qs)b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">c</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mord mathnormal">b</span></span></span></span> and the problem becomes
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>b</mi></msub><mi>U</mi><mo>=</mo><mi>u</mi><mo stretchy="false">(</mo><mi>w</mi><mo>−</mo><mo stretchy="false">(</mo><mi>p</mi><mo>+</mo><mi>q</mi><mi>s</mi><mo stretchy="false">)</mo><mi>b</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mi>s</mi><mi>b</mi><msup><mo stretchy="false">)</mo><mi>ϵ</mi></msup><mi>V</mi></mrow><annotation encoding="application/x-tex">\max_{b} U = u(w-(p+qs)b) + (sb)^\epsilon V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mop"><span class="mop">max</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">b</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">u</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mord mathnormal">b</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6644em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">ϵ</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span></p>

<p>Letting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo lspace="0em" rspace="0em">∗</mo></msup><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">b^{*}(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6887em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∗</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span> denote the optimal number of births as a function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>, what are its properties?</p>

<p>The simplest one is that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><msup><mi>b</mi><mo>∗</mo></msup><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">sb^*(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6887em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span>, the number of <em>surviving</em> children, is increasing in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>. This is the substitution effect we described intuitively earlier in this section. This means that if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span> is multiplied by a factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span> (say 1.25), <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo>∗</mo></msup><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">b^*(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6887em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span> will be multiplied <em>more than</em> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">1/x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1/</span><span class="mord mathnormal">x</span></span></span></span> (more than 0.8).</p>

<p>When we looked at the simplest model, with a constant number of children, we guessed that it could explain 30-44% of the fall in fertility. That number is a <strong>strict upper bound</strong> on what the current model could explain.</p>

<p>What we really want to know, to answer the original question, is how <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo>∗</mo></msup><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">b^*(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6887em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span> itself depends on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>. To do this, we need to get a little bit more into the relative magnitude of the cost per birth <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> and the additional cost <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span> per surviving child. As Doepke writes,</p>

<blockquote>
  <p>If a major fraction of the total cost of children accrues for every birth, fertility [i.e. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo>∗</mo></msup><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">b^*(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6887em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span>] would tend to increase with the survival probability; the opposite holds if children are expensive only after surviving infancy<sup id="fnref:aside-3" role="doc-noteref"><a href="#fn:aside-3" class="footnote" rel="footnote">9</a></sup>.</p>
</blockquote>

<p>This tells us that falling mortality could actually cause fertility to <em>increase</em> rather than decrease.<sup id="fnref:p_q" role="doc-noteref"><a href="#fn:p_q" class="footnote" rel="footnote">10</a></sup></p>

<p>To go further, we need to plug in actual values for the model parameters. Doepke does this, using numbers that reflect the child mortality situation of England in 1861 and 1951, but also what seem to be some pretty arbitrary assumptions about the parent’s preferences (the shape of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">u</span></span></span></span> and the value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ϵ</mi></mrow><annotation encoding="application/x-tex">\epsilon</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">ϵ</span></span></span></span>).</p>

<p>With these assumptions, he finds that “the total fertility rate falls from 5.0 (the calibrated target) to 4.2 when mortality rates are lowered to the 1951 level”<sup id="fnref:quote-context-2" role="doc-noteref"><a href="#fn:quote-context-2" class="footnote" rel="footnote">11</a></sup>, a 16% decrease. This represents is <strong>28%</strong> of the actually observed fall in fertility to 2.1.</p>

<h3 id="extensions-of-barro-becker-model">Extensions of Barro-Becker model</h3>
<p>The paper then considers various extensions of the basic Barro-Becker model to see if they could explain the large decrease in fertility that we observe.</p>

<p>For example, it has been hypothesized that when there is <em>uncertainty</em> about whether a child will survive (hitherto absent from the models), parents want to avoid the possibility of ending up with zero surviving children. They therefore have many children as a precautionary measure. Declining mortality (which reduces uncertainty since survival rates are thankfully greater than 0.5) would have a strong negative impacts on births.</p>

<p>However, Doepke also considers a third model, that incorporates not only stochastic mortality but also sequential fertility choice, where parents may condition their fertility decisions on the observed survival of children that were born previously. The sequential aspect reduces the uncertainty that parents face over the number of surviving children they will end up with.</p>

<p>The stochastic and sequential models make no clear-cut predictions based on theory alone. Using the England numbers, however, Doepke finds a robust conclusion. In the stochastic+sequential model, for almost all reasonable parameter values, the expected number of surviving children still increases with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span> (my emphasis):</p>

<blockquote>
  <p>To illustrate this point, let us consider the extreme case [where] utility from consumption is close to linear, while risk aversion with regards to the number of surviving children is high. … [W]hen we move (with the same parameters) to the more realistic sequential model, where parents can replace children who die early, … despite the high risk aversion with regards to the number of children, total fertility drops only to 4.0, and <strong>net fertility rises</strong> to 3.9, just as with the benchmark parameters. … Thus, in the sequential setup the conclusion that mortality decline raises net fertility is robust to different preference specifications, even if we deliberately emphasize the precautionary motive for hoarding children.</p>
</blockquote>

<p>So even here, the fall in mortality would only explain 35% of the actually observed change in fertility. It seems that the ability to “replace” children who did not survive in the sequential model is enough to make its predictions pretty similar to the simple Barro-Becker model.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:quote-context" role="doc-endnote">
      <p>The quote in context on Our World in Data’s <a href="https://ourworldindata.org/child-mortality#when-more-infants-survive-fertility-goes-down">child mortality page</a>: “the causal link between infant [&lt;1 year old] survival and fertility is established in both directions: Firstly, increasing infant survival reduces the parents’ demand for children. And secondly, a decreasing fertility allows the parents to devote more attention and resources to their children.” <a href="#fnref:quote-context" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:aside-1" role="doc-endnote">
      <p>As an aside, my impression is that if you asked an average educated person “Why do women in developing countries have more children?”, their first idea would be: “because child mortality is higher”. It’s almost a trope, and I feel that it’s often mentioned pretty glibly, without actually thinking about the decisions and trade-offs faced by the people concerned. That’s just an aside though – the theory clearly has prima facie plausibility, and is also cited in serious places like academia and Our World in Data. It deserves closer examination. <a href="#fnref:aside-1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:over-5-data" role="doc-endnote">
      <p>It should be possible to conduct the Africa analysis for different ages using <a href="http://ghdx.healthdata.org/gbd-results-tool">IMHE</a>’s more granular data, but it’s a bit more work. (There appears to be no direct data on deaths <em>per birth</em> as opposed to per capita, and data on fertility is contained in a different dataset from the main Global Burden of Disease data.) <a href="#fnref:over-5-data" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:file" role="doc-endnote">
      <p>All things decay. Should this Google Sheets spreadsheet become inaccessible, you can download <a href="/assets/files/fertility-mortality.xlsx">this <code class="language-plaintext highlighter-rouge">.xlsx</code> copy</a> which is stored together with this blog. <a href="#fnref:file" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:aside-99" role="doc-endnote">
      <p>In this light, we can see that the constant model is not really compatible with parents viewing additional surviving children as a (normal) good. Nor of course is it compatible with viewing children as a bad, for then parents would choose to have 0 children. Instead, it could for example be used to represent parents aiming for a socially normative number of surviving children. <a href="#fnref:aside-99" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:uf" role="doc-endnote">
      <p>I collapse Doepke’s <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05278em;">β</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span> into a single constant <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span>, since they can be treated as such in Model A, the only model that I will present mathematically in this post. <a href="#fnref:uf" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:uc" role="doc-endnote">
      <p>Its actual expression, that I omit from the main presentation for simplicity, is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo stretchy="false">(</mo><mi>c</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><msup><mi>c</mi><mrow><mn>1</mn><mo>−</mo><mi>σ</mi></mrow></msup><mrow><mn>1</mn><mo>−</mo><mi>σ</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">u(c)=\frac{c^{1-\sigma}}{1-\sigma}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">u</span><span class="mopen">(</span><span class="mord mathnormal">c</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.4213em;vertical-align:-0.4033em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.0179em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03588em;">σ</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">c</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8913em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight"><span class="mord mtight">1</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03588em;">σ</span></span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.4033em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span>, the constant relative risk-aversion utility function. <a href="#fnref:uc" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:aside-2" role="doc-endnote">
      <p>There is nothing in the model that compels us to call <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> the “cost per birth”, this is merely for ease of exposition. The model itself only assumes that there are two periods for each child: in the first period, costing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> to start, children face a mortality risk; and in the second period, those who survived the first face zero mortality risk and cost <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span>. <a href="#fnref:aside-2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:aside-3" role="doc-endnote">
      <p>Once again, Doepke calls the model’s early period “infancy”, but this is not inherent in the model. <a href="#fnref:aside-3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:p_q" role="doc-endnote">
      <p>It’s difficult to speculate about the relative magnitude of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span>, especially if, departing from Doepke, we make the early period of the model, say, the first 5 years of life. If the first period is only infancy, it seems plausible to me that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo>≫</mo><mi>p</mi></mrow><annotation encoding="application/x-tex">q \gg p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≫</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span>, but then we also fail to capture any deaths after infancy. On the other hand, extending the early period to 5 incorrectly assumes that parents get no utility from children before they reach the age of 5. <a href="#fnref:p_q" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:quote-context-2" role="doc-endnote">

      <p>The following additional context may be helpful to understand this quote:</p>
      <blockquote>
        <p>The survival parameters are chosen to correspond to the situation in England in 1861 . According to Perston et al. (1972) the infant mortality rate (death rate until first birthday) was <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>16</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">16 \%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">16%</span></span></span></span>, while the child mortality rate (death rate between first and fifth birthday) was <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>13</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">13 \%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">13%</span></span></span></span>. Accordingly, I set <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mi>i</mi></msub><mo>=</mo><mn>0.84</mn></mrow><annotation encoding="application/x-tex">s_{i}=0.84</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.84</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mi>y</mi></msub><mo>=</mo><mn>0.87</mn></mrow><annotation encoding="application/x-tex">s_{y}=0.87</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7167em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03588em;">y</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.87</span></span></span></span> in the sequential model, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo>=</mo><msub><mi>s</mi><mi>i</mi></msub><msub><mi>s</mi><mi>y</mi></msub><mo>=</mo><mn>0.73</mn></mrow><annotation encoding="application/x-tex">s=s_{i} s_{y}=0.73</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7167em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03588em;">y</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.73</span></span></span></span> in the other models. Finally, the altruism factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05278em;">β</span></span></span></span> is set in each model to match the total fertility rate, which was <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4.9</mn></mrow><annotation encoding="application/x-tex">4.9</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4.9</span></span></span></span> in 1861 (Chenais 1992). Since fertility choice is discrete in Models B and C, I chose a total fertility rate of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>5.0</mn></mrow><annotation encoding="application/x-tex">5.0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">5.0</span></span></span></span> as the target.</p>

        <p>Each model is thus calibrated to reproduce the relationship of fertility and infant and child mortality in 1861 . I now examine how fertility adjusts when mortality rates fall to the level observed in 1951 , which is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">3 \%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">3%</span></span></span></span> for infant mortality and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.5</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">0.5 \%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">0.5%</span></span></span></span> for child mortality. The results for fertility can be compared to the observed total fertility rate of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2.1</mn></mrow><annotation encoding="application/x-tex">2.1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2.1</span></span></span></span> in 1951 .</p>

        <p>In Model A (Barro-Becker with continuous fertility choice), the total fertility rate falls from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>5.0</mn></mrow><annotation encoding="application/x-tex">5.0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">5.0</span></span></span></span> (the calibrated target) to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4.2</mn></mrow><annotation encoding="application/x-tex">4.2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4.2</span></span></span></span> when mortality rates are lowered to the 1951 level. The expected number of surviving children increases from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3.7</mn></mrow><annotation encoding="application/x-tex">3.7</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3.7</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4.0</mn></mrow><annotation encoding="application/x-tex">4.0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4.0</span></span></span></span>. Thus, there is a small decline in total fertility, but (as was to be expected given Proposition 1) an increase in the net fertility rate.</p>
      </blockquote>
      <p><a href="#fnref:quote-context-2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="economics" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/ourworldindata_scatter-fertility-vs-infant-survival.png" /><media:content medium="image" url="https://bayes.net/assets/images/ourworldindata_scatter-fertility-vs-infant-survival.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The special case of the normal likelihood function</title><link href="https://bayes.net/bayes-normal-likelihood/" rel="alternate" type="text/html" title="The special case of the normal likelihood function" /><published>2021-07-31T00:00:00+00:00</published><updated>2021-07-31T00:00:00+00:00</updated><id>https://bayes.net/bayes-normal-likelihood</id><content type="html" xml:base="https://bayes.net/bayes-normal-likelihood/"><![CDATA[<p><strong>Summary<sup id="fnref:ack" role="doc-noteref"><a href="#fn:ack" class="footnote" rel="footnote">1</a></sup></strong>: <em>The likelihood function implied by an estimate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> with standard deviation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>σ</mi></mrow><annotation encoding="application/x-tex">\sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span></span></span></span> is the probability density function (PDF) of a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>b</mi><mo separator="true">,</mo><msup><mi>σ</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{N}(b,\sigma^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>. Though this might sound intuitive, it’s actually a special case. If we don’t firmly grasp that it’s an exception, it can be confusing.</em></p>

<p>Suppose that a study has the point estimator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> for the parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span>. The study results are an estimate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">B=b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> (typically a regression coefficient), and an estimated standard deviation<sup id="fnref:standard-error" role="doc-noteref"><a href="#fn:standard-error" class="footnote" rel="footnote">2</a></sup> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mrow><mi>s</mi><mi>d</mi></mrow><mo>^</mo></mover><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo><mo>=</mo><mi>s</mi></mrow><annotation encoding="application/x-tex">\hat{sd}(B)=s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2079em;vertical-align:-0.25em;"></span><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9579em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span></span></span><span style="top:-3.2634em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.25em;"><span class="mord">^</span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>.</p>

<p>In order to know how to combine this information with a prior over <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span> in order to update our beliefs, we need to know what is the <em>likelihood function</em> implied by the study. The likelihood function is the probability of observing the study data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">B=b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> given different values for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span>. It is formed from the probability of the observation that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">B=b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> conditional on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi><mo>=</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\Theta=\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>, but viewed and used as a function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> only<sup id="fnref:notation" role="doc-noteref"><a href="#fn:notation" class="footnote" rel="footnote">3</a></sup>:</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><mi>P</mi><mo stretchy="false">(</mo><mi>B</mi><mo>=</mo><mi>b</mi><mo>∣</mo><mi mathvariant="normal">Θ</mi><mo>=</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto P(B =b \mid \Theta = \theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span></span>

<p>The event “<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">B=b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>” is often shortened to just “<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>” when the meaning is clear from context, so that the function can be more briefly written <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><mi>P</mi><mo stretchy="false">(</mo><mi>b</mi><mo>∣</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto P(b \mid \theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span>.</p>

<p><strong>So, what is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span>?</strong> In a typical regression context, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is assumed to be approximately normally distributed around <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span>, due to the central limit theorem. More precisely, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mfrac><mrow><mi>B</mi><mo>−</mo><mi mathvariant="normal">Θ</mi></mrow><mrow><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo></mrow></mfrac><mo>∼</mo><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\frac{B - \Theta}{sd(B)} \sim \mathcal{N}(0,1)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.3923em;vertical-align:-0.52em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8723em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="mord mathnormal mtight">d</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.05017em;">B</span><span class="mclose mtight">)</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.05017em;">B</span><span class="mbin mtight">−</span><span class="mord mtight">Θ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.52em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mclose">)</span></span></span></span>, and equivalently <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>∼</mo><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi mathvariant="normal">Θ</mi><mo separator="true">,</mo><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">B\sim \mathcal{N}(\Theta,sd(B)^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord">Θ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</p>

<p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">sd(B)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose">)</span></span></span></span> is seldom known, and is often replaced with its estimate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>, allowing us to write <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>∼</mo><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi mathvariant="normal">Θ</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">B\sim \mathcal{N}(\Theta,s^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord">Θ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>, where only the parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span> is unknown<sup id="fnref:unknown-variance" role="doc-noteref"><a href="#fn:unknown-variance" class="footnote" rel="footnote">4</a></sup>.</p>

<p>We can plug this into the definition of the likelihood function:</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><mi>P</mi><mo stretchy="false">(</mo><mi>b</mi><mo>∣</mo><mi>θ</mi><mo stretchy="false">)</mo><mo>=</mo><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mn>1</mn><mrow><mi>s</mi><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt></mrow></mfrac><mi>exp</mi><mo>⁡</mo><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi>b</mi><mo>−</mo><mi>θ</mi></mrow><mi>s</mi></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto P(b\mid \theta)= \text{PDF}_{\mathcal{N}(\theta,s^2)}(b) = {\frac {1}{s\sqrt {2\pi }}}\exp \left(-{\frac {1}{2}}\left({\frac {b-\theta
    }{s
    }}\right)^{2} \right)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mpunct mtight">,</span><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3em;vertical-align:-1.25em;"></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.2028em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.03588em;">π</span></span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">exp</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="mord">−</span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3714em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.654em;"><span style="top:-3.9029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span></span></span></span></span>

<p>We could just leave it at that. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span> is the function<sup id="fnref:distribution-function" role="doc-noteref"><a href="#fn:distribution-function" class="footnote" rel="footnote">5</a></sup> above, and that’s all we need to compute the posterior. But a slightly different expression for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span>  is possible. After factoring out the square,</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><mfrac><mn>1</mn><mrow><mi>s</mi><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt></mrow></mfrac><mi>exp</mi><mo>⁡</mo><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mfrac><mrow><mo stretchy="false">(</mo><mi>b</mi><mo>−</mo><mi>θ</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><msup><mi>s</mi><mn>2</mn></msup></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto {\frac {1}{s
    {\sqrt {2\pi }}}}\exp \left(-{\frac {1}{2}} {\frac {(b-\theta)^2
    }{s^2
    }} \right),</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4411em;vertical-align:-0.95em;"></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.2028em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.03588em;">π</span></span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">exp</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord">−</span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4911em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7401em;"><span style="top:-2.989em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span></span></span></span></span>

<p>we make use of the fact that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>b</mi><mo>−</mo><mi>θ</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo>=</mo><mo stretchy="false">(</mo><mi>θ</mi><mo>−</mo><mi>b</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">(b-\theta)^2 = (\theta-b)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span> to rewrite <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span> with the positions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> flipped:</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><mfrac><mn>1</mn><mrow><mi>s</mi><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt></mrow></mfrac><mi>exp</mi><mo>⁡</mo><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi>θ</mi><mo>−</mo><mi>b</mi></mrow><mi>s</mi></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto {\frac {1}{s
    {\sqrt {2\pi }}}}\exp \left(-{\frac {1}{2}}\left({\frac {\theta-b
    }{s
    }}\right)^{2} \right).</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3em;vertical-align:-1.25em;"></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.2028em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.03588em;">π</span></span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">exp</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="mord">−</span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3714em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">s</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.654em;"><span style="top:-3.9029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">.</span></span></span></span></span>

<p>We then notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span> is none other than</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>b</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto \text{PDF}_{\mathcal{N}(b,s^2)}(\theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight">b</span><span class="mpunct mtight">,</span><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span></span>

<p>So, for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> and for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi><mo>:</mo><mi>θ</mi><mo>↦</mo><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>b</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{L}: \theta \mapsto \text{PDF}_{\mathcal{N}(\theta,s^2)}(b) = \text{PDF}_{\mathcal{N}(b,s^2)}(\theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mpunct mtight">,</span><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight">b</span><span class="mpunct mtight">,</span><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span>.</p>

<p>The key thing to realise is that this is a special case due to the fact that the functional form of the normal PDF is invariant to substituting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> for each other. For many other distributions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span>, we cannot apply this procedure.</p>

<p>This special case is worth commenting upon because it has personally lead me astray in the past. I often encountered the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is normally distributed, and I used the equality above without deriving it and understanding where it comes from. It just had a vaguely intuitive ring to it. I would occasionally slip into thinking it was a more general rule, which always resulted in painful confusion.</p>

<p>To understand the result, let us first illustrate it with a simple numerical example. Suppose we observe an Athenian man <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi><mo>=</mo><mn>200</mn></mrow><annotation encoding="application/x-tex">b=200</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">200</span></span></span></span> cm tall. For all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>, the likelihood of this observation if Athenian men’s heights followed an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><mn>10</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{N}(\theta,10)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">10</span><span class="mclose">)</span></span></span></span> is the same number as the density of observing an Athenian <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> cm tall if Athenian men’s heights followed a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mn>200</mn><mo separator="true">,</mo><mn>10</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{N}(200,10)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord">200</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">10</span><span class="mclose">)</span></span></span></span><sup id="fnref:neg" role="doc-noteref"><a href="#fn:neg" class="footnote" rel="footnote">6</a></sup>.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/density-likelihood-400-459f91fa1.webp 400w, /generated/_posts/../assets/images/density-likelihood-600-459f91fa1.webp 600w, /generated/_posts/../assets/images/density-likelihood-800-459f91fa1.webp 800w, /generated/_posts/../assets/images/density-likelihood-1000-459f91fa1.webp 1000w, /generated/_posts/../assets/images/density-likelihood-1500-459f91fa1.webp 1500w, /generated/_posts/../assets/images/density-likelihood-1501-459f91fa1.webp 1501w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/density-likelihood-400-459f91fa1.jpeg 400w, /generated/_posts/../assets/images/density-likelihood-600-459f91fa1.jpeg 600w, /generated/_posts/../assets/images/density-likelihood-800-459f91fa1.jpeg 800w, /generated/_posts/../assets/images/density-likelihood-1000-459f91fa1.jpeg 1000w, /generated/_posts/../assets/images/density-likelihood-1500-459f91fa1.jpeg 1500w, /generated/_posts/../assets/images/density-likelihood-1501-459f91fa1.jpeg 1501w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/density-likelihood-800-459f91fa1.png" width="1501" height="588" /></picture>

<p><em>Graphical representation of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><mn>10</mn><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mn>200</mn><mo stretchy="false">)</mo><mo>=</mo><msub><mtext>PDF</mtext><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mn>200</mn><mo separator="true">,</mo><mn>10</mn><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\text{PDF}_{\mathcal{N}(\theta,10)}(200) = \text{PDF}_{\mathcal{N}(200,10)}(\theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mpunct mtight">,</span><span class="mord mtight">10</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">200</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.14736em;">N</span><span class="mopen mtight">(</span><span class="mord mtight">200</span><span class="mpunct mtight">,</span><span class="mord mtight">10</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span></em></p>

<p>When encountering this equivalence, you might, like me, sort of nod along. But puzzlement would be a more appropriate reaction. To compute the likelihood of our 200 cm Athenian under different <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span>-values, we can substitute a <em>totally different question</em>: “assuming that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi><mo>=</mo><mn>200</mn></mrow><annotation encoding="application/x-tex">\Theta=200</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">200</span></span></span></span>, what is the probability of seeing Athenian men of different sizes?”.</p>

<p>The puzzle is, I think, best resolved by viewing it as a special case, an algebraic curiosity that only applies to some distributions. Don’t even try to build an intuition for it, because it does not generalise.</p>

<p>To help understand this better, let’s look at at a case where the procedure cannot be applied.</p>

<p>Suppose for example that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is binomially distributed, representing the number of successes among <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> independent trials with success probability <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span>. We’ll write <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>∼</mo><mtext>Bin</mtext><mo stretchy="false">(</mo><mi>n</mi><mo separator="true">,</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">B \sim \text{Bin}(n, \theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord text"><span class="mord">Bin</span></span><span class="mopen">(</span><span class="mord mathnormal">n</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span>.</p>

<p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span>’s probability mass function is</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>g</mi><mo>:</mo><mi>k</mi><mo>↦</mo><msub><mtext>PMF</mtext><mrow><mtext>Bin</mtext><mo stretchy="false">(</mo><mi>n</mi><mo separator="true">,</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>k</mi><mo stretchy="false">)</mo><mo>=</mo><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>n</mi><mi>k</mi></mfrac><mo fence="true">)</mo></mrow><msup><mi>ϕ</mi><mi>k</mi></msup><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>ϕ</mi><msup><mo stretchy="false">)</mo><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">g: k \mapsto \text{PMF}_{\text{Bin}(n, \theta)}(k) = {n \choose k} \phi^k (1-\phi)^{n-k}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7054em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PMF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">Bin</span></span><span class="mopen mtight">(</span><span class="mord mathnormal mtight">n</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mord"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1076em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span></span><span class="mord"><span class="mord mathnormal">ϕ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1491em;vertical-align:-0.25em;"></span><span class="mord mathnormal">ϕ</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></span>

<p>Meanwhile, the likelihood function for the observation of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> successes is</p>

<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="script">M</mi><mo>:</mo><mi>ϕ</mi><mo>↦</mo><msub><mtext>PMF</mtext><mrow><mtext>Bin</mtext><mo stretchy="false">(</mo><mi>n</mi><mo separator="true">,</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow></msub><mo stretchy="false">(</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>n</mi><mi>b</mi></mfrac><mo fence="true">)</mo></mrow><msup><mi>ϕ</mi><mi>b</mi></msup><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>ϕ</mi><msup><mo stretchy="false">)</mo><mrow><mi>n</mi><mo>−</mo><mi>b</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\mathcal{M}: \phi \mapsto \text{PMF}_{\text{Bin}(n, \theta)}(b) = {n \choose b} \phi^b (1-\phi)^{n-b}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">M</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ϕ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1052em;vertical-align:-0.3552em;"></span><span class="mord"><span class="mord text"><span class="mord">PMF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.5198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">Bin</span></span><span class="mopen mtight">(</span><span class="mord mathnormal mtight">n</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3552em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mord"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1076em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">b</span></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span></span><span class="mord"><span class="mord mathnormal">ϕ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">b</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1491em;vertical-align:-0.25em;"></span><span class="mord mathnormal">ϕ</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight">b</span></span></span></span></span></span></span></span></span></span></span></span></span>

<p>To attempt to take the PMF <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span></span></span></span>, set its parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> equal to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>, and obtain the likelihood function would not just give incorrect values, it would be a domain error. Regardless of how we set its parameters, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span></span></span></span> could never be equal to the likelihood function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mathcal{M}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">M</span></span></span></span>, because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span></span></span></span> is defined on  <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">{</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mi mathvariant="normal">.</mi><mi mathvariant="normal">.</mi><mi mathvariant="normal">.</mi><mo separator="true">,</mo><mi>n</mi><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">\{0,1,...,n\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">{</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">...</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">n</span><span class="mclose">}</span></span></span></span>, whereas  <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mathcal{M}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">M</span></span></span></span> is defined on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0,1]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mclose">]</span></span></span></span>.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-400-917a2fcfd.webp 400w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-600-917a2fcfd.webp 600w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-800-917a2fcfd.webp 800w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-1000-917a2fcfd.webp 1000w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-1201-917a2fcfd.webp 1201w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-400-917a2fcfd.jpeg 400w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-600-917a2fcfd.jpeg 600w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-800-917a2fcfd.jpeg 800w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-1000-917a2fcfd.jpeg 1000w, /generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-1201-917a2fcfd.jpeg 1201w" type="image/jpeg" /><img alt="img" src="/generated/_posts/../assets/images/LikelihoodFunctionAfterHHT-800-917a2fcfd.png" width="1201" height="900" /></picture>

<p><em>The likelihood function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">Q</mi><mo>:</mo><msub><mi>P</mi><mi>H</mi></msub><mo>↦</mo><msubsup><mi>P</mi><mi>H</mi><mn>2</mn></msubsup><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>P</mi><mi>H</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{Q}: P_H \mapsto P_H^2(1-P_H)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7805em;vertical-align:-0.0972em;"></span><span class="mord mathcal">Q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.08125em;">H</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">↦</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0894em;vertical-align:-0.2753em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4247em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.08125em;">H</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2753em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.08125em;">H</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span> for the binomial probability of a biased coin landing heads-up, given that we have observed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">{</mo><mi>H</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi><mo separator="true">,</mo><mi>H</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi><mo separator="true">,</mo><mi>T</mi><mi>a</mi><mi>i</mi><mi>l</mi><mi>s</mi><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">\{Heads, Heads, Tails\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">{</span><span class="mord mathnormal">He</span><span class="mord mathnormal">a</span><span class="mord mathnormal">d</span><span class="mord mathnormal">s</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">He</span><span class="mord mathnormal">a</span><span class="mord mathnormal">d</span><span class="mord mathnormal">s</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="mord mathnormal">ai</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">s</span><span class="mclose">}</span></span></span></span>. It is defined on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0,1]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mclose">]</span></span></span></span>. (The constant factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mn>3</mn><mn>2</mn></mfrac><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">3 \choose 2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2451em;vertical-align:-0.35em;"></span><span class="mord"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8951em;"><span style="top:-2.355em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.144em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">)</span></span></span></span></span></span> is omitted, a common practice with likelihood functions, because these constant factors have no meaning and make no difference to the posterior distribution.)</em></p>

<p>It’s hopefully now quite intuitive that the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is normally distributed was a special case.<sup id="fnref:simple" role="doc-noteref"><a href="#fn:simple" class="footnote" rel="footnote">7</a></sup></p>

<p>Let’s recapitulate.</p>

<p>The likelihood function is the probability of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi><mo>∣</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">b\mid\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> viewed as a function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> only. It is absolutely not a density of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>.</p>

<p>In the special case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is normally distributed, we have the confusing ability of being able to express this function as if it were the density of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> under a distribution that depends on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>.</p>

<p>I think it’s best to think of that ability as an algebraic coincidence, due to the functional form of the normal PDF. We should think of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi></mrow><annotation encoding="application/x-tex">\mathcal{L}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal">L</span></span></span></span> in the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> is normally distributed as just another likelihood function.</p>

<p>Finally, I’d love to know if there is some way to view this special case as enlightening rather than just a confusing exception.</p>

<p>I believe that to say that a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mtext>PDF</mtext><mrow><mi>θ</mi><mo separator="true">,</mo><mi mathvariant="normal">Γ</mi></mrow></msub><mo stretchy="false">(</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><msub><mtext>PDF</mtext><mrow><mi>b</mi><mo separator="true">,</mo><mi mathvariant="normal">Γ</mi></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\text{PDF}_{\theta,\Gamma}(b)=\text{PDF}_{b,\Gamma}(\theta)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span><span class="mpunct mtight">,</span><span class="mord mtight">Γ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">b</span><span class="mpunct mtight">,</span><span class="mord mtight">Γ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span></span></span></span> (where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mtext>PDF</mtext><mrow><mi>ψ</mi><mo separator="true">,</mo><mi mathvariant="normal">Γ</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\text{PDF}_{\psi,\Gamma}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord text"><span class="mord">PDF</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03588em;">ψ</span><span class="mpunct mtight">,</span><span class="mord mtight">Γ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span> denotes the PDF of a distribution with one parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\psi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">ψ</span></span></span></span> that we wish to single out and a vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Γ</mi></mrow><annotation encoding="application/x-tex">\Gamma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Γ</span></span></span></span> of other parameters), is equivalent to saying that the PDF is <em>symmetric around its singled-out parameter</em>. For example, a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">N</mi><mo stretchy="false">(</mo><mi>μ</mi><mo separator="true">,</mo><msup><mi>σ</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathcal{N}(\mu,\sigma^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.14736em;">N</span><span class="mopen">(</span><span class="mord mathnormal">μ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span> is symmetric around its parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>μ</mi></mrow><annotation encoding="application/x-tex">\mu</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">μ</span></span></span></span>. But this hasn’t seemed insightful to me. Please write to me if you know an answer to this.</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:ack" role="doc-endnote">
      <p>Thanks to Gavin Leech and Ben West for feedback on a previous versions of this post. <a href="#fnref:ack" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:standard-error" role="doc-endnote">
      <p>I do not use the confusing term ‘standard error’, which I believe should mean <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">sd(B)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose">)</span></span></span></span> but is often also used to also denote its estimate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>. <a href="#fnref:standard-error" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:notation" role="doc-endnote">
      <p>I use uppercase letters <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> to denote random variables, and lower case <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span> for particular values (realizations) these random variables could take. <a href="#fnref:notation" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:unknown-variance" role="doc-endnote">
      <p>A more sophisticated approach would be to let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">sd(B)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose">)</span></span></span></span> be another unknown parameter over which we form a prior; we would then update our beliefs jointly about <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Θ</mi></mrow><annotation encoding="application/x-tex">\Theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Θ</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>d</mi><mo stretchy="false">(</mo><mi>B</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">sd(B)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">d</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose">)</span></span></span></span>. See for example <a href="https://sci-hub.se/10.1002/9781118593165.ch17">Bolstad &amp; Curran (2016), Chapter 17, “Bayesian Inference for Normal with Unknown Mean and Variance”</a>. <a href="#fnref:unknown-variance" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:distribution-function" role="doc-endnote">
      <p>I don’t like the term “<a href="https://www.google.com/search?q=%22likelihood+distribution%22">likelihood distribution</a>”, I prefer “likelihood function”. In formal parlance, mathematical <a href="https://en.wikipedia.org/wiki/Distribution_(mathematics)">distributions</a> are a generalization of functions, so it’s arguably technically correct to call any likelihood function a likelihood distribution. But in many contexts, “distribution” is merely used as short for “probability distribution”. So “likelihood distribution” runs the risk of making us think of “likelihood <em>probability</em> distribution” – but the likelihood function is not generally a probability distribution. <a href="#fnref:distribution-function" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:neg" role="doc-endnote">
      <p>We are here ignoring any inadequacies of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>∼</mo><mi>N</mi><mo stretchy="false">(</mo><mi mathvariant="normal">Θ</mi><mo separator="true">,</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">B\sim N(\Theta,s^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mopen">(</span><span class="mord">Θ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span> assumption, including but not limited to the fact that one cannot observe men with negative heights. <a href="#fnref:neg" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:simple" role="doc-endnote">

      <p>Another simple reminder that the procedure couldn’t possibly work in general is that in general the likelihood function is not even a PDF at all. For example, a broken thermometer that always gives the temperature as 20 degrees has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi><mo stretchy="false">(</mo><mi>B</mi><mo>=</mo><mn>20</mn><mo>∣</mo><mi>θ</mi><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">P(B=20 \mid \theta) = 1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">20</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>, which evidently does not integrate to 1 over all values of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span>.</p>

      <p>To take a different tack, the fact that the likelihood function is <a href="http://theoryandpractice.org/stats-ds-book/distributions/invariance-of-likelihood-to-reparameterizaton.html#how-does-the-likelihood-transform-to-reparameterization">invariant to reparametrization</a> also illustrates that it is not a probability density of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> (thanks to Gavin Leech for the link). <a href="#fnref:simple" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="probability" /><summary type="html"><![CDATA[Summary1: The likelihood function implied by an estimate bbb with standard deviation σ\sigmaσ is the probability density function (PDF) of a N(b,σ2)\mathcal{N}(b,\sigma^2)N(b,σ2). Though this might sound intuitive, it’s actually a special case. If we don’t firmly grasp that it’s an exception, it can be confusing. Thanks to Gavin Leech and Ben West for feedback on a previous versions of this post. &#8617;]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/density-likelihood.png" /><media:content medium="image" url="https://bayes.net/assets/images/density-likelihood.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to circumvent Sci-Hub ISP block</title><link href="https://bayes.net/scihub-proxy/" rel="alternate" type="text/html" title="How to circumvent Sci-Hub ISP block" /><published>2021-05-15T00:00:00+00:00</published><updated>2021-05-15T00:00:00+00:00</updated><id>https://bayes.net/scihub-proxy</id><content type="html" xml:base="https://bayes.net/scihub-proxy/"><![CDATA[<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/sci-hub-proxy-400-8148f0a75.webp 400w, /generated/_posts/../assets/images/sci-hub-proxy-600-8148f0a75.webp 600w, /generated/_posts/../assets/images/sci-hub-proxy-800-8148f0a75.webp 800w, /generated/_posts/../assets/images/sci-hub-proxy-1000-8148f0a75.webp 1000w, /generated/_posts/../assets/images/sci-hub-proxy-1500-8148f0a75.webp 1500w, /generated/_posts/../assets/images/sci-hub-proxy-2000-8148f0a75.webp 2000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/sci-hub-proxy-400-8148f0a75.jpeg 400w, /generated/_posts/../assets/images/sci-hub-proxy-600-8148f0a75.jpeg 600w, /generated/_posts/../assets/images/sci-hub-proxy-800-8148f0a75.jpeg 800w, /generated/_posts/../assets/images/sci-hub-proxy-1000-8148f0a75.jpeg 1000w, /generated/_posts/../assets/images/sci-hub-proxy-1500-8148f0a75.jpeg 1500w, /generated/_posts/../assets/images/sci-hub-proxy-2000-8148f0a75.jpeg 2000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/sci-hub-proxy-800-8148f0a75.png" width="2665" height="1274" /></picture>

<p>In the UK, many internet service providers (ISPs) block <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5832410/">Sci-Hub</a>. However, a simple proxy is enough to circumvent this (you don’t even need a VPN). Routing requests through a suitable<sup id="fnref:bl" role="doc-noteref"><a href="#fn:bl" class="footnote" rel="footnote">1</a></sup> proxy lets you open Sci-Hub in your regular browser as if it weren’t blocked<sup id="fnref:reverse-lookup" role="doc-noteref"><a href="#fn:reverse-lookup" class="footnote" rel="footnote">2</a></sup>.</p>

<p>Routing all your traffic through a proxy may come with privacy and security concerns, and will slow your connection a bit. We want to use our proxy only for accessing Sci-Hub.</p>

<p>You can use extensions like <a href="https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif">ProxySwitchy</a> to tell your browser to automatically use certain proxies, or no proxy at all, for sets of websites that you define.</p>

<p>Unfortunately, this extension, and others like it, require permissions to insert arbitrary JavaScript into <em>any</em> page you visit (the web store accurately explains that the extension can “read and change all your data on the websites you visit”). That’s likely due to insufficiently granular permission definitions by Chrome, and is not the fault of the presumably well-intentioned extension authors. But it freaks me out a little bit (<a href="https://robertheaton.com/2018/07/02/stylish-browser-extension-steals-your-internet-history/">bad things have happened</a>).</p>

<p>Luckily, we can achieve the same effect by writing our own <em>proxy auto-configuration file</em>. A proxy auto-configuration or PAC file contains just a single JavaScript function like this:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nx">FindProxyForURL</span> <span class="p">(</span><span class="nx">url</span><span class="p">,</span> <span class="nx">host</span><span class="p">)</span> <span class="p">{</span>
  
  <span class="c1">// Sci-Hub requests</span>
  <span class="k">if</span> <span class="p">(</span><span class="nx">shExpMatch</span><span class="p">(</span><span class="nx">host</span><span class="p">,</span> <span class="dl">'</span><span class="s1">sci-hub.se</span><span class="dl">'</span><span class="p">)</span> <span class="o">||</span> <span class="nx">shExpMatch</span><span class="p">(</span><span class="nx">host</span><span class="p">,</span><span class="dl">'</span><span class="s1">*.sci-hub.se</span><span class="dl">'</span><span class="p">))</span> <span class="p">{</span>

                  <span class="c1">// Your proxy address and port number</span>
    <span class="k">return</span> <span class="dl">'</span><span class="s1">PROXY 123.456.789:9279</span><span class="dl">'</span><span class="p">;</span> 
  <span class="p">}</span>

  <span class="c1">// All other requests</span>
  <span class="k">return</span> <span class="dl">'</span><span class="s1">DIRECT</span><span class="dl">'</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>We can instruct the operating system to read this file. Search for instructions on Google (<a href="https://www.google.com/search?q=proxy+auto+configuration+file+mac+os">example</a>).</p>

<p>When you use the proxy to access Sci-Hub for the first time in a browser session, the browser will ask you for the username and password to your proxy server. If you’re using Chrome, I’d recommend saving the credentials into the browser’s password manager to avoid having to enter them again.<sup id="fnref:save-password" role="doc-noteref"><a href="#fn:save-password" class="footnote" rel="footnote">3</a></sup></p>

<p>There are many free proxies on the Internet, but I find that using the services of an actual for-profit proxy company is well worth it, for the greater speed and reliability. Currently <a href="https://www.webshare.io/proxy-server?referral_code=1uknewljmt9y">webshare.io</a> (referral link) offers 1 GB per month free, which is quite a lot of Sci-Hub PDFs. After that you can get 250 GB for $2.99 per month.<sup id="fnref:webshare" role="doc-noteref"><a href="#fn:webshare" class="footnote" rel="footnote">4</a></sup></p>

<h3 id="step-by-step-instructions">Step by step instructions</h3>
<ol>
  <li><a href="https://www.webshare.io/?referral_code=1uknewljmt9y">Create an account on webshare.io</a> (referral link)</li>
  <li>Choose a proxy from your list, and copy its address and port number into your PAC file, following the pattern above.</li>
  <li>Set your operating system to read its proxy settings from this PAC file<sup id="fnref:proxyWIN" role="doc-noteref"><a href="#fn:proxyWIN" class="footnote" rel="footnote">5</a></sup>. Instructions for this are easy to Google (<a href="https://www.google.com/search?q=proxy+auto+configuration+file+mac+os">example</a>).</li>
  <li>Open Sci-Hub in your browser. Enter your proxy username and password and optionally save these credentials in the browser. You can find the credentials in your webshare.io account.</li>
  <li>Don’t forget to only use Sci-Hub to look at really old papers that have lapsed into the public domain :)</li>
</ol>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:bl" role="doc-endnote">
      <p>Obviously, the proxy must not itself be on a network that blocks Sci-Hub. I have not come across any proxy that blocks Sci-Hub in this way. <a href="#fnref:bl" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:reverse-lookup" role="doc-endnote">
      <p>Changing your DNS resolver to a public one <a href="https://developers.google.com/speed/public-dns/">like Google’s</a> instead of your ISP’s is not sufficient as of 2021, for two ISPs I’ve tested, and I suspect for all UK ISPs that implement blocking. (Many people believe changing the DNS resolver is sufficient. Probably ISPs used to implement simple DNS level blocking and have recently upped their game.) My guess is that instead of merely blocking the request to resolve <code class="language-plaintext highlighter-rouge">sci-hub.se</code> at the DNS resolver level, the ISPs are also doing a <a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">reverse lookup</a> on every requested IP address to check whether it corresponds to a blacklisted domain. <a href="#fnref:reverse-lookup" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:save-password" role="doc-endnote">
      <p>You want to use the Chrome password manager because third-party password managers such as 1Password are not able to auto-fill credentials when logging in to a proxy server (as opposed to logging into a webpage). Note that if you have a third-party password manager extension installed this will disable the browser setting “Offer to save passwords”. I recommend that you temporarily disable your password manager extension, log in to your proxy server, save the password into Chrome, and then enable the extension again. <a href="#fnref:save-password" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:webshare" role="doc-endnote">
      <p>Their home page exemplifies a dark pattern by not showing the pricing by the GB; it just says you get ‘up to unlimited’ bandwidth. You’ll be able to see the actual pricing after you create an account. <a href="#fnref:webshare" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:proxyWIN" role="doc-endnote">
      <p>One gotcha is that Windows 10 <a href="https://docs.microsoft.com/en-us/troubleshoot/browsers/cannot-read-pac-file">forces you</a> to call your PAC file from a web server; it cannot be a local file (??!). To work around this, you can upload your file as a <a href="https://gist.github.com/">Gist</a> and link to the <code class="language-plaintext highlighter-rouge">/raw</code>. <a href="#fnref:proxyWIN" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="how to" /><summary type="html"><![CDATA[]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/sci-hub-proxy.png" /><media:content medium="image" url="https://bayes.net/assets/images/sci-hub-proxy.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Modified respirator to shield myself and others from COVID</title><link href="https://bayes.net/covid-respirator/" rel="alternate" type="text/html" title="Modified respirator to shield myself and others from COVID" /><published>2021-01-02T00:00:00+00:00</published><updated>2021-01-02T00:00:00+00:00</updated><id>https://bayes.net/covid-respirator</id><content type="html" xml:base="https://bayes.net/covid-respirator/"><![CDATA[<p><strong>Summary:</strong> <em>I have tried many types of masks and respirators during the 2020 pandemic. My recommendation is to use ‘elastomeric’ respirators common in industry, and to either filter or completely block off their exhalation valve. The result is a comfortable respirator that I believe offers a high level of protection against airborne diseases to myself and others. I am not an infectious disease expert.</em></p>

<h1 class="no_toc" id="contents">Contents</h1>
<ol id="markdown-toc">
  <li><a href="#elastomeric-respirators" id="markdown-toc-elastomeric-respirators">Elastomeric respirators</a></li>
  <li><a href="#cdc-recommendation-for-exhalation-valves" id="markdown-toc-cdc-recommendation-for-exhalation-valves">CDC recommendation for exhalation valves</a></li>
  <li><a href="#recommendation-a-3m-6500ql-series-with-kn95-and-surgical-mask" id="markdown-toc-recommendation-a-3m-6500ql-series-with-kn95-and-surgical-mask">Recommendation A: 3M 6500QL Series with KN95 and surgical mask</a>    <ol>
      <li><a href="#choice-of-respirator" id="markdown-toc-choice-of-respirator">Choice of respirator</a></li>
      <li><a href="#choice-of-filters-for-a-3m-respirator" id="markdown-toc-choice-of-filters-for-a-3m-respirator">Choice of filters for a 3M respirator</a></li>
    </ol>
  </li>
  <li><a href="#recommmendation-b-miller-lpr-100-with-tape-and-surgical-mask" id="markdown-toc-recommmendation-b-miller-lpr-100-with-tape-and-surgical-mask">Recommmendation B: Miller LPR-100 with tape and surgical mask</a>    <ol>
      <li><a href="#how-we-need-to-modify-the-respirator" id="markdown-toc-how-we-need-to-modify-the-respirator">How we need to modify the respirator</a></li>
      <li><a href="#exhalation-valve" id="markdown-toc-exhalation-valve">Exhalation valve</a></li>
      <li><a href="#inhalation-valves" id="markdown-toc-inhalation-valves">Inhalation valves</a></li>
      <li><a href="#also-use-a-surgical-mask" id="markdown-toc-also-use-a-surgical-mask">Also use a surgical mask</a></li>
      <li><a href="#choice-of-respirator-1" id="markdown-toc-choice-of-respirator-1">Choice of respirator</a></li>
    </ol>
  </li>
  <li><a href="#potential-concerns" id="markdown-toc-potential-concerns">Potential concerns</a>    <ol>
      <li><a href="#repeated-use" id="markdown-toc-repeated-use">Repeated use</a></li>
      <li><a href="#cdc-guidelines" id="markdown-toc-cdc-guidelines">CDC guidelines</a></li>
      <li><a href="#concerns-specific-to-tape-method" id="markdown-toc-concerns-specific-to-tape-method">Concerns specific to tape method</a>        <ol>
          <li><a href="#c02-rebreathing" id="markdown-toc-c02-rebreathing">C02 rebreathing</a></li>
          <li><a href="#exhaling-through-filter" id="markdown-toc-exhaling-through-filter">Exhaling through filter</a></li>
          <li><a href="#discussion-of-tape-technique-by-others" id="markdown-toc-discussion-of-tape-technique-by-others">Discussion of tape technique by others</a></li>
        </ol>
      </li>
    </ol>
  </li>
  <li><a href="#overall-recommendation" id="markdown-toc-overall-recommendation">Overall recommendation</a></li>
</ol>

<h1 id="elastomeric-respirators">Elastomeric respirators</h1>
<p>The effectiveness of a mask can be broken down into two parts: how well the mask fits on your face, and the filtration efficiency of the mask. A further important consideration is comfort.</p>

<p>Surgical and cloth masks are comfortable but have poor fit and filtration efficiency. I believe it’s possible to do much better.</p>

<p>Respirators that meet the NIOSH <a href="https://en.wikipedia.org/wiki/NIOSH_air_filtration_rating">N95 or N99 standards</a> for filtration efficiency, such as the N95 respirators pictured below, are popular in healthcare settings.</p>

<div style="display: flex">
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-400-9ff3ae8a4.webp 400w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-600-9ff3ae8a4.webp 600w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-800-9ff3ae8a4.webp 800w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-937-9ff3ae8a4.webp 937w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-400-9ff3ae8a4.jpeg 400w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-600-9ff3ae8a4.jpeg 600w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-800-9ff3ae8a4.jpeg 800w, /generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-937-9ff3ae8a4.jpeg 937w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3M_N95_Particulate_Respirator-800-9ff3ae8a4.png" width="937" height="765" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/n95_sailor-400-453c40a15.webp 400w, /generated/_posts/../assets/images/mask/n95_sailor-600-453c40a15.webp 600w, /generated/_posts/../assets/images/mask/n95_sailor-800-453c40a15.webp 800w, /generated/_posts/../assets/images/mask/n95_sailor-1000-453c40a15.webp 1000w, /generated/_posts/../assets/images/mask/n95_sailor-1280-453c40a15.webp 1280w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/n95_sailor-400-453c40a15.jpeg 400w, /generated/_posts/../assets/images/mask/n95_sailor-600-453c40a15.jpeg 600w, /generated/_posts/../assets/images/mask/n95_sailor-800-453c40a15.jpeg 800w, /generated/_posts/../assets/images/mask/n95_sailor-1000-453c40a15.jpeg 1000w, /generated/_posts/../assets/images/mask/n95_sailor-1280-453c40a15.jpeg 1280w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/n95_sailor-800-453c40a15.webp" width="1280" height="914" /></picture>

</div>
<p><em>3M N95 respirator (left), N95 respirator in a medical setting (right)</em></p>

<p>In my experience, these have two main downsides:</p>
<ul>
  <li>They may be scarce during pandemics. You should probably leave limited supplies for healthcare workers.</li>
  <li>The tight elastic band that ensures a good fit also makes the respirators very uncomfortable for extended use.</li>
</ul>

<p>KN95 and KF95 are respectively the Chinese and Korean-manufactured masks that claim to have the same efficacy as N95s. They come with ear loops rather than behind-the-head elastic bands, so they have a far looser seal than N95s. I suppose you could add your own elastic bands to them to improve the seal, but then they would be just as uncomfortable as N95s. Therefore, they are not a competitive option.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/kn95_stock-400-d0f6b341d.webp 400w, /generated/_posts/../assets/images/mask/kn95_stock-600-d0f6b341d.webp 600w, /generated/_posts/../assets/images/mask/kn95_stock-800-d0f6b341d.webp 800w, /generated/_posts/../assets/images/mask/kn95_stock-1000-d0f6b341d.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/kn95_stock-400-d0f6b341d.jpeg 400w, /generated/_posts/../assets/images/mask/kn95_stock-600-d0f6b341d.jpeg 600w, /generated/_posts/../assets/images/mask/kn95_stock-800-d0f6b341d.jpeg 800w, /generated/_posts/../assets/images/mask/kn95_stock-1000-d0f6b341d.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/kn95_stock-800-d0f6b341d.webp" width="1000" height="1000" /></picture>

<p><em>A KN95 mask</em></p>

<p>There also exist N95+ masks designed for industrial tasks that produce harmful airborne particles (such as welding or paint spraying). They are called elastomeric respirators, or sometimes industrial respirators.</p>

<div style="display: flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_respirator_stock-400-0e0a7a7ce.webp 400w, /generated/_posts/../assets/images/mask/miller_respirator_stock-600-0e0a7a7ce.webp 600w, /generated/_posts/../assets/images/mask/miller_respirator_stock-800-0e0a7a7ce.webp 800w, /generated/_posts/../assets/images/mask/miller_respirator_stock-1000-0e0a7a7ce.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_respirator_stock-400-0e0a7a7ce.jpeg 400w, /generated/_posts/../assets/images/mask/miller_respirator_stock-600-0e0a7a7ce.jpeg 600w, /generated/_posts/../assets/images/mask/miller_respirator_stock-800-0e0a7a7ce.jpeg 800w, /generated/_posts/../assets/images/mask/miller_respirator_stock-1000-0e0a7a7ce.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_respirator_stock-800-0e0a7a7ce.webp" width="1000" height="1000" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-400-2da96cc5c.webp 400w, /generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-600-2da96cc5c.webp 600w, /generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-800-2da96cc5c.webp 800w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-400-2da96cc5c.jpeg 400w, /generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-600-2da96cc5c.jpeg 600w, /generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-800-2da96cc5c.jpeg 800w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m-half-facepiece-reusable-respirator-800-2da96cc5c.webp" width="800" height="800" /></picture>

</div>
<p><em>High filtration efficiency elastomeric respirators for industrial use. Miller LPR-100 (left), 3M 6200 (right).</em></p>

<p>Compared to healthcare N95s, these respirators:</p>
<ul>
  <li>are more widely available</li>
  <li>achieve superior fit by using elastomers shaped like a human face (there is no need to bend a metal nose bridge)</li>
  <li>are <strong>much more comfortable</strong>, mainly because they:
    <ul>
      <li>spread the pressure onto a wider area of skin</li>
      <li>come in multiple sizes</li>
      <li>have adjustable straps</li>
    </ul>
  </li>
  <li>won’t fog up your glasses</li>
</ul>

<p>A downside is that it’s more difficult to be audible through an elastomeric respirator than through an N95 or surgical mask. I am able to be understood by raising my voice, but smooth social interactions are not guaranteed. It’s probably not a great setup for spending time with your friends; you can use a KN95 for that.</p>

<p>The fatal flaw<sup id="fnref:fatal" role="doc-noteref"><a href="#fn:fatal" class="footnote" rel="footnote">1</a></sup> of these elastomerics when it comes to disease control is that they have an exhalation valve that allows unfiltered air to exit the mask. In PPE jargon, they do not provide source control. (This may be about to change in 2021, see this footnote<sup id="fnref:MSA" role="doc-noteref"><a href="#fn:MSA" class="footnote" rel="footnote">2</a></sup>. I will try to keep this post updated.)</p>

<video loop="" muted="" controls="" style="max-height: 75vh; max-width: 50%">
  <source src="../assets/images/mask/valve.webm" type="video/webm" />
  Your browser does not support the video tag.
</video>
<p><em>The exhalation valve opening on the Miller LPR-100</em></p>

<p>We can modify these respirators to filter their exhalation valve (recommendaton A), or completely close it off (recommendation B).</p>

<p>(If infection through the mucosal lining of the eyes is an important concern to you, and you don’t wear glasses, you should also wear safety googgles.)</p>

<h1 id="cdc-recommendation-for-exhalation-valves">CDC recommendation for exhalation valves</h1>
<p>During the 2020 pandemic, the US CDC issued the following recommendation, in a <a href="https://blogs.cdc.gov/niosh-science-blog/2020/09/08/source-control/">blog post</a> from August 8 2020<sup id="fnref:cdc" role="doc-noteref"><a href="#fn:cdc" class="footnote" rel="footnote">3</a></sup>:</p>
<blockquote>
  <p>If only a respirator with an exhalation valve is available and source control is needed, cover the exhalation valve with a surgical mask, procedure mask, or a cloth face covering that does not interfere with the respirator fit.</p>
</blockquote>

<h1 id="recommendation-a-3m-6500ql-series-with-kn95-and-surgical-mask">Recommendation A: 3M 6500QL Series with KN95 and surgical mask</h1>
<p>If you want to follow something similar to CDC guidance, I recommend:</p>
<ul>
  <li>A <a href="https://www.3m.com/3M/en_US/worker-health-safety-us/personal-protective-equipment/half-face-respirator/">3M 6500QL series</a> respirator</li>
  <li>A part of a KN95/KF95 mask tightly covering the exhalation valve</li>
</ul>

<div style="display: flex">
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_original-400-79f8b4203.webp 400w, /generated/_posts/../assets/images/mask/3m_original-600-79f8b4203.webp 600w, /generated/_posts/../assets/images/mask/3m_original-800-79f8b4203.webp 800w, /generated/_posts/../assets/images/mask/3m_original-1000-79f8b4203.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_original-400-79f8b4203.jpeg 400w, /generated/_posts/../assets/images/mask/3m_original-600-79f8b4203.jpeg 600w, /generated/_posts/../assets/images/mask/3m_original-800-79f8b4203.jpeg 800w, /generated/_posts/../assets/images/mask/3m_original-1000-79f8b4203.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_original-800-79f8b4203.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_0-400-cab8cbe33.webp 400w, /generated/_posts/../assets/images/mask/3m_modified_0-600-cab8cbe33.webp 600w, /generated/_posts/../assets/images/mask/3m_modified_0-800-cab8cbe33.webp 800w, /generated/_posts/../assets/images/mask/3m_modified_0-1000-cab8cbe33.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_0-400-cab8cbe33.jpeg 400w, /generated/_posts/../assets/images/mask/3m_modified_0-600-cab8cbe33.jpeg 600w, /generated/_posts/../assets/images/mask/3m_modified_0-800-cab8cbe33.jpeg 800w, /generated/_posts/../assets/images/mask/3m_modified_0-1000-cab8cbe33.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_modified_0-800-cab8cbe33.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_1-400-0a30308c7.webp 400w, /generated/_posts/../assets/images/mask/3m_modified_1-600-0a30308c7.webp 600w, /generated/_posts/../assets/images/mask/3m_modified_1-800-0a30308c7.webp 800w, /generated/_posts/../assets/images/mask/3m_modified_1-1000-0a30308c7.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_1-400-0a30308c7.jpeg 400w, /generated/_posts/../assets/images/mask/3m_modified_1-600-0a30308c7.jpeg 600w, /generated/_posts/../assets/images/mask/3m_modified_1-800-0a30308c7.jpeg 800w, /generated/_posts/../assets/images/mask/3m_modified_1-1000-0a30308c7.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_modified_1-800-0a30308c7.webp" width="1000" height="1333" /></picture>

</div>
<p><em>3M 6502QL. Unmodified (left), KN95 material covering valve (middle and right)</em></p>

<p>You’ll likely want to add a surgical mask on top of that:</p>
<ul>
  <li>as a backup</li>
  <li>for the very small amount of additional filtration it provides</li>
  <li>to avoid misunderstandings with strangers</li>
</ul>

<div style="width: 33%">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_surgical-400-ff0920183.webp 400w, /generated/_posts/../assets/images/mask/3m_modified_surgical-600-ff0920183.webp 600w, /generated/_posts/../assets/images/mask/3m_modified_surgical-800-ff0920183.webp 800w, /generated/_posts/../assets/images/mask/3m_modified_surgical-1000-ff0920183.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_surgical-400-ff0920183.jpeg 400w, /generated/_posts/../assets/images/mask/3m_modified_surgical-600-ff0920183.jpeg 600w, /generated/_posts/../assets/images/mask/3m_modified_surgical-800-ff0920183.jpeg 800w, /generated/_posts/../assets/images/mask/3m_modified_surgical-1000-ff0920183.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_modified_surgical-800-ff0920183.webp" width="1000" height="1333" /></picture>
</div>
<p><em>3M 6502QL with KN95 material covering valve and a surgical mask on top</em></p>

<p>Surgical masks are not primarily designed to filter aerosols<sup id="fnref:surgical_fda" role="doc-noteref"><a href="#fn:surgical_fda" class="footnote" rel="footnote">4</a></sup>. It seems clear to me that KN95s and KF95s are superior to a surgical mask for covering an exhalation valve (let a alone a cloth mask). (There is a <a href="https://www.fda.gov/medical-devices/coronavirus-disease-2019-covid-19-emergency-use-authorizations-medical-devices/personal-protective-equipment-euas">list</a> of such respirators that have received an emergency use authorization from the FDA. There are probably many low-quality masks fraudulently marketed as KN95 and KF95 at the moment, so make sure you buy from an approved manufacturer.)</p>

<p>In the models I have seen, the material in KN95s is far more flexible than in N95s, making allowing you to shape it so that it tightly covers an exhalation valve. It’s slightly fiddly but definitely possible with a bit of dexterity and perseverance. Using a thinner surgical mask would be easier; but the KN95’s  extra protection for third parties is well worth it.</p>

<p>Here are the steps you should follow (see video):</p>
<ul>
  <li>cut a KN95 in half along the fold</li>
  <li>cut one half to size further</li>
  <li>use a rubber band and tape to attach the material over the respirator valve. This is better explained with a video than in words. The main thing to know is that you should use the two small ridges in the plastic below the valve to secure the rubber band.</li>
  <li>add tape on the upper end of the KN95 material</li>
</ul>

<video controls="" style="max-height: 100vh; max-width:100%">
  <source src="../assets/images/mask/instructions.webm" type="video/webm" />
  Your browser does not support the video tag.
</video>
<p><em>Instructions</em></p>

<p>Unfortunately, for any valve covering approach, there is a trade-off between a fit and the surface area usable for exhale filtration. I have not been able to achieve a good fit when placing a KN95 or surgical mask more loosely over the valve, which would give more surface area. In my setup a small rectangle of KN95 has to do all the filtration, which likely lowers the efficiency. However, the N95 specification is for a flow rate of 85 liters per minute, which is many times the 6 liters per minute breathed by an individual at rest<sup id="fnref:flowrate" role="doc-noteref"><a href="#fn:flowrate" class="footnote" rel="footnote">5</a></sup>, so I am not very concerned.</p>

<picture class="small-img"><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/ridges-400-da75ccb1b.webp 400w, /generated/_posts/../assets/images/mask/ridges-600-da75ccb1b.webp 600w, /generated/_posts/../assets/images/mask/ridges-800-da75ccb1b.webp 800w, /generated/_posts/../assets/images/mask/ridges-1000-da75ccb1b.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/ridges-400-da75ccb1b.jpeg 400w, /generated/_posts/../assets/images/mask/ridges-600-da75ccb1b.jpeg 600w, /generated/_posts/../assets/images/mask/ridges-800-da75ccb1b.jpeg 800w, /generated/_posts/../assets/images/mask/ridges-1000-da75ccb1b.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/ridges-800-da75ccb1b.webp" width="1000" height="1333" /></picture>

<p><em>Ridges on 6502QL. Note that in the real setup the KN95 will go below the elastic band.</em></p>

<picture class="small-img"><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-400-ce4472a40.webp 400w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-600-ce4472a40.webp 600w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-800-ce4472a40.webp 800w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-1000-ce4472a40.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-400-ce4472a40.jpeg 400w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-600-ce4472a40.jpeg 600w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-800-ce4472a40.jpeg 800w, /generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-1000-ce4472a40.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_modified_valve_rectangle-800-ce4472a40.webp" width="1000" height="750" /></picture>

<p><em>Location of the valve underneath the KN95 material. View form below the respirator.</em></p>

<h2 id="choice-of-respirator">Choice of respirator</h2>
<p>I have tried two industrial respirator models, the <a href="https://www.google.com/search?q=3M%206502QL">3M 6502QL</a> and the <a href="https://www.google.com/search?q=miller+lpr-100">Miller LPR-100</a>. I prefer the build quality and aesthetics of the Miller (see <a href="#choice-of-respirator-1">below</a>), but its shape makes it almost impossible to get a good seal if you attempt to cover the valve with a surgical mask or KN95. So for this technique, I recommend the <a href="https://www.google.com/search?q=3M+6500QL+series">3M 6500QL series</a>.</p>

<p>I am aware of three 3M half-facepiece reusable respirator groups, the 6000 series, the 6500 series, and the 7500 series.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_lineup-400-22a9e97d7.webp 400w, /generated/_posts/../assets/images/mask/3m_lineup-600-22a9e97d7.webp 600w, /generated/_posts/../assets/images/mask/3m_lineup-800-22a9e97d7.webp 800w, /generated/_posts/../assets/images/mask/3m_lineup-1000-22a9e97d7.webp 1000w, /generated/_posts/../assets/images/mask/3m_lineup-1392-22a9e97d7.webp 1392w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_lineup-400-22a9e97d7.jpeg 400w, /generated/_posts/../assets/images/mask/3m_lineup-600-22a9e97d7.jpeg 600w, /generated/_posts/../assets/images/mask/3m_lineup-800-22a9e97d7.jpeg 800w, /generated/_posts/../assets/images/mask/3m_lineup-1000-22a9e97d7.jpeg 1000w, /generated/_posts/../assets/images/mask/3m_lineup-1392-22a9e97d7.jpeg 1392w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_lineup-800-22a9e97d7.webp" width="1392" height="454" /></picture>

<p><em>3M half-facepiece reusable respirators (<a href="https://www.3m.com/3M/en_US/company-us/all-3m-products/~/All-3M-Products/Personal-Protective-Equipment/Reusable-Respirators/?N=5002385+8711017+8720539+8720550+3294857497&amp;rt=r3">3M.com</a>)</em></p>

<p>Since I have only tried a respirator of the 6500 series, I do not have a strong view on which is preferable. I would recommend the 6500, mostly because I have already demonstrated that it’s possible to cover the valve. The 6000 series does not have a downward-facing exhalation valve and may be harder to work with. I’m agnostic about the relative merits of the 7500.</p>

<p>The 6500 series has a quick latch version (difference explained <a href="https://www.3m.com/3M/en_US/worker-health-safety-us/personal-protective-equipment/half-face-respirator/">here</a>), which is the one I used. I’d recommend the quick latch 6500QL series, because it seems that the latch makes the fit of the KN95 material to the respirator more secure (see video). By the way, attaching a mask on top of the valve makes the quick-latch mechanism much less effective; I never use it.</p>

<p>Each series comes in three sizes, large, medium and small. I am a male with a medium-to-large head, and I use a medium (the 6502QL).</p>

<p>Regarding whether airlines will accept this setup, I have heard both some positive anecdotes and one negative anecdote.</p>

<h2 id="choice-of-filters-for-a-3m-respirator">Choice of filters for a 3M respirator</h2>
<p>I use the 3M 2097 P100 filters.</p>

<p>You should use lightweight filters that are rated N100, R100 or P100. The “100” <a href="https://en.wikipedia.org/wiki/NIOSH_air_filtration_rating">means</a> that 99.97% of particles smaller than 0.3 micrometres are filtered out. The letters N, R and P refer to whether the filter is still effective when exposed to oil-based aerosols, this should be irrelevant for our purposes.</p>

<p>The weight of the filters is a crucial determinant of comfort. I originally used the 3M respirator with the 3M 60926 cartridges, which filter gases and vapors as well as particles. This was a mistake, as filtering gases and vapors is irrelevant from the point of view of infectious disease, and these cartridges are much heavier than the 3M 2097 P100 filters. Switching to the lighter filters made a world of difference; now wearing the 3M doesn’t bother me at all.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_weight_cartridge-400-e627409fd.webp 400w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-600-e627409fd.webp 600w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-800-e627409fd.webp 800w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-1000-e627409fd.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_weight_cartridge-400-e627409fd.jpeg 400w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-600-e627409fd.jpeg 600w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-800-e627409fd.jpeg 800w, /generated/_posts/../assets/images/mask/3m_weight_cartridge-1000-e627409fd.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_weight_cartridge-800-e627409fd.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_weight_filter-400-efcb87a83.webp 400w, /generated/_posts/../assets/images/mask/3m_weight_filter-600-efcb87a83.webp 600w, /generated/_posts/../assets/images/mask/3m_weight_filter-800-efcb87a83.webp 800w, /generated/_posts/../assets/images/mask/3m_weight_filter-1000-efcb87a83.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/3m_weight_filter-400-efcb87a83.jpeg 400w, /generated/_posts/../assets/images/mask/3m_weight_filter-600-efcb87a83.jpeg 600w, /generated/_posts/../assets/images/mask/3m_weight_filter-800-efcb87a83.jpeg 800w, /generated/_posts/../assets/images/mask/3m_weight_filter-1000-efcb87a83.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/3m_weight_filter-800-efcb87a83.webp" width="1000" height="1333" /></picture>

</div>
<p><em>The 3M 6502QL respirator weighs 395 g. with 3M 60926 cartridges, but only 128 g. with 3M 2097 filters, a 68% reduction.</em></p>

<h1 id="recommmendation-b-miller-lpr-100-with-tape-and-surgical-mask">Recommmendation B: Miller LPR-100 with tape and surgical mask</h1>
<p>I believe that, in expectation, the previous method offers slightly worse protection to third parties than a well-fit valveless medical N95, because our makeshift exhalation valve filter may not be entirely effective.</p>

<p>This section details another technique which may be able to achieve the best of both worlds: the comfort and availability of industrial masks, and the third-party protection offered by valveless masks.</p>

<h2 id="how-we-need-to-modify-the-respirator">How we need to modify the respirator</h2>
<p>Let’s look at how the valves in industrial masks work. I’ll be using the Miller LPR-100, but the 3M is built similarly.</p>

<p>The exhalation valve is at the front. There are also two inhalation valves, one on each side between the mouth and the filter. These only allow air to come into the mask from outside, forcing all the exhaled air to go through the exhalation valve (instead of some of it going back through the filter).</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_0-400-488f8c69b.webp 400w, /generated/_posts/../assets/images/mask/miller_valves_0-600-488f8c69b.webp 600w, /generated/_posts/../assets/images/mask/miller_valves_0-800-488f8c69b.webp 800w, /generated/_posts/../assets/images/mask/miller_valves_0-1000-488f8c69b.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_0-400-488f8c69b.jpeg 400w, /generated/_posts/../assets/images/mask/miller_valves_0-600-488f8c69b.jpeg 600w, /generated/_posts/../assets/images/mask/miller_valves_0-800-488f8c69b.jpeg 800w, /generated/_posts/../assets/images/mask/miller_valves_0-1000-488f8c69b.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_valves_0-800-488f8c69b.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_1-400-342890c94.webp 400w, /generated/_posts/../assets/images/mask/miller_valves_1-600-342890c94.webp 600w, /generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.webp 800w, /generated/_posts/../assets/images/mask/miller_valves_1-1000-342890c94.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_1-400-342890c94.jpeg 400w, /generated/_posts/../assets/images/mask/miller_valves_1-600-342890c94.jpeg 600w, /generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.jpeg 800w, /generated/_posts/../assets/images/mask/miller_valves_1-1000-342890c94.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.webp" width="1000" height="1333" /></picture>

</div>
<p><em>Miller  LPR-100 valves</em></p>

<p>We need to disable both the inhalation and exhalation valves:</p>
<ul>
  <li>The unfiltered exhalation valve should be completely sealed off.</li>
  <li>In order to allow the user to exhale, the inhalation valves need to be turned into simple holes that allow two-way air circulation.</li>
</ul>

<p>This will mean that both inhaled and exhaled air will go through the P100 filters.</p>

<h2 id="exhalation-valve">Exhalation valve</h2>
<p>We can seal off the exhalation valve from the outside with tape<sup id="fnref:altmethods" role="doc-noteref"><a href="#fn:altmethods" class="footnote" rel="footnote">6</a></sup>. On the Miller respirator, there is a little plastic cage covering the valve, and this cage can be taped over. Note that tape sticks very poorly to the elastomer (the dark blue material on the Miller). This is why I only place tape on the plastic; this seems to be sufficient.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/tape_0-400-5c6043b88.webp 400w, /generated/_posts/../assets/images/mask/tape_0-600-5c6043b88.webp 600w, /generated/_posts/../assets/images/mask/tape_0-800-5c6043b88.webp 800w, /generated/_posts/../assets/images/mask/tape_0-1000-5c6043b88.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/tape_0-400-5c6043b88.jpeg 400w, /generated/_posts/../assets/images/mask/tape_0-600-5c6043b88.jpeg 600w, /generated/_posts/../assets/images/mask/tape_0-800-5c6043b88.jpeg 800w, /generated/_posts/../assets/images/mask/tape_0-1000-5c6043b88.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/tape_0-800-5c6043b88.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/tape_1-400-04e5dc9b1.webp 400w, /generated/_posts/../assets/images/mask/tape_1-600-04e5dc9b1.webp 600w, /generated/_posts/../assets/images/mask/tape_1-800-04e5dc9b1.webp 800w, /generated/_posts/../assets/images/mask/tape_1-1000-04e5dc9b1.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/tape_1-400-04e5dc9b1.jpeg 400w, /generated/_posts/../assets/images/mask/tape_1-600-04e5dc9b1.jpeg 600w, /generated/_posts/../assets/images/mask/tape_1-800-04e5dc9b1.jpeg 800w, /generated/_posts/../assets/images/mask/tape_1-1000-04e5dc9b1.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/tape_1-800-04e5dc9b1.webp" width="1000" height="750" /></picture>

</div>
<p><em>Tape on exhalation cage</em></p>

<p>I am using <a href="https://www.amazon.com/gp/product/B00004Z4DU/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&amp;psc=1">painter’s tape</a> because it’s supposed to pull off without leaving a residue of glue. It’s possible that it would be better to use tape with a stronger adhesive. (A friend of mine commented: “Some ideas for sealing off the exhalation valve: (1) Butyl tape/self-vulcanizing tape. Not so much a sticky tape as a ribbon of moldable putty, so no adhesive residue. This stuff is pretty much unparalleled if you need to make a fully gas- and watertight seal around an irregularly shaped opening in a pinch without making a mess. The fact that it has no adhesive does put some constraints on the geometry of the part you’re sealing off, but I think it would work (better than painter’s tape, at least) on the Miller. (2) Vinyl tape/electrical tape. It’s relatively water-resistant and can be stretched to some extent. The adhesive also sticks to polymers pretty well (although it does leave a lot of residue after some time, but you can clean that off with a bit of IPA).”)</p>

<p>You can check the seal of your tape by pressing the mask onto your face and attempting to exhale (with the inhalation valves intact). Air should only be able to escape through the sides of the mask.</p>

<h2 id="inhalation-valves">Inhalation valves</h2>
<p>The inhalation valves are removable and can be pulled out. They are very thin and feel like they might be about to break when you pull them out, but I have been able to pull four of them out without a problem.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_1-400-342890c94.webp 400w, /generated/_posts/../assets/images/mask/miller_valves_1-600-342890c94.webp 600w, /generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.webp 800w, /generated/_posts/../assets/images/mask/miller_valves_1-1000-342890c94.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_valves_1-400-342890c94.jpeg 400w, /generated/_posts/../assets/images/mask/miller_valves_1-600-342890c94.jpeg 600w, /generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.jpeg 800w, /generated/_posts/../assets/images/mask/miller_valves_1-1000-342890c94.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_valves_1-800-342890c94.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valve_hand-400-3951092cf.webp 400w, /generated/_posts/../assets/images/mask/valve_hand-600-3951092cf.webp 600w, /generated/_posts/../assets/images/mask/valve_hand-800-3951092cf.webp 800w, /generated/_posts/../assets/images/mask/valve_hand-1000-3951092cf.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valve_hand-400-3951092cf.jpeg 400w, /generated/_posts/../assets/images/mask/valve_hand-600-3951092cf.jpeg 600w, /generated/_posts/../assets/images/mask/valve_hand-800-3951092cf.jpeg 800w, /generated/_posts/../assets/images/mask/valve_hand-1000-3951092cf.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/valve_hand-800-3951092cf.webp" width="1000" height="1333" /></picture>

</div>
<p><em>Touching a valve (left), a valve after it has been pulled out (right)</em></p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valves_plugs-400-ccc9d3508.webp 400w, /generated/_posts/../assets/images/mask/valves_plugs-600-ccc9d3508.webp 600w, /generated/_posts/../assets/images/mask/valves_plugs-800-ccc9d3508.webp 800w, /generated/_posts/../assets/images/mask/valves_plugs-1000-ccc9d3508.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valves_plugs-400-ccc9d3508.jpeg 400w, /generated/_posts/../assets/images/mask/valves_plugs-600-ccc9d3508.jpeg 600w, /generated/_posts/../assets/images/mask/valves_plugs-800-ccc9d3508.jpeg 800w, /generated/_posts/../assets/images/mask/valves_plugs-1000-ccc9d3508.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/valves_plugs-800-ccc9d3508.webp" width="1000" height="750" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valves_removed_0-400-4368e7f30.webp 400w, /generated/_posts/../assets/images/mask/valves_removed_0-600-4368e7f30.webp 600w, /generated/_posts/../assets/images/mask/valves_removed_0-800-4368e7f30.webp 800w, /generated/_posts/../assets/images/mask/valves_removed_0-1000-4368e7f30.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/valves_removed_0-400-4368e7f30.jpeg 400w, /generated/_posts/../assets/images/mask/valves_removed_0-600-4368e7f30.jpeg 600w, /generated/_posts/../assets/images/mask/valves_removed_0-800-4368e7f30.jpeg 800w, /generated/_posts/../assets/images/mask/valves_removed_0-1000-4368e7f30.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/valves_removed_0-800-4368e7f30.webp" width="1000" height="1333" /></picture>

</div>
<p><em>The two inhalation valves (left), the filter now visible through the holes (right)</em></p>

<p>Pushing the valves back in is easy.</p>

<p>The tape can be removed and the valves re-inserted, making my modification fully reversible.</p>

<h2 id="also-use-a-surgical-mask">Also use a surgical mask</h2>
<p>Even if you’re using the tape technique, I recommend also covering the respirator with a surgical mask, since this has no downsides and might have some benefit. The seal on the exhalation valve might not be perfect and may get worse over time, so an extra layer of filtration, however imperfect, is a good backup.</p>

<p>It’s also beneficial because it makes what you’re doing legible to others. You don’t want to explain this weird tape business to strangers, even if it’s for their protection.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_respirator_tom-400-6be8f0084.webp 400w, /generated/_posts/../assets/images/mask/miller_respirator_tom-600-6be8f0084.webp 600w, /generated/_posts/../assets/images/mask/miller_respirator_tom-800-6be8f0084.webp 800w, /generated/_posts/../assets/images/mask/miller_respirator_tom-1000-6be8f0084.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_respirator_tom-400-6be8f0084.jpeg 400w, /generated/_posts/../assets/images/mask/miller_respirator_tom-600-6be8f0084.jpeg 600w, /generated/_posts/../assets/images/mask/miller_respirator_tom-800-6be8f0084.jpeg 800w, /generated/_posts/../assets/images/mask/miller_respirator_tom-1000-6be8f0084.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_respirator_tom-800-6be8f0084.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_tape-400-73ec27c42.webp 400w, /generated/_posts/../assets/images/mask/miller_tape-600-73ec27c42.webp 600w, /generated/_posts/../assets/images/mask/miller_tape-800-73ec27c42.webp 800w, /generated/_posts/../assets/images/mask/miller_tape-1000-73ec27c42.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_tape-400-73ec27c42.jpeg 400w, /generated/_posts/../assets/images/mask/miller_tape-600-73ec27c42.jpeg 600w, /generated/_posts/../assets/images/mask/miller_tape-800-73ec27c42.jpeg 800w, /generated/_posts/../assets/images/mask/miller_tape-1000-73ec27c42.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_tape-800-73ec27c42.webp" width="1000" height="1333" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/industrial_w_surgical-400-4e056c075.webp 400w, /generated/_posts/../assets/images/mask/industrial_w_surgical-600-4e056c075.webp 600w, /generated/_posts/../assets/images/mask/industrial_w_surgical-800-4e056c075.webp 800w, /generated/_posts/../assets/images/mask/industrial_w_surgical-1000-4e056c075.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/industrial_w_surgical-400-4e056c075.jpeg 400w, /generated/_posts/../assets/images/mask/industrial_w_surgical-600-4e056c075.jpeg 600w, /generated/_posts/../assets/images/mask/industrial_w_surgical-800-4e056c075.jpeg 800w, /generated/_posts/../assets/images/mask/industrial_w_surgical-1000-4e056c075.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/industrial_w_surgical-800-4e056c075.webp" width="1000" height="1333" /></picture>

</div>
<p><em>Miller LPR-100. Unmodified (left), with tape (middle), with tape and surgical mask (right)</em></p>

<h2 id="choice-of-respirator-1">Choice of respirator</h2>
<p>For this technique, I recommend the <a href="https://www.google.com/search?q=miller+lpr-100">Miller LPR-100</a><sup id="fnref:m" role="doc-noteref"><a href="#fn:m" class="footnote" rel="footnote">7</a></sup>.</p>

<p>I recommend the Miller over the 3M because:</p>
<ul>
  <li>its build quality feels superior to me</li>
  <li>it looks better</li>
  <li>it blocks less of your field of view</li>
</ul>

<p>Since the Miller is better than the 3M, and 3M is such a huge player in this market, I think there’s a decent chance that the Miller is in fact one of the very best options that exists.</p>

<p>The Miller weighs 139 g., which is a negligible difference to the 3M’s 128 g</p>

<p>I also like the fact that you can buy a neat <a href="https://www.google.com/search?q=miller%20283374">rigid case</a> to hold the Miller respirator. The case is called the 283374.</p>

<div class="display-flex">

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_case_0-400-d7326b5fe.webp 400w, /generated/_posts/../assets/images/mask/miller_case_0-600-d7326b5fe.webp 600w, /generated/_posts/../assets/images/mask/miller_case_0-800-d7326b5fe.webp 800w, /generated/_posts/../assets/images/mask/miller_case_0-1000-d7326b5fe.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_case_0-400-d7326b5fe.jpeg 400w, /generated/_posts/../assets/images/mask/miller_case_0-600-d7326b5fe.jpeg 600w, /generated/_posts/../assets/images/mask/miller_case_0-800-d7326b5fe.jpeg 800w, /generated/_posts/../assets/images/mask/miller_case_0-1000-d7326b5fe.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_case_0-800-d7326b5fe.webp" width="1000" height="750" /></picture>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_case_1-400-67c7aeffb.webp 400w, /generated/_posts/../assets/images/mask/miller_case_1-600-67c7aeffb.webp 600w, /generated/_posts/../assets/images/mask/miller_case_1-800-67c7aeffb.webp 800w, /generated/_posts/../assets/images/mask/miller_case_1-1000-67c7aeffb.webp 1000w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/miller_case_1-400-67c7aeffb.jpeg 400w, /generated/_posts/../assets/images/mask/miller_case_1-600-67c7aeffb.jpeg 600w, /generated/_posts/../assets/images/mask/miller_case_1-800-67c7aeffb.jpeg 800w, /generated/_posts/../assets/images/mask/miller_case_1-1000-67c7aeffb.jpeg 1000w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/miller_case_1-800-67c7aeffb.webp" width="1000" height="1333" /></picture>

</div>
<p><em>Miller case, 283374</em></p>

<p>The Miller model comes with replaceable P100-rated filters, while the 3M can be used with many types of filters and cartridges.</p>

<p>If you want to implement this technique on the 3M, it should be possible; all steps will be similar.</p>

<h1 id="potential-concerns">Potential concerns</h1>
<p>The 3M+KN95 method we discussed earlier can be seen as a simple adaptation of CDC guidelines, so I have fewer concerns about it.</p>

<p>However, the tape technique involves a more fundamental alteration. This might seem unwise. How do I know I haven’t messed up something crucial, endangering myself and others?</p>

<p>Before discussing the specific concerns, it’s useful to consider: what are the relevant alternatives to my recommendation?</p>

<p>My best guess is that constantly wearing a correctly fitted medical N95, with the really tight elastic bands, is very slightly safer for others in expectation than the tape method (due to risks of things going wrong, like the tape getting unstuck). However, it is not a likely alternative for everyday use. First, in my experience, N95s are more difficult to fit correctly than industrial masks. Second, for me, these respirators are prohibitively uncomfortable. I have seen few people use them. I think the realistic alternatives for most people are cloth and surgical masks. I am relatively confident that both of my techniques are an improvement on that, for both the user and third parties.</p>

<!-- The probability mass I assign to harm comes mostly from unknown unknowns and the fact that official agencies don't recommend my technique, not from any specific evidence of risks. -->

<!-- I currently don't plant to prioritize writing a full detailed justification of these beliefs for a sceptical audience. Writing such a thing is a great deal of effort and there are benefits to getting the idea out earlier. In order to let you come to the best conclusion for you given your knowledge and risk tolerance, I'm trying to lay out most of the evidence against my proposal that I've considered (without giving the full reasoning for why I find this evidence insufficiently persuasive on balance). -->

<p>By the way, I am not an expert in disease control. I studied economics and philosophy and then worked as a researcher.</p>

<h2 id="repeated-use">Repeated use</h2>
<p>Healthcare N95s are supposed to be used only once before being decontaminated. However, I plan to use the same filters many times. Is this a problem?</p>

<p>Why are N95s supposed to be used once? According to this <a href="https://www.cdc.gov/niosh/topics/hcwcontrols/recommendedguidanceextuse.html">CDC guidance</a>,</p>

<blockquote>
  <p>the most significant risk [of extended use and reuse] is of contact transmission from touching the surface of the contaminated respirator. … Respiratory pathogens on the respirator surface can potentially be transferred by touch to the wearer’s hands and thus risk causing infection through subsequent touching of the mucous membranes of the face. …</p>

  <p>While studies have shown that some respiratory pathogens remain infectious on respirator surfaces for extended periods of time, in microbial transfer [touching the respirator] and reaerosolization [coughing or sneezing through the respirator] studies more than ~99.8% have remained trapped on the respirator after handling or following simulated cough or sneeze.</p>
</blockquote>

<p>Since I plan to leave the respirator unused for hours or days between each use, and any viral dose on the exterior of the filters is likely to be very small, I don’t think this is a huge concern overall. I am very open to contrary evidence.</p>

<p>By the way, based on this guidance, it seems to me we should also worry less about reusing respirators and masks in general, even without decontamination. (Decontamination makes a lot more sense for health care workers who are exposed to COVID patients).</p>

<p>It’s good to remember to avoid touching the filters.</p>

<h2 id="cdc-guidelines">CDC guidelines</h2>
<p>As explained above, the CDC recommends a surgical or cloth mask to cover the valve. There is no evidence that they considered either of the techniques I described above when issuing their blog post.</p>

<p>The tape method is a greater deviation from the CDC guidelines than the KN95-covering method, so if you care about following official guidance you could use the latter.</p>

<h2 id="concerns-specific-to-tape-method">Concerns specific to tape method</h2>
<p>I assign a relatively low chance that the tape method is worse than the CDC recommendation of covering the valve with a surgical mask (my views depend considerably on the tightness of the surgical mask seal). 
and a very low chance that it’s worse than a surgical mask alone. The probability mass I assign to harm is a combination of concerns about exhaling through the filter reducing its efficacy, and unknown unknowns.</p>

<h3 id="c02-rebreathing">C02 rebreathing</h3>
<p>Without the valves, part of the air you inhale will be air that you just exhaled, which contains more C02. I have not personally noticed any effects from this.</p>

<h3 id="exhaling-through-filter">Exhaling through filter</h3>
<p>Could exhaling through the filter be a bad thing somehow? I wasn’t able to find any source making an explicit statement on this, but I think it’s unlikely to be a problem.</p>

<p>One reason to worry is that the founder of <a href="https://narwallmask.com/">Narwall Mask</a> has told me that, according to one filtration expert he spoke to, one-way airflow greatly prolongs the life of the filters compared to two-way airflow. However, based on my small amount of research, I don’t think the life of the filters would be affected to a degree that is practically important.</p>

<p>The MSA valveless elastomeric respirator that I mentioned in this footnote<sup id="fnref:MSA:1" role="doc-noteref"><a href="#fn:MSA" class="footnote" rel="footnote">2</a></sup> appears to have filters that can be used for more than 1 month of daily use during the workday; and moreover, we can see in the respirator’s <a href="https://msa.webdamdb.com/directdownload.php?ti=42341334&amp;tok=sKRw3WQqRXhcJ/V4EfuwtARR">brochure</a> that these filters, with model number 815369, are the same as those that are used in MSA’s line of regular, valved elastomeric respirators (see <a href="http://msa.webdamdb.com/bp/#/folder/1749983/50030424">here</a>). From this I conclude that: two-way airflow through regular P100 filters was considered an acceptable design choice by MSA; and these filters can be used two-way for at least a month of hospital use.</p>

<p>In addition, healthcare N95s (without valves) are designed to be exhaled through. They are only rated for a day of use, but I believe this is <em>not</em> because the filter loses efficacy (see <a href="#repeated-use">section on repeated use</a>).</p>

<p>Exhaled air has a <a href="https://en.wikipedia.org/wiki/Humidity#Relative_humidity">relative humidity</a> close to 100%. Could exposure to humid air reduce the efficacy of the filters? In <a href="https://academic.oup.com/annweh/article/59/5/629/2196149">this study</a> of N95 filters, the difference penetration rose from around 2% to around 4% when relative humidity went from 10% to 80%, and this effect increased with duration of continuous use. The flow rate was 85 L/min.</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/humidity_0-400-4dfe64496.webp 400w, /generated/_posts/../assets/images/mask/humidity_0-600-4dfe64496.webp 600w, /generated/_posts/../assets/images/mask/humidity_0-800-4dfe64496.webp 800w, /generated/_posts/../assets/images/mask/humidity_0-862-4dfe64496.webp 862w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/humidity_0-400-4dfe64496.jpeg 400w, /generated/_posts/../assets/images/mask/humidity_0-600-4dfe64496.jpeg 600w, /generated/_posts/../assets/images/mask/humidity_0-800-4dfe64496.jpeg 800w, /generated/_posts/../assets/images/mask/humidity_0-862-4dfe64496.jpeg 862w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/mask/humidity_0-800-4dfe64496.webp" width="862" height="574" /></picture>

<p><em>Combination of figures 3 and 5, <a href="https://academic.oup.com/annweh/article/59/5/629/2196149">Mahdavi et al.</a></em></p>

<p>Note that this study, which simulates inhalation of humid air, does not address (except very indirectly) the question of how the <em>exhalation</em> humidity affects the <em>inhalation</em> filtration.</p>

<h3 id="discussion-of-tape-technique-by-others">Discussion of tape technique by others</h3>
<ul>
  <li><a href="https://www.cdc.gov/niosh/docs/2021-107/pdfs/2021-107.pdf?id=10.26616/NIOSHPUB2021107">This NIOSH study</a> tested three modifications of valved respirators: covering the valve on the interior with surgical tape, covering the valve on the interior with an electrocardiogram (ECG) pad, and stretching a surgical mask over the exterior of the respirator.
    <ul>
      <li>They found that “penetration was 23% for the masked-over mitigation; penetration was 5% for the taped mitigation; penetration was 2% for the [ECG pad] mitigation”. I would be very interested in more discussion of why the ECG pad did so much better than the surgical tape, the authors don’t say much. One guess could be that the ECG pad has a more powerful adhesive, which would suggest that it’s important to choose a strongly adhesive tape if implementing my technique.</li>
      <li>When discussing the choice of modification strategies, the authors wrote that “two concerns are that the adhesive could pull away from the surface, thereby not blocking airflow to the same degree over time, and that these adhesives could contain chemicals that have toxicological effects.”</li>
    </ul>
  </li>
</ul>
<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/niosh_study-400-110a6dafd.webp 400w, /generated/_posts/../assets/images/mask/niosh_study-600-110a6dafd.webp 600w, /generated/_posts/../assets/images/mask/niosh_study-800-110a6dafd.webp 800w, /generated/_posts/../assets/images/mask/niosh_study-1000-110a6dafd.webp 1000w, /generated/_posts/../assets/images/mask/niosh_study-1040-110a6dafd.webp 1040w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/niosh_study-400-110a6dafd.jpeg 400w, /generated/_posts/../assets/images/mask/niosh_study-600-110a6dafd.jpeg 600w, /generated/_posts/../assets/images/mask/niosh_study-800-110a6dafd.jpeg 800w, /generated/_posts/../assets/images/mask/niosh_study-1000-110a6dafd.jpeg 1000w, /generated/_posts/../assets/images/mask/niosh_study-1040-110a6dafd.jpeg 1040w" type="image/jpeg" /><img alt="study" src="/generated/_posts/../assets/images/mask/niosh_study-800-110a6dafd.webp" width="1040" height="632" /></picture>

<ul>
  <li>In an <a href="https://multimedia.3m.com/mws/media/1791526O/respiratory-protection-faq-general-public-tb.pdf">FAQ released by 3M</a>, in response to the question of whether one should tape over the exhalation valve, they wrote “3M does not recommend that tape be placed over the exhalation valve”, but do not give any reasons for this beyond the fact that it may become “more difficult to breathe through … if the exhalation valve is taped shut”.</li>
  <li>The state of Maine’s Department of Public Safety <a href="https://www.maine.gov/ems/sites/maine.gov.ems/files/inline-files/2020-08-21%20Operational%20Bulletin%20Regarding%20Masks%20with%20Exhalation%20Valves.pdf">recommends against tape-covering</a>, but merely because “this would be considered altering the device and violates the manufacturer’s recommendation”.</li>
</ul>

<h1 id="overall-recommendation">Overall recommendation</h1>
<p>I think it’s about 50/50 which of my two methods is better all things considered. They’re close enough that I think the correct decision depends on how much you care about protecting yourself vs source control. If source control is a minor consideration to you, I’d go with the KN95 valve coverage method, otherwise the tape method.</p>

<p>(As I said in a previous footnote<sup id="fnref:MSA:2" role="doc-noteref"><a href="#fn:MSA" class="footnote" rel="footnote">2</a></sup>, if a valveless elastomeric mask is widely available by the time you read this, that is absolutely a superior option to the hacks I have developed.)</p>

<p>(The <a href="https://narwallmask.com/">Narwall Mask</a> is a commercial solution based on a snorkel mask that may be appealing if you don’t mind (i) the lack of NIOSH-approval and (ii) buying from a random startup, and (iii) you don’t mind or even prefer the full-facepiece design.)</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:fatal" role="doc-endnote">

      <p>Or is it fatal? I had always assumed it was a fatal flaw, until I found some experts arguing otherwise. In <a href="https://www.ajicjournal.org/article/S0196-6553(20)30888-9/fulltext">this commentary</a>, the authors say: “Data characterizing particle release through exhalation valves are presently lacking; it is our opinion that such release will be limited by the complex path particles must navigate through a valve. We expect that fewer respiratory aerosols escape through the exhalation valve than through and around surgical masks, unrated masks, or cloth face coverings, all of which have much less efficient filters and do not fit closely to the face”.</p>

      <p>I have been able to find some data; this <a href="https://www.cdc.gov/niosh/docs/2021-107/pdfs/2021-107.pdf?id=10.26616/NIOSHPUB2021107">recent NIOSH study</a> finds that valved N95s have 1-40% penetration. “some models … had less than 20% penetration even without any mitigation. Other models … had much greater penetration with a median penetration above 40%.” Note that for these tests, the flow rates of 25-85 L/min are higher than the 6 L/min of a person at rest, and that lower flow rates had lower penetration.</p>

      <p>Penetration rates of tens of percent are not very good, and not acceptable for my standards, but it’s less bad than I expected, perhaps competitive with surgical masks, and better than cloth masks!</p>

      <picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/niosh_study_fig5-400-3614910cb.webp 400w, /generated/_posts/../assets/images/mask/niosh_study_fig5-600-3614910cb.webp 600w, /generated/_posts/../assets/images/mask/niosh_study_fig5-800-3614910cb.webp 800w, /generated/_posts/../assets/images/mask/niosh_study_fig5-1000-3614910cb.webp 1000w, /generated/_posts/../assets/images/mask/niosh_study_fig5-1036-3614910cb.webp 1036w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/mask/niosh_study_fig5-400-3614910cb.jpeg 400w, /generated/_posts/../assets/images/mask/niosh_study_fig5-600-3614910cb.jpeg 600w, /generated/_posts/../assets/images/mask/niosh_study_fig5-800-3614910cb.jpeg 800w, /generated/_posts/../assets/images/mask/niosh_study_fig5-1000-3614910cb.jpeg 1000w, /generated/_posts/../assets/images/mask/niosh_study_fig5-1036-3614910cb.jpeg 1036w" type="image/jpeg" /><img alt="Niosh" src="/generated/_posts/../assets/images/mask/niosh_study_fig5-800-3614910cb.webp" width="1036" height="642" /></picture>
      <p><a href="#fnref:fatal" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:MSA" role="doc-endnote">

      <p>In fact, as of November 25 2020, the company MSA Safety announced in a <a href="https://www.prnewswire.com/news-releases/first-elastomeric-respirator-without-exhalation-valve-approved-by-niosh-301180276.html">press release</a> that the <strong>first elastomeric respirator without an exhalation valve has been approved by NIOSH</strong>. It’s called the Advantage 290 Respirator. The <a href="https://us.msasafety.com/p/0001000002W0001120">product page</a> has some good documentation.</p>

      <p>This <a href="https://www.journalacs.org/article/S1072-7515(20)30471-3/fulltext">journal article</a> from September 2020, although it does not mention MSA, appears to be about the Advantage 290. (This is based on the picture in Fig 1. resembling the picture in the press release, and the fact that the hospitals in the paper are in Pennsylvania and New York states, while MSA is headquartered in Pennsylvania). The article explains how it was rolled out to thousands of healthcare workers (a first wave had 1,840 users). They claim that the cost was “approximately $20 for an elastomeric mask and $10 per cartridge”, which is amazingly low.</p>

      <p>They write: “After more than 1 month of usage, we have found that filters have not needed to be changed more frequently than once a month”.</p>

      <p>Unfortunately, it seems to be difficult to get one’s hands on one of these right now. The website invites you to contact sales, and the lowest option for “your budget” is “less than $9,999”.</p>

      <p>Moreover, even if you were able to get the Advantage 290, it might be too selfish to do so, since this respirator is likely to otherwise be used by healthcare workers. On the other hand, the price signal you create would in expectation lead to greater quantities being produced, partially offsetting the effect. If you are able to get one by paying a large premium over the hospital price, this may even be net positive for others.</p>

      <p>If this respirator became available in large quantities, everything I say here would be obsolete.</p>

      <p>By the way, I am astonished that it took until this November 2020 for a PPE company to create a valveless elastomeric respirator, this seems to be a very useful product for any infectious disease situation. <a href="#fnref:MSA" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:MSA:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a> <a href="#fnref:MSA:2" class="reversefootnote" role="doc-backlink">&#8617;<sup>3</sup></a></p>
    </li>
    <li id="fn:cdc" role="doc-endnote">
      <p>It’s unclear to me how much one should downweight this recommendation due to appearing on a CDC blog rather than as more formal CDC guidance. In the post, the recommendations are called “tips”. <a href="#fnref:cdc" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:surgical_fda" role="doc-endnote">
      <p>The <a href="https://www.fda.gov/medical-devices/personal-protective-equipment-infection-control/n95-respirators-surgical-masks-and-face-masks#s2">FDA says</a>: “While a surgical mask may be effective in blocking splashes and large-particle droplets, a face mask, by design, does not filter or block very small particles in the air that may be transmitted by coughs, sneezes, or certain medical procedures.” <a href="#fnref:surgical_fda" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:flowrate" role="doc-endnote">
      <p>3M <a href="https://risk.arizona.edu/sites/default/files/3mrespiratorsandsurgicalmaskcomparison.pdf">claims</a> that “85 liters per minute (lpm) represents a very high work rate, equivalent to the breathing rate of an individual running at 10 miles an hour”. <a href="http://webcache.googleusercontent.com/search?q=cache:7nf66Oofo38J:www.umich.edu/~exphysio/mvs110lecture/Readings/Reading7PhysiolSupportSys.doc">These lecture notes</a> say that a person has a pulmonary ventilation of 6 L/min at rest, 75 L/min during moderate exercise, and 150L/min during vigorous exercise. <a href="#fnref:flowrate" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:altmethods" role="doc-endnote">
      <p>I tried two other methods before I settled on using tape: gluing a thin silicon wafer over the valve on the <em>inside</em> of the mask, and applying glue to the valve directly. Both these methods are entirely inferior and should not be used. <a href="#fnref:altmethods" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:m" role="doc-endnote">
      <p>The model number is ML00895 for the M/L size, and ML00894 for the S/M size. <a href="#fnref:m" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="DIY" /><category term="how to" /><summary type="html"><![CDATA[Summary: I have tried many types of masks and respirators during the 2020 pandemic. My recommendation is to use ‘elastomeric’ respirators common in industry, and to either filter or completely block off their exhalation valve. The result is a comfortable respirator that I believe offers a high level of protection against airborne diseases to myself and others. I am not an infectious disease expert.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/mask/social_image.PNG" /><media:content medium="image" url="https://bayes.net/assets/images/mask/social_image.PNG" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Efficient validity checking in monadic predicate logic</title><link href="https://bayes.net/monadic-predicate/" rel="alternate" type="text/html" title="Efficient validity checking in monadic predicate logic" /><published>2020-11-27T00:00:00+00:00</published><updated>2020-11-27T00:00:00+00:00</updated><id>https://bayes.net/monadic-predicate</id><content type="html" xml:base="https://bayes.net/monadic-predicate/"><![CDATA[<p>Monadic predicate logic (with identity) is decidable. (See Boolos, Burgess, and Jeffrey 2007, Ch. 21. The result goes back to Löwenheim-Skolem 1915).</p>

<p>How can we <a href="https://monadic-predicate.herokuapp.com/">write a program</a> to check whether a formula is logically valid (and hence also a theorem)?</p>

<p>First, we have to parse the formula, meaning to convert it form a string into a format that represents its syntax in a machine-readable way. That format is an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">abstract syntax tree</a> like this:</p>

<pre style="font-family:monospace">
Formula:
∀x(Ax→(Ax∧Bx))

Abstract syntax tree:
∀
├── x
└── →
    ├── A
    │   └── x
    └── ∧
        ├── A
        │   └── x
        └── B
            └── x
</pre>

<p>Writing the parser was a fun lesson in a fundamental aspect of computer science. But there was nothing novel about this exercise, and not much interesting to say about it.</p>

<p>The focus of this post, instead, is the part of the program that actually checks whether this syntax tree represents a logically valid formula.</p>

<p>To start with, we might try to evaluate the formula under every possible model of a given size. How big does the model need to be?</p>

<p>We can make use of the Löwenheim-Skolem theorem (looking first at the case without identity):</p>
<blockquote>
  <p>If a sentence of monadic predicate logic (without identity) is satisfiable, then it has a model of size no greater than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> is the number of predicates in the sentence. (Lemma 21.8 BBJ).</p>
</blockquote>

<p>A sentence’s negation is satisfiable if and only if the sentence is not valid, so the theorem equivalently states: a sentence is valid iff it is true under every model of size no greater than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span>.</p>

<p>For a sentence with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> predicates, every constant <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">c</span></span></span></span> in the model is assigned a list of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> truth-values, representing for each predicate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi></mrow><annotation encoding="application/x-tex">P</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span></span></span></span> whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi><mo stretchy="false">(</mo><mi>c</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">P(c)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">c</span><span class="mclose">)</span></span></span></span>. We can use <code class="language-plaintext highlighter-rouge">itertools</code> to find every possible such list, i.e. every possible assignment to a constant.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="n">k</span> <span class="o">=</span> <span class="mi">2</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">possible_predicate_combinations</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">itertools</span><span class="p">.</span><span class="n">product</span><span class="p">([</span><span class="bp">True</span><span class="p">,</span><span class="bp">False</span><span class="p">],</span><span class="n">repeat</span><span class="o">=</span><span class="n">k</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
</code></pre></div></div>

<p>The list of every possible assignment to a constant has a length of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span>.</p>

<p>We can then ask <code class="language-plaintext highlighter-rouge">itertools</code> to give us, for a model of size <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">m</span></span></span></span>, every possible combination of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">m</span></span></span></span> such lists of possible constant-assignments. We let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">m</span></span></span></span> be at most <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span>, because of the theorem.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="o">**</span><span class="n">k</span><span class="o">+</span><span class="mi">1</span><span class="p">):</span>
<span class="o">&gt;&gt;&gt;</span>     <span class="n">possible_models</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">itertools</span><span class="p">.</span><span class="n">product</span><span class="p">(</span><span class="n">possible_predicate_combinations</span><span class="p">,</span><span class="n">repeat</span><span class="o">=</span><span class="n">m</span><span class="p">)]</span>
<span class="o">&gt;&gt;&gt;</span>     <span class="k">print</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">possible_models</span><span class="p">),</span><span class="s">"possible models of size"</span><span class="p">,</span><span class="n">m</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span>     <span class="k">for</span> <span class="n">model</span> <span class="ow">in</span> <span class="n">possible_models</span><span class="p">:</span>
<span class="o">&gt;&gt;&gt;</span>         <span class="k">print</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">model</span><span class="p">))</span>

<span class="mi">4</span> <span class="n">possible</span> <span class="n">models</span> <span class="n">of</span> <span class="n">size</span> <span class="mi">1</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>

<span class="mi">16</span> <span class="n">possible</span> <span class="n">models</span> <span class="n">of</span> <span class="n">size</span> <span class="mi">2</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>

<span class="mi">64</span> <span class="n">possible</span> <span class="n">models</span> <span class="n">of</span> <span class="n">size</span> <span class="mi">3</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">...</span>

<span class="mi">256</span> <span class="n">possible</span> <span class="n">models</span> <span class="n">of</span> <span class="n">size</span> <span class="mi">4</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">)]</span>
<span class="p">[(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="bp">True</span><span class="p">),</span> <span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="bp">False</span><span class="p">)]</span>
<span class="p">...</span>
</code></pre></div></div>

<p>What’s unfortunate here is that for our <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span>-predicate sentence, we will need to check <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>m</mi><mo>=</mo><mn>1</mn></mrow><msup><mn>2</mn><mi>k</mi></msup></msubsup><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><msup><mo stretchy="false">)</mo><mi>m</mi></msup><mo>=</mo><mfrac><mrow><msup><mn>2</mn><mi>k</mi></msup><mo stretchy="false">(</mo><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><msup><mo stretchy="false">)</mo><msup><mn>2</mn><mi>k</mi></msup></msup><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><mrow><msup><mn>2</mn><mi>k</mi></msup><mo>−</mo><mn>1</mn></mrow></mfrac></mrow><annotation encoding="application/x-tex">\sum_{m=1}^{2^k} (2^k)^m =\frac{2^k ((2^k)^{2^k} - 1)}{2^k - 1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.4515em;vertical-align:-0.2997em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1518em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.2029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6644em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">m</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.7517em;vertical-align:-0.4158em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3359em;"><span style="top:-2.6426em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.782em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.485em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mopen mtight">((</span><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose mtight"><span class="mclose mtight">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.2156em;"><span style="top:-3.2156em;margin-right:0.0714em;"><span class="pstrut" style="height:2.7846em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0984em;"><span style="top:-3.0984em;margin-right:0.1em;"><span class="pstrut" style="height:2.6944em;"></span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="mbin mtight">−</span><span class="mord mtight">1</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.4158em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span> models. The sum is very roughly equal to its last term, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><msup><mo stretchy="false">)</mo><msup><mn>2</mn><mi>k</mi></msup></msup><mo>=</mo><msup><mn>2</mn><mrow><mi>k</mi><msup><mn>2</mn><mi>k</mi></msup></mrow></msup></mrow><annotation encoding="application/x-tex">(2^k)^{2^k} = 2^{k2^k}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2619em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0119em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0119em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0119em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>3</mn></mrow><annotation encoding="application/x-tex">k=3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3</span></span></span></span>, this is a number in the billions, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">k=4</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4</span></span></span></span>, it’s a number with 19 zeroes.</p>

<p>So checking every model is computationally impossible in practice. Fortunately, we can do better.</p>

<p>Let’s look back at the Löwenheim-Skolem theorem and try to understand why <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span> appears in it:</p>
<blockquote>
  <p>If a sentence of monadic predicate logic (without identity) is satisfiable, then it has a model of size no greater than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span> , where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> is the number of predicates in the sentence. (Lemma 21.8 BBJ).</p>
</blockquote>

<p>As we’ve seen, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">2^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span> is the number of possible combinations of predicates that can be true of a constant in the domain. Visually, this is the number of subsets in a <em><a href="https://en.wikipedia.org/wiki/Partition_of_a_set">partition</a></em> of the possibility space:</p>

<picture><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/possibility-space-partition-400-6744870e6.webp 400w, /generated/_posts/../assets/images/possibility-space-partition-600-6744870e6.webp 600w, /generated/_posts/../assets/images/possibility-space-partition-800-6744870e6.webp 800w, /generated/_posts/../assets/images/possibility-space-partition-1000-6744870e6.webp 1000w, /generated/_posts/../assets/images/possibility-space-partition-1500-6744870e6.webp 1500w, /generated/_posts/../assets/images/possibility-space-partition-1540-6744870e6.webp 1540w" type="image/webp" /><source sizes="min(100vw, 640px)" srcset="/generated/_posts/../assets/images/possibility-space-partition-400-6744870e6.jpeg 400w, /generated/_posts/../assets/images/possibility-space-partition-600-6744870e6.jpeg 600w, /generated/_posts/../assets/images/possibility-space-partition-800-6744870e6.jpeg 800w, /generated/_posts/../assets/images/possibility-space-partition-1000-6744870e6.jpeg 1000w, /generated/_posts/../assets/images/possibility-space-partition-1500-6744870e6.jpeg 1500w, /generated/_posts/../assets/images/possibility-space-partition-1540-6744870e6.jpeg 1540w" type="image/jpeg" /><img alt="" src="/generated/_posts/../assets/images/possibility-space-partition-800-6744870e6.png" width="1540" height="634" /></picture>

<p>If a model had a size of, say, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">2^k + 1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9324em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>, one of the subsets in the partition would need to contain more than one element. But this additional element would be superfluous insofar as the truth-value of the sentence is concerned. The partition subset corresponds to a predicate-combination that would already be true with just one element in the subset, and will continue to be true if more elements are added. Take, for example, the subset labeled ‘8’ in the drawing, which corresponds to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>Q</mi><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>P</mi></mrow><annotation encoding="application/x-tex">R \land \neg Q \land \neg P</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord">¬</span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">¬</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span></span></span></span>. The sentence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∃</mi><mi>x</mi><mi>R</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>Q</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>P</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\exists x R(x) \land \neg Q(x) \land \neg P(x)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∃</span><span class="mord mathnormal">x</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">¬</span><span class="mord mathnormal">Q</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">¬</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span> is true whether there are one, two, or a million elements in subset 8. Similarly, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>x</mi><mi>R</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>Q</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>∧</mo><mi mathvariant="normal">¬</mi><mi>P</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\forall x R(x) \land \neg Q(x) \land \neg P(x)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">¬</span><span class="mord mathnormal">Q</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">¬</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span> does not depend on the number of elements in subset 8.</p>

<p>Seeing this not only illuminates the theorem, but also let us see that the vast majority of the multitudinous <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>m</mi><mo>=</mo><mn>1</mn></mrow><msup><mn>2</mn><mi>k</mi></msup></msubsup><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><msup><mo stretchy="false">)</mo><mi>m</mi></msup></mrow><annotation encoding="application/x-tex">\sum_{m=1}^{2^k} (2^k)^m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.4515em;vertical-align:-0.2997em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1518em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.2029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6644em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">m</span></span></span></span></span></span></span></span></span></span></span> models we considered earlier are equivalent. All that matters for our sentence’s truth-value is whether each of the subsets is <em>empty</em> or non-empty. This means there are in fact only <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mrow><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">2^{(2^k)}-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0952em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0119em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span> model equivalence classes to consider. We need to subtract one because the subsets cannot all be empty, since the domain needs to be non-empty.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="n">k</span> <span class="o">=</span> <span class="mi">2</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">itertools</span><span class="p">.</span><span class="n">product</span><span class="p">([</span><span class="s">'Empty'</span><span class="p">,</span><span class="s">'Non-empty'</span><span class="p">],</span><span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="o">**</span><span class="n">k</span><span class="p">)]</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span><span class="p">.</span><span class="n">remove</span><span class="p">((</span><span class="s">'Empty'</span><span class="p">,)</span><span class="o">*</span><span class="n">k</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span>
<span class="p">[(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Empty'</span><span class="p">),</span>
 <span class="p">(</span><span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">,</span> <span class="s">'Non-empty'</span><span class="p">)]</span>
</code></pre></div></div>

<p>We are now ready to consider the extension to monadic predicate logic with identity. With identity, it’s possible to check whether any two members of a model are distinct or identical. This means we can distinguish the case where a partition subset contains one element from the case where it contains several. But we can still only distinguish up to a certain number of elements in a subset. That number is bounded above by the number of variables in the sentence<sup id="fnref:equality" role="doc-noteref"><a href="#fn:equality" class="footnote" rel="footnote">1</a></sup> (e.g. if you only have two variables <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span></span></span></span>, it’s not possible to construct a sentence that asserts there are three different things in some subset). Indeed we have:</p>

<blockquote>
  <p>If a sentence of monadic predicate logic with identity is satisfiable, then it has a model of size no greater than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>k</mi></msup><mo>×</mo><mi>r</mi></mrow><annotation encoding="application/x-tex">2^k \times r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9324em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span></span></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> is the number of monadic predicates and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span></span></span></span> the number of variables in the sentence. (Lemma 21.9 BBJ)</p>
</blockquote>

<p>By analogous reasoning to the case without identity, we need only consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>r</mi><mo>+</mo><mn>1</mn><msup><mo stretchy="false">)</mo><mrow><mo stretchy="false">(</mo><msup><mn>2</mn><mi>k</mi></msup><mo stretchy="false">)</mo></mrow></msup><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">(r+1)^{(2^k)}-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2619em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.0119em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mtight"><span class="mord mtight">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.927em;"><span style="top:-2.931em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span> model equivalence classes. All that matters for our sentence’s truth-value is whether each of the subsets has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mn>2...</mn></mrow><annotation encoding="application/x-tex">0, 1, 2 ...</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">2...</span></span></span></span> or  <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span></span></span></span> elements in it.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="n">k</span> <span class="o">=</span> <span class="mi">2</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">r</span> <span class="o">=</span> <span class="mi">2</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">itertools</span><span class="p">.</span><span class="n">product</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="n">r</span><span class="o">+</span><span class="mi">1</span><span class="p">),</span><span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="o">**</span><span class="n">k</span><span class="p">)]</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span><span class="p">.</span><span class="n">remove</span><span class="p">((</span><span class="mi">0</span><span class="p">,)</span><span class="o">*</span><span class="n">k</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">eq_classes</span>
<span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
 <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
<span class="p">...</span>
</code></pre></div></div>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:equality" role="doc-endnote">
      <p>I believe it should be possible to find a tighter bound based on the number of times the equals sign actually appears in the sentence. For example, if equality is only used once, e.g. in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∃</mi><mi>x</mi><mi mathvariant="normal">∃</mi><mi>y</mi><mi mathvariant="normal">¬</mi><mo stretchy="false">(</mo><mi>x</mi><mo>=</mo><mi>y</mi><mo stretchy="false">)</mo><mo>∧</mo><mi>ϕ</mi></mrow><annotation encoding="application/x-tex">\exists x \exists y \neg(x =y) \land \phi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∃</span><span class="mord mathnormal">x</span><span class="mord">∃</span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mord">¬</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∧</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ϕ</span></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ϕ</mi></mrow><annotation encoding="application/x-tex">\phi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ϕ</span></span></span></span> does not contain equality, it seems clear that the number of variables in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ϕ</mi></mrow><annotation encoding="application/x-tex">\phi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ϕ</span></span></span></span> should have no bearing on the model size that is needed. My hunch is that more generally you need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>∗</mo><mo stretchy="false">(</mo><mi>n</mi><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">n*(n-1)/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4653em;"></span><span class="mord mathnormal">n</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">n</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose">)</span><span class="mord">/2</span></span></span></span> uses of ‘<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>=</mo></mrow><annotation encoding="application/x-tex">=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">=</span></span></span></span>’ to assert that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> objects are distinct, so, for example if ‘<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>=</mo></mrow><annotation encoding="application/x-tex">=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">=</span></span></span></span>’ appears 5 times you can distinguish 3 objects in a subset, or with 12 ‘<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>=</mo></mrow><annotation encoding="application/x-tex">=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">=</span></span></span></span>’s you can distinguish 5 objects. It’s only an intuition and I haven’t checked it carefully. <a href="#fnref:equality" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="software" /><category term="logic" /><summary type="html"><![CDATA[Monadic predicate logic (with identity) is decidable. (See Boolos, Burgess, and Jeffrey 2007, Ch. 21. The result goes back to Löwenheim-Skolem 1915).]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bayes.net/assets/images/possibility-space-partition.png" /><media:content medium="image" url="https://bayes.net/assets/images/possibility-space-partition.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>