<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://dennisprangle.github.io/feed.xml" rel="self" type="application/atom+xml"/><link href="https://dennisprangle.github.io/" rel="alternate" type="text/html" hreflang="en"/><updated>2026-05-25T13:41:15+00:00</updated><id>https://dennisprangle.github.io/feed.xml</id><title type="html">blank</title><subtitle>Associate professor in statistics at the University of Bristol, working on Bayesian statistics and machine learning. </subtitle><entry><title type="html">Revisiting ABC posterior convergence</title><link href="https://dennisprangle.github.io/blog/2022/abc_consistency/" rel="alternate" type="text/html" title="Revisiting ABC posterior convergence"/><published>2022-12-31T00:00:00+00:00</published><updated>2022-12-31T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2022/abc_consistency</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2022/abc_consistency/"><![CDATA[<p>The material in this blog post is planned to eventually be an appendix of a paper, but I thought I’d post it here separately as it’s hopefully of some independent interest. Also, this draft is a good way to check for errors - let me know if you spot any!</p> <p>The idea is to prove convergence of the ABC posterior to the true posterior as \(\epsilon \to 0\). I’ll cover previous proofs, extend them, and relate them to the key underlying mathematical results.</p> <h2 id="bayesian-setting">Bayesian setting</h2> <p>Consider the Bayesian setting with:</p> <ul> <li>Prior density \(p(\theta)\)</li> <li>Model density \(f(y \vert \theta)\)</li> <li>Observations \(y_0\)</li> </ul> <p>I’ll assume \(\theta \in \mathbb{R}^d\), \(y \in \mathbb{R}^n\), and that \(p(\cdot)\) and \(f(\cdot | \theta)\) are densities with respect to Lebesgue measure. Therefore \(f(\cdot | \theta)\) is an integrable function.</p> <p>Now let:</p> \[\begin{aligned} L(\theta) &amp;= f(y_0 | \theta) &amp;&amp; \text{likelihood} \\ \tilde{p}(\theta | y_0) &amp;= p(\theta) L(\theta) &amp;&amp; \text{unnormalised posterior density} \\ Z &amp;= \int \tilde{p}(\theta | y_0) d\theta &amp;&amp; \text{normalising constant} \\ p(\theta | y) &amp;= \tilde{p}(\theta | y_0) / Z &amp;&amp; \text{posterior density} \end{aligned}\] <p>Throughout, all integrals are over the full \(\theta\) or \(y\) space, unless the domain of integration is specified.</p> <p>I’ll assume:</p> <ul> <li>A1: \(Z&gt;0\) (the observations are supported under the prior and model)</li> </ul> <p>Later I’ll also use the notation:</p> \[Z(y) = \int p(\theta) f(y | \theta) d\theta,\] <p>noting that \(Z(y_0) = Z\) and \(\int Z(y) dy = 1\).</p> <p><strong>Remarks:</strong></p> <ul> <li>I think all the results below also hold for discrete \(\theta\) and \(y\) distributions. I think it’s also fine for \(p(\cdot)\) to be a density with respect to a more general measure but I’m not whether this is the case for \(f(\cdot|\theta)\). There are some comments below on where the proof needs modification for these cases.</li> <li><strong>Edit May 2023:</strong> A case not covered by this proof is when \(y\) is continuous but \(y | \theta\) is singular with respect to Lebesgue measure. This can occur if a component of \(y\) is a deterministic function of \(\theta\), and can produce a posterior which is singular with respect to the prior, thus requiring more sophisticated measure theoretic tools.</li> </ul> <h2 id="abc-posterior-and-likelihood">ABC posterior and likelihood</h2> <p>Many ABC algorithms produce samples from the <strong>ABC posterior</strong> \(p_\epsilon(\theta | y)\). For an overview see for example <a href="https://arxiv.org/abs/1802.09720">Sisson et al (2018)</a>. The ABC posterior can be defined as follows:</p> \[\begin{aligned} L_\epsilon(\theta) &amp;= \int K_\epsilon(y-y_0) f(y | \theta) dy &amp;&amp; \text{ABC likelihood} \\ \tilde{p}_\epsilon(\theta | y_0) &amp;= p(\theta) L_\epsilon(\theta) &amp;&amp; \text{unnormalised ABC posterior density} \\ Z_\epsilon &amp;= \int \tilde{p}_\epsilon(\theta | y_0) d\theta &amp;&amp; \text{ABC normalising constant} \\ p_\epsilon(\theta | y_0) &amp;= \tilde{p}_\epsilon(\theta | y_0) / Z_\epsilon &amp;&amp; \text{ABC posterior density} \end{aligned}\] <p>Here \(K_\epsilon\) is a <strong>kernel function</strong> and \(\epsilon &gt; 0\) is a <strong>bandwidth</strong>. We’ll consider kernels of the form: \(K_\epsilon(y) = \epsilon^{-n} K(y/\epsilon),\) where \(K\) is <strong>base kernel</strong>, a non-negative function \(\mathbb{R}^n \to \mathbb{R}\). We assume:</p> <ul> <li>K1: \(K\) is bounded</li> <li>K2: \(\int K(y) dy = 1\).</li> <li>K3: \(K(y) &gt; 0\) for \(\vert \vert y \vert \vert \leq 1\) (where \(\vert \vert \cdot \vert \vert\) is the Euclidean norm).</li> </ul> <p>The most common base kernel used in ABC is the <strong>uniform kernel</strong>:</p> \[K_U(y) = 1[||y|| \leq 1] / k_U\] <p>were \(1[\cdot]\) is an indicator function and \(k_U\) is a suitable normalising constant (<a href="https://en.wikipedia.org/wiki/Volume_of_an_n-ball">volume of an \(n\)-ball</a>). Also common is the <strong>Gaussian kernel</strong>:</p> \[K_G(y) = \exp[-\tfrac{1}{2} ||y||^2] / k_G\] <p>where \(k_G = (2 \pi)^{n/2}\).</p> <p><strong>Remarks:</strong></p> <ul> <li>The ABC likelihood and posterior are similar to kernel density estimates, which is where the bandwidth terminology is taken from.</li> <li>The \(k_U\) and \(k_G\) constants ensure that K2 is satisfied. In a lot of ABC literature this plays no role, so the kernels are often defined without these constants.</li> <li>Under K2, \(K\) and \(K_\epsilon\) are probability density functions. The ABC posterior is then the posterior under the model plus independent noise from \(K_\epsilon\) (see <a href="https://doi.org/10.1515/sagmb-2013-0010">Wilkinson 2013</a>).</li> <li>In other contexts, the Gaussian kernel is known as the heat kernel.</li> </ul> <h2 id="abc-posterior-convergence">ABC posterior convergence</h2> <p>The goal is to show that the ABC posterior converges in distribution to the posterior in the limit \(\epsilon \to 0\).</p> <h2 id="previous-work">Previous work</h2> <p><a href="https://doi.org/10.1214/13-EJS819">Rubio and Johansen (2013)</a> (Proposition 1) prove ABC posterior convergence given:</p> <ul> <li>A kernel (defined slightly differently to above) with bounded support.</li> <li>Some continuity and local boundedness requirements on \(f(y \vert \theta)\).</li> </ul> <p><a href="https://doi.org/10.1214/16-BA1002">Prangle (2017)</a> (Theorem 1, in the supplement) proves ABC posterior convergence for almost all \(y_0\) given:</p> <ul> <li>A uniform kernel.</li> <li>A general choice of \(f(y \vert \theta)\).</li> </ul> <p>The latter proof is based on the <a href="https://en.wikipedia.org/wiki/Lebesgue_differentiation_theorem">Lebesgue differentiation theorem</a> (LDT), discussed below.</p> <p>The aim of this post is to generalise the result to a general likelihood and kernel satisfying K1-K3.</p> <p>The two papers above are of most relevance to this post, but other related work on ABC convergence results includes the following:</p> <ul> <li> <p><a href="https://doi.org/10.1198/jasa.2010.tm09448">Blum (2010)</a>, <a href="https://doi.org/10.1111/j.1467-9868.2011.01010.x">Fearnhead and Prangle (2012)</a> and <a href="http://www.numdam.org/item/AIHPB_2015__51_1_376_0/">Biau (2015)</a> derive results on the accuracy of estimates from ABC algorithms. These involve dealing with the error in the ABC posterior, as well as other sources of error.</p> </li> <li> <p><a href="http://dx.doi.org/10.1214/15-EJS988">Barber et al (2015)</a> prove the convergence of ABC posterior expectations for a uniform kernel.</p> </li> <li> <p><a href="https://doi.org/10.1111/rssb.12312">Bernton et al (2019)</a> (Proposition 3.1) prove ABC posterior convergence following the approach of Rubio and Johansen, but under different conditions relevant to their purposes. Amongst other authors, they also consider a different asymptotic regime: \(n \to \infty\) (large number of observations).</p> </li> </ul> <h2 id="approximations-of-the-identity">Approximations of the identity</h2> <p>The key tool in the proof is the following result. I’m using the definitions and statement from Stein and Shakarchi “Real analysis: measure theory, integration, and Hilbert spaces” (2005).</p> <p>For an integrable function \(g:\mathbb{R}^n \to \mathbb{R}\) (such as any probability density function), consider a convolution:</p> \[(g * K_\epsilon) (y_0) := \int K_\epsilon(y-y_0) g(y) dy\] <p>Stein and Shakarchi, Theorem 2.1 of Chapter 3, states that</p> \[\lim_{\epsilon \to 0} (g * K_\epsilon) (y_0) = g(y_0)\] <p>for almost all \(y_0\) if \(K_\epsilon\) is an <strong>approximation of the identity</strong> (AOTI). Conditions K1-K3 are sufficient for \(K_\epsilon\) to be a AOTI.</p> <p><strong>Remarks:</strong></p> <ul> <li>For small \(\epsilon\), the convolution operation approximates the identity operation. This is what the AOTI name refers to.</li> <li>I use AOTI to refer to both the theorem, and the class of kernels for which it holds. Hopefully the distinction is clear from the context.</li> <li>The LDT can be viewed as the special case of AOTI when \(K\) is the uniform kernel. Typically the LDT is proved first, and used to derive AOTI.</li> <li>The analogous result to AOTI for discrete \(y\) is trivial. Therefore the main ABC convergence proof holds for discrete \(y\) with little modification. However I’m not sure what conditions are needed if \(f(\cdot|\theta)\) is a density with respect to a more general measure.</li> <li>AOTI kernels are possible which do not take the form \(K_\epsilon(y) = \epsilon^{-n} K(y/\epsilon)\). One application of this is to adaptive ABC distance functions (as in <a href="https://doi.org/10.1214/16-BA1002">Prangle 2017</a>).</li> <li>The full theorem statement in Stein and Shakarchi has more details on the definition of an AOTI kernel, and which \(y_0\) points the theorem holds for (the <a href="https://en.wikipedia.org/wiki/Lebesgue_point">Lebesgue points</a> of \(g\)).</li> <li><strong>Edit June 2023:</strong> In the context of AOTI, \(K_\epsilon\) is sometimes known as a <a href="https://en.wikipedia.org/wiki/Mollifier"><strong>mollifier</strong></a>.</li> </ul> <h2 id="abc-convergence-proof-part-1-pointwise-convergence-of-the-abc-likelihood">ABC convergence proof part 1: pointwise convergence of the ABC likelihood</h2> <p>Applying AOTI gives that for almost all \(y_0\):</p> \[\begin{aligned} \lim_{\epsilon \to 0} L_\epsilon(\theta) &amp;= \lim_{\epsilon \to 0} \int K_\epsilon(y-y_0) f(y | \theta) dy \\ &amp;= f(y_0 | \theta) \\ &amp;= L(\theta). \end{aligned}\] <p><strong>Remark:</strong> Rubio and Johansen give an elementary proof of this result for all \(y_0\) in the case of continuous \(f(\cdot \vert \theta)\), and some restrictions on \(K_\epsilon\). AOTI is needed for non-continuous \(f\).</p> <h2 id="abc-convergence-proof-part-2-convergence-of-the-abc-normalising-constant">ABC convergence proof part 2: convergence of the ABC normalising constant</h2> <p>We have:</p> \[\begin{aligned} Z_\epsilon &amp;= \int p(\theta) \bigg[ \int K_\epsilon(y-y_0) f(y | \theta) dy \bigg] d\theta \\ &amp;= \int K_\epsilon(y-y_0) \bigg[ \int p(\theta) f(y | \theta) d\theta \bigg] dy &amp;&amp; \text{by Tonelli's theorem} \\ &amp;= \int K_\epsilon(y-y_0) Z(y) dy. \end{aligned}\] <p>So applying AOTI gives \(\lim_{\epsilon \to 0} Z_\epsilon = Z(y_0) = Z\) for almost all \(y_0\).</p> <p><strong>Remarks:</strong></p> <ul> <li>Rubio and Johansen give a proof using the dominated convergence theorem, which requires boundedness conditions on \(f\).</li> <li>This proof holds when \(p(\theta)\) is a density with respect to counting or more general measure.</li> </ul> <h2 id="abc-convergence-proof-part-3-conclusion">ABC convergence proof part 3: conclusion</h2> <p>It remains to observe that for almost all \(y_0\):</p> \[\begin{aligned} \lim_{\epsilon \to 0} p_\epsilon(\theta | y_0) &amp;= \frac{p(\theta) \lim_{\epsilon \to 0} L_\epsilon(\theta)}{\lim_{\epsilon \to 0} Z_\epsilon} \\ &amp;= \frac{p(\theta) L(\theta)}{Z} \\ &amp;= p(\theta | y_0) \end{aligned}\] <p>Note that A1 is implicitly used above. Finally, convergence in distribution follows from <a href="https://en.wikipedia.org/wiki/Convergence_of_random_variables#Properties">Scheffé’s theorem</a>.</p>]]></content><author><name></name></author><category term="research"/><category term="Bayesian statistics"/><category term="ABC"/><summary type="html"><![CDATA[The material in this blog post is planned to eventually be an appendix of a paper, but I thought I’d post it here separately as it’s hopefully of some independent interest. Also, this draft is a good way to check for errors - let me know if you spot any!]]></summary></entry><entry><title type="html">Review of ABC talk</title><link href="https://dennisprangle.github.io/blog/2019/abc-talk/" rel="alternate" type="text/html" title="Review of ABC talk"/><published>2019-11-14T00:00:00+00:00</published><updated>2019-11-14T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/abc-talk</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/abc-talk/"><![CDATA[<p>I gave a talk for the <a href="https://twitter.com/RSSEdinburgh">Royal Statistical Society Edinburgh local group</a> earlier this week, reviewing ABC and recent developments in using density estimation for likelihood-free inference. <a href="/assets/pdf/RSS_talk_Edinburgh_compact.pdf">Click here to see the slides</a>.</p>]]></content><author><name></name></author><category term="research"/><category term="Bayesian statistics"/><category term="ABC"/><summary type="html"><![CDATA[I gave a talk for the Royal Statistical Society Edinburgh local group earlier this week, reviewing ABC and recent developments in using density estimation for likelihood-free inference. Click here to see the slides.]]></summary></entry><entry><title type="html">High dimensional Bayesian experimental design - part II</title><link href="https://dennisprangle.github.io/blog/2019/experimental_design_pt2/" rel="alternate" type="text/html" title="High dimensional Bayesian experimental design - part II"/><published>2019-09-07T00:00:00+00:00</published><updated>2019-09-07T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/experimental_design_pt2</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/experimental_design_pt2/"><![CDATA[<p><strong>Edit: This post is now very out of date! See version 3+ of the paper for a new approach.</strong></p> <p>This is the second part of a blog post on a <a href="https://arxiv.org/abs/1904.05703v2">preprint</a> by <a href="https://www.ncl.ac.uk/maths-physics/postgraduate/current/pgrprofiles/harbishersophie.html">Sophie Harbisher</a>, <a href="https://twitter.com/csgillespie">Colin Gillespie</a> and me. The <a href="/blog/2019/experimental_design/">first part</a> was about the computational benefits of using the “Fisher information gain” (trace of the Fisher information matrix) as a utility function in Bayesian experimental design. This part is on theoretical justification for its use.</p> <p>I’m going to start with a quick intuitive explanation, by analogy with the popular <strong>Shannon information gain</strong> utility. Then I’ll go over a more detailed argument based on decision theory.</p> <h2 id="shannon-information-gain">Shannon information gain</h2> <p>One way to summarise the information provided by data \(y\) on parameters \(\theta\) in a Bayesian analysis is through the <strong>Kullback-Leibler</strong> divergence from the prior to the posterior:</p> \[\begin{equation} D_{KL}[p(\theta | y; \tau), p(\theta)] = E_{\theta \sim p(\theta|y;\tau)} [ \log p(\theta | y; \tau) - \log p(\theta) ]. \tag{1} \end{equation}\] <p>(Recall that \(\tau\) represents the experimental design.)</p> <p>The quantity inside the expectation is known as the <strong>Shannon information gain</strong> (SIG):</p> \[\begin{equation} \mathcal{U}_{\text{SIG}}(\tau, \theta, y) = \log p(\theta | y; \tau) - \log p(\theta). \tag{2} \end{equation}\] <p>Maximising the expected SIG or expected KL divergence gives the same optimal design. (Recall that the expectation is over \(\theta, y\) from the prior and model, given \(\tau\).)</p> <p>However evaluating or estimating (2) is hard, because it requires estimating the posterior density. Even if posterior samples are available from Markov chain Monte Carlo then getting a density estimate is still non-trivial.</p> <p>An alternative form of the SIG can be found by applying Bayes theorem:</p> \[\begin{align} p(\theta | y; \tau) &amp;= \frac{p(\theta) f(y | \theta; \tau)}{ p(y; \tau) } \\ \Rightarrow \log p(\theta | y; \tau) &amp;= \log p(\theta) + \log f(y | \theta; \tau) - \log p(y; \tau), \end{align}\] <p>where \(p(y; \tau) = \int p(\theta) f(y \mid \theta; \tau) d\theta\) is the <strong>evidence</strong> (aka marginal likelihood or normalising constant).</p> <p>Substituting this into (2) gives</p> \[\begin{equation} \mathcal{U}_{\text{SIG}}(\tau, \theta, y) = \log f(y | \theta; \tau) - \log p(y; \tau). \end{equation}\] <p>The difficulty now is estimating the log-evidence. This is easier than estimating a posterior density but still computationally demanding.</p> <h2 id="fisher-information-gain">Fisher information gain</h2> <p>The approach above compares posterior and prior log densities by looking at their difference. This is challenging because it requires correctly normalising the posterior density by computing the evidence. An alternative is to look at the <strong>gradient</strong> of the difference. As we shall see, this avoids the need to calculate the evidence.</p> <p>One way to modify the KL divergence to use a gradient gives</p> \[\begin{equation} D_{FID}[p(\theta | y; \tau), p(\theta)] = E_{\theta \sim p(\theta|y;\tau)} [ || \nabla \log p(\theta | y; \tau) - \nabla \log p(\theta) ||^2 ], \tag{3} \end{equation}\] <p>where</p> <ul> <li>\(\|x\| = \sqrt{x^T x}\) is the Euclidean norm</li> <li>\(\nabla\) represent gradient with respect to \(\theta\)</li> </ul> <p><a href="https://doi.org/10.1016/j.spl.2016.01.014">Stephen Walker refers to this</a> as the <strong>Fisher information distance</strong>, and it is easy to check this is a well defined <a href="https://en.wikipedia.org/wiki/Divergence_(statistics)">divergence</a> from prior to posterior.</p> <p>The quantity inside the expectation in (3) is</p> \[\begin{equation} \mathcal{U}_{\text{diff}}(\tau, \theta, y) = \| \nabla \log p(\theta | y; \tau) - \nabla \log p(\theta) \|^2. \tag{4} \end{equation}\] <p>Earlier we used Bayes theorm to show that</p> \[\begin{equation} \log p(\theta | y; \tau) = \log p(\theta) + \log f(y | \theta; \tau) - \log p(y; \tau). \end{equation}\] <p>Taking the gradient gives</p> \[\begin{equation} \nabla \log p(\theta | y; \tau) = \nabla \log p(\theta) + \nabla \log f(y | \theta; \tau). \end{equation}\] <p>Note that <strong>the evidence term vanishes</strong> as it doesn’t depend on \(\theta\) and so has zero gradient.</p> <p>Substituting this into (4) gives</p> \[\begin{equation} \mathcal{U}_{\text{diff}} = || \nabla \log f(y | \theta; \tau) ||^2, \end{equation}\] <p>and taking the expectation over \(y\) gives</p> \[\begin{equation} \mathcal{U}_{\text{FIG}}(\tau, \theta) = E_{y \sim f(y | \theta; \tau)} [ || \nabla \log f(y | \theta; \tau) ||^2 ], \end{equation}\] <p>which turns out to equal the trace of the Fisher information. We call this the <strong>Fisher information gain</strong> due to the similarity to the Shannon information gain.</p> <h2 id="summary-so-far">Summary so far</h2> <p>We started by considering the KL divergence, based on the difference in prior and posterior log densities, and showed this derived the standard SIG utility function. We then considered an alternative divergence based on the gradient of the difference in prior and posterior log densities, and derived our FIG utility function. The benefit of taking the gradient is that it removes the hard-to-calculate evidence term from the utility. This allows easier optimisation of the expected FIG than the expected SIG.</p> <p>The arguments so far are closely related to those in <a href="https://doi.org/10.1016/j.spl.2016.01.014">Stephen Walker’s paper</a>. Also the idea of looking at log density gradients to avoid normalising the posterior may seem familiar from <a href="http://www.jmlr.org/papers/v6/hyvarinen05a.html">Hyvärinen’s score matching work</a>. We’ll see below that there is a mathematical connection.</p> <p>One other thing to note is about pseudo-Bayesian utilities. <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/insr.12107">Ryan et al</a> defined a experimental design utility to be <strong>fully Bayesian</strong> if it’s a function of the posterior and <strong>pseudo-Bayesian</strong> if not. On the face of it \(\mathcal{U}_{\text{FIG}}\) appeared to be pseudo-Bayesian. However we can now see that it is in fact the expectation of \(\mathcal{U}_{\text{diff}}\), which is fully Bayesian. Therefore \(\mathcal{U}_{\text{FIG}}\) gives the same optimal design as a fully Bayesian utility. This suggests working with a more foundational idea of what is a justifiable utility for Bayesian experimental design.</p> <h2 id="bayesian-decision-theory-and-experimental-design">Bayesian decision theory and experimental design</h2> <p>A foundational approach to Bayesian statistics is through <strong>decision theory</strong>. This was applied to experimental design by <a href="https://books.google.com/books?hl=en&amp;lr=&amp;id=As9oa7D8sAgC&amp;oi=fnd&amp;pg=PP1&amp;ots=PIF8pmN-89&amp;sig=_cpauG_QkN9yWBe6St3oeDFENQ4">Dennis Lindley</a> amongst others. In particular, <a href="https://www.jstor.org/stable/2958753">Jose Bernardo</a> provided a decision theoretic derivation of the SIG utility. Our work shows that a similar argument can produce the FIG utility.</p> <p>Experimental design can be viewed as the following decision problem.</p> <ol> <li>The <strong>experimenter</strong> selects a design, \(\tau\).</li> <li><strong>Nature</strong> selects some parameters, \(\theta\) (unseen by the experimenter).</li> <li>Nature generates some data \(y\) based on \(\tau\) and \(\theta\).</li> <li>The experimenter selects an action based on \(y\).</li> <li>The experimenter receives a <strong>base utility</strong> \(\mathcal{V}\) depending on \(\tau, \theta, y, a\).</li> </ol> <p>(We use the term “base utility” given a particular action to distinguish with “utility” \(\mathcal{U}\) which was discussed in <a href="/blog/2019/experimental_design/">part I</a> and will be introduced again shortly!)</p> <p>As in part 1 we assume that \(\theta\) and \(y\) come from a prior and model. The action could be a concrete decision - e.g. give a patient a particular treatment, pick government policy X over policy Y - in which case the base utility should ideally quantify the costs and benefits. We’re concerned with coming up with a generic approach when these details aren’t available.</p> <p>We’ll consider the action to be making a summary of knowledge about the parameters given the data. The action could be a point estimate for \(\theta\), which allows a base utility such as mean squared error. Instead we follow <a href="https://www.jstor.org/stable/2958753">Bernardo</a> who suggested instead letting the action be a <strong>distribution</strong> for \(\theta\). Suitable base utilities are then supplied by the theory of <a href="https://en.wikipedia.org/wiki/Scoring_rule">proper scoring rules</a>, discussed below.</p> <p>At step 4 the experimenter wants to pick the action maximising the expected value of \(\mathcal{V}\) given \(\tau\) and \(y\). We can define a utility function \(\mathcal{U}(\tau, y)\) which equals the maximum expected \(\mathcal{V}\). We can then use the framework of <a href="/blog/2019/experimental_design/">part I</a> and pick the design which maximises the expected \(\mathcal{U}\).</p> <h2 id="scoring-rules">Scoring rules</h2> <p>A scoring rule \(S(q,\theta)\) measures the quality of a prediction, here in the form of a density \(q\), given a realised value \(\theta\), by outputting a numerical value. Low scores represent good matches. Averaged over repeated predictions, the scoring rule can measure the quality of a forecaster e.g. of weather.</p> <p>In our experimental design framework we can take \(\mathcal{V} = -S(a,\theta)\) i.e. base utility equals the negative of some scoring rule.</p> <p>There are many scoring rules, e.g. see <a href="https://en.wikipedia.org/wiki/Scoring_rule">wikipedia</a>, but these can be narrowed down by requiring a few properties</p> <ul> <li> <p>A <strong>proper scoring rule</strong> has the following property. The expected score \(E_{\theta \sim p}[S(q,\theta)]\) is minimised by \(q = p\). For <strong>strictly proper</strong> scoring rule, this is the unique global maximum. The idea is that the optimal choice of \(q\) (i.e. minimising expected score) is its true distribution \(p\). Proper scoring rules encourage forecasters to report their true beliefs.</p> </li> <li> <p>A <strong>local scoring rule</strong> \(S(q,\theta)\) is one that depends only on \(q(\theta)\). So the score is only based on how likely \(\theta\) was predicted to be, not on predictions for events that did not occur.</p> </li> </ul> <p>The logarithmic scoring rule \(S(q,\theta) = -\log q(\theta)\) is the unique strictly proper local scoring rule (except that affine transformations are also allowed).</p> <p>Other rules are possible if locality is relaxed slightly to allow \(S(q,\theta)\) to depend on derivatives of \(q(\theta)\). Allowing \(k\)th derivatives is called locality of order \(k\). An order-2 strictly proper scoring rule is the <a href="http://www.jmlr.org/papers/v6/hyvarinen05a.html"><strong>Hyvärinen score</strong></a>. (I’ll omit its formula as the details aren’t needed here.)</p> <p>The logarithmic and Hyvärinen score seem good candidates to use to create a base utility.</p> <h2 id="divergences-from-scoring-rules">Divergences from scoring rules</h2> <p>Given a scoring rule, various related quantities can be derived. One is a <strong>divergence</strong></p> \[\begin{equation} \mathcal{D}[p(\theta), q(\theta)] = E_{\theta \sim p}[ S(q,\theta) - S(p,\theta) ] \end{equation}.\] <p>This is the excess expected score (remember high scores are bad!) from reporting \(q(\theta)\) rather than \(p(\theta)\) when the true density is \(p(\theta)\). It turns out that logarithmic score produces the Kullback-Leibler divergence (1), and the Hyvärinen score produces the Fisher information distance (3).</p> <h2 id="experimental-design-based-on-scoring-rules">Experimental design based on scoring rules</h2> <p>Suppose we take \(\mathcal{V} = -S(a,\theta)\) in our experimental design framework. Then in step 4 of the framework the experimenter must choose a predicted density to minimise the expected score in step 5. If \(S\) is strictly proper, then the best choice is the true distribution of \(\theta\) given the available observations \(y\). This is the posterior \(p(\theta | y; \tau)\).</p> <p>So in step 3 the experimenter will receive a utility of the negative expected score from the posterior. We can add a constant to the utility without affecting the decision procedure. Adding the right constant (\(E_{\theta \sim p(\theta | y; \tau)}[p(\theta)]\)) gives a utility of</p> \[\begin{equation} \mathcal{D}[p(\theta | y; \tau), p(\theta)] \end{equation}\] <p>where \(\mathcal{D}\) is the divergence derived from \(S\).</p> <p>This argument shows that <strong>there is a decision theoretic justification for using a divergence derived from a scoring rule as a utility function in Bayesian experimental design</strong>. Using this argument, Bernardo showed that logarithmic score results in the KL divergence and SIG utility. In our paper we show that Hyvärinen score results in the Fisher information distance divergence and FIG utility.</p> <h2 id="future-research-directions">Future research directions</h2> <p>We’ve shown a decision theoretic derivation of the FIG utility function in Bayesian experimental design.</p> <p>But lots of questions remain for future work. First, <strong>what is the practical difference in the kind of designs that FIG produces compared to SIG (and other utility functions)</strong>? As discussed in <a href="/blog/2019/experimental_design/">part I</a>, one of our examples produced a design with lots of replicated observation times/locations. Is FIG particularly liable to this? In our paper we speculate that maybe FIG is too <a href="https://en.wikipedia.org/wiki/Risk-seeking">risk seeking</a> - too favourable towards designs that will occasionally produce extremely informative data.</p> <p>Another question is <strong>what other utilities can be derived through decision theory</strong>? Perhaps we might be able to pick utilities with some desirable properties. <a href="https://projecteuclid.org/euclid.aos/1336396185">Ehm and Gneiting</a> and <a href="https://projecteuclid.org/euclid.aos/1336396183">Parry, Dawid and Lauritzen</a> recently investigated the class of proper local scoring rules, and it would be interesting to see what utility functions can result from them. Also a proper scoring rule \(S(q,\theta)\) could be modified to \(c(\tau,y) S(q,\theta) + d(\tau,y)\) and still be proper. Some choices of \(c\) and \(d\) might provide interesting alternative utilities. Finally perhaps we could reparameterise \(\theta\) before applying a scoring rule in an interesting way (similarly to the weighting scheme in <a href="/blog/2019/experimental_design/">part I</a>).</p>]]></content><author><name></name></author><category term="research"/><category term="Bayesian statistics"/><category term="Experimental design"/><summary type="html"><![CDATA[Edit: This post is now very out of date! See version 3+ of the paper for a new approach.]]></summary></entry><entry><title type="html">High dimensional Bayesian experimental design - part I</title><link href="https://dennisprangle.github.io/blog/2019/experimental_design/" rel="alternate" type="text/html" title="High dimensional Bayesian experimental design - part I"/><published>2019-08-31T00:00:00+00:00</published><updated>2019-08-31T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/experimental_design</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/experimental_design/"><![CDATA[<p><strong>Edit: This post is now very out of date! See version 3+ of the paper for a new approach.</strong></p> <p>Myself, my Newcastle colleague <a href="https://twitter.com/csgillespie">Colin Gillespie</a> and our PhD student <a href="https://www.ncl.ac.uk/maths-physics/postgraduate/current/pgrprofiles/harbishersophie.html">Sophie Harbisher</a> recently uploaded a <a href="https://arxiv.org/abs/1904.05703v2">second version of a paper</a> to arxiv. I thought this would be a good opportunity to blog about it while it’s fresh in my mind. The paper is on <strong>Bayesian experimental design</strong>, and how to scale it up to higher dimensional problems at a reasonable cost. In this first blog post I’m going to describe our method. Then in a <a href="/blog/2019/experimental_design_pt2/">second part</a> I’ll explain some of the theory behind it.</p> <p>You can also have a look at our code for this project <a href="https://github.com/SophieHarbisher/SGO-FIG">on github</a>.</p> <h2 id="design-of-experiments">Design of experiments</h2> <p>Before collecting some data we can often make some choices about how to do so. This can affect how informative the results are, and how expensive the collection process is.</p> <p>The classic setting, from which the statistical terminology is taken, is where a <strong>design</strong> is selected before performing an <strong>experiment</strong>. Applications include:</p> <ul> <li>How many patients to use in a clinical trial.</li> <li>When to take measurements in a physics/biology experiment.</li> <li>Where to performing sampling in statistical ecology.</li> </ul> <p>Similar settings also appear whenever a decision must be made about how to collect data for making a future task e.g.</p> <ul> <li>Where to place sensors in an autonomous vehicle.</li> <li>Where to evaluate a function for numerical integration.</li> <li>What parameter settings to use for runs of expensive climate simulators.</li> </ul> <p>So classical design of experiments has a strong overlap with modern tasks in machine learning (e.g. active and reinforcement learning), probabilistic numerics and uncertainty quantification.</p> <p>Design of experiments (<strong>DoE</strong>) has a long history in statistical research. The classic approach dates back to at least <a href="https://en.wikipedia.org/wiki/The_Design_of_Experiments">R A Fisher’s work in the 1920s-30s</a>. In modern applications, it’s increasingly feasible to collect large amounts of data, so there’s an increasing emphasis on being able to select <strong>high dimensional designs</strong>.</p> <h2 id="technical-setup">Technical setup</h2> <p>We focus on the <strong>continuous</strong> version of DoE. That is, we wish to select a design made up of a fixed number of continuous quantities. For example we could be selecting measurment times, measurement locations, dose sizes etc. Mathematically we wish to select a \(d\) dimension vector \(\tau \in \mathbb{R}^d\).</p> <p>We look at <strong>Bayesian experimental design</strong>, which uses the following decision-theoretic framework.</p> <ol> <li>The <strong>experimenter</strong> must select a design, \(\tau\).</li> <li><strong>Nature</strong> selects some parameters, \(\theta\). We assume these are generated from a <strong>prior distribution</strong> \(\pi(\theta)\). (The parameters are unseen by the experimenter.)</li> <li>Nature generates some data \(y\) based on \(\tau\) and \(\theta\). We assume this is generated from a <strong>model</strong> with likelihood function \(f( y \mid \theta; \tau)\). (These are seen by the experimenter.)</li> <li>The experimenter receives a <strong>utility</strong>, \(\mathcal{U}\) depending on \(\tau, \theta, y\) (or a subset of these).</li> </ol> <p>To use this framework we have to make assumptions about how nature produces data i.e. select a model and its likelihood function. The model typically depends on some unknown <strong>parameters</strong> \(\theta\). In a Bayesian approach we have to make assumptions their distribution i.e. select a prior. (Classic non-Bayesian DoE approaches face <a href="https://www.sciencedirect.com/science/article/abs/pii/0025556485900689">a similar issue</a>, as they require picking a single <em>nominal parameter value</em> at which to assess the design.)</p> <p>In Bayesian DoE, the optimal design is that maximising the <strong>expected utility</strong> (with respect to parameters and data). The computational challenge is to solve this optimisation problem - or come up with a close approximation - in a reasonable time.</p> <h2 id="utility-functions">Utility functions</h2> <p>The utility function \(\mathcal{U}\) is an important choice in DoE. It describes how useful the outcome is to the experimenter, taking into account both costs and benefits. Ideally a utility function could be designed for the particular application at hand. But this is often not possible and a generic utility function is used instead. This aims to measure how <strong>informative</strong> the experimental results are.</p> <p>Most generic utility functions for Bayesian DoE involve the <strong>posterior density</strong> \(\pi(\theta|y;\tau)\) i.e. the distribution of the parameters given the design and data. The posterior summarises the experimenter’s knowledge of the parameters at the end of the experiment. The utility can be taken to be some scalar summary of the posterior - or the posterior compared to the prior - which describes how much information has been gained. <a href="https://www.jstor.org/stable/2246015">Chaloner and Verdinelli, 1995</a> and <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/insr.12107">Ryan et al, 2016</a> review many possible choices.</p> <h2 id="computational-challenges-and-existing-methods">Computational challenges and existing methods</h2> <p>Calculating the posterior is typically computationally expensive. This makes Bayesian DoE challenging: we want to optimise expected utility but:</p> <ol> <li>We can only evaluate a single utility at a time, not its expected value.</li> <li>Even a single utility evaluation is expensive!</li> </ol> <p>Many methods have been proposed for Bayesian DoE, including:</p> <ul> <li>Optimisation using MCMC, using <a href="https://books.google.co.uk/books?id=IB6Nu-qMKHYC&amp;lpg=PA459&amp;ots=k8eJ3i9p6Y&amp;lr&amp;pg=PA459#v=onepage&amp;q&amp;f=false">Peter Müller’s algorithm</a>.</li> <li>Coordinate ascent using Gaussian process optimisation, using <a href="https://amstat.tandfonline.com/doi/full/10.1080/00401706.2016.1251495">the ACE algorithm of Overall and Woods</a>.</li> <li>Approximating the expected utility by variational inference, using <a href="https://arxiv.org/abs/1903.05480">recent work of Foster et al</a>.</li> </ul> <p>However these all involve computational expense and/or approximations.</p> <h2 id="the-fig-utility">The FIG utility</h2> <p>We propose using a particular utility function which can be evaluated without posterior calculations. This makes the optimisation problem much simpler and cheaper, as we’ll see shortly.</p> <p>We use what we call the <strong>Fisher information gain</strong> utility, \(\mathcal{U}_{\text{FIG}}(\theta, \tau)\). This is the trace of the <a href="https://en.wikipedia.org/wiki/Fisher_information#Matrix_form">Fisher information matrix</a>. (As used in the non-Bayesian <a href="https://en.wikipedia.org/wiki/Optimal_design#Minimizing_the_variance_of_estimators">T-optimality</a> criterion.) The Fisher information matrix is often available in closed form. Even if not, an unbiased Monte Carlo estimate can be formed in many applications (see Appendix E of our paper). In both cases it’s not necessary to infer the posterior.</p> <p>Utility functions which avoid in the posterior in this way have been <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/insr.12107">criticsed as being <strong>pseudo-Bayesian</strong></a> for not using the full information available from the data. However <a href="https://www.sciencedirect.com/science/article/abs/pii/S0167715216000109">Stephen Walker recently showed</a> that it turns out this utility produces the same optimal designs as a <strong>fully Bayesian</strong> utility (i.e. one which is a posterior summary). Our paper extends this argument by giving a foundational Bayesian derivation of the FIG utility through decision theory. The details are in the <a href="/blog/2019/experimental_design_pt2/">second part</a> of this blog post.</p> <h2 id="optimisation">Optimisation</h2> <p>We wish to maximise our expected utility,</p> \[\begin{equation} \mathcal{J}(\tau) = E_{\theta \sim \pi(\theta)} [\mathcal{U}_{\text{FIG}}(\theta, \tau)]. \end{equation}\] <p>We usually can’t evaluate this expectation. However we can compute an unbiased Monte Carlo estimate of its gradient,</p> \[\begin{equation} \widehat{\nabla_\tau \mathcal{J}(\tau)} = \frac{1}{K} \sum_{k=1}^K \nabla_\tau \text{tr} \mathcal{I}(\theta^{(k)}, \tau). \end{equation}\] <p>where</p> <ul> <li>The \(\theta^{(k)}\)s are samples from the prior.</li> <li>\(\nabla_\tau\) represents gradient with respect to \(\tau\).</li> <li>\(\text{tr}\) represents trace.</li> <li>\(\mathcal{I}\) is the Fisher information matrix.</li> </ul> <p>(Some regularity conditions are needed to allow swapping the order of expectation and gradient. Also the above is for the case where the trace of the Fisher information is easily differentiable e.g. using automatic differentiation. See our paper for more details.)</p> <p>We can now use a powerful off-the-shelf method - stochastic gradient optimisation. We produce a sequence of \(\tau_i\) values where \(\tau_{i+1}\) equals \(\tau_i\) plus a step in the direction of \(\widehat{\nabla_\tau \mathcal{J}(\tau_i)}\). These converge to a local maximum of \(\mathcal{J}(\tau)\).</p> <p><a href="http://ruder.io/optimizing-gradient-descent/">Lots of powerful adaptive stochastic gradient optimisation methods</a> have recently been developed in the machine learning literature. They are typically used for learning the parameters of neural networks, and so can handle upwards of millions of unknowns. So we simply use the popular <a href="https://arxiv.org/abs/1412.6980">Adam algorithm</a> for optimisation.</p> <p>To summarise, we are in the nice position of simply applying standard gradient based optimisation to an easily available gradient estimator of our objective function \(\mathcal{J}\). In contrast, under most other utility functions, evaluating the objective function or its gradient is much more computationally demanding, and can necessitate using specialised optimisation algorithms or introducing approximations.</p> <h2 id="example-geostatistical-regression">Example: geostatistical regression</h2> <p>Our paper contains an application to geostatistical regression. We are collecting spatial data assumed to follow a Gaussian process model with linear trends which we wish to learn about. Our method can find optimal designs of 100 locations in under a minute. The following figure shows some of the designs under various GP parameter choices. (See the paper for more details.) These show an interesting mix of regularly spaced points or concentration near the corners.</p> <p><img src="/assets/img/SGOFIG_fig6.png" alt="Geostat results" title="Geostatistical results" height="300px"/></p> <h2 id="difficulty-1-reparameterisation-and-weighting">Difficulty 1: reparameterisation and weighting</h2> <p>One difficulty of our approach is that the Fisher information matrix is not <strong>invariant to reparameterisation</strong>, and therefore neither is our utility function. That is, simply by working with our parameters on different scales, we can end up with different designs. This is not a desirable property!</p> <p>To deal with this we work with a <strong>weighted utility function</strong>. Our original utility function is the sum of the diagonal elements of the Fisher informatoon matrix. The weighted version instead uses a weighted sum of these elements. We propose an algorithm to adaptively select the weights so that we learn a similar amount of information on each parameter.</p> <h2 id="difficulty-2-repeated-design-points-local-maxima-and-post-processing">Difficulty 2: repeated design points, local maxima and post-processing</h2> <p>Another difficult of our approach is that it converges to <strong>local maxima</strong> of the expected utility rather than the desired global maximum. We found this particularly problematic in one example - see Section 6 of the paper. Here the designs represented a vector of times at which to make observations. Our optimal designs turned out to select repeated observations at two particular time points. Over multiple runs of our optimiser, there was considerable variation of how many design points were placed at each of these two times i.e. these outcomes formed many local maxima.</p> <p>To deal with this <strong>we recommend post-processing our output if there are repeated points</strong>. We use the “ACE phase II” post-processing method implemented in <a href="https://cran.r-project.org/web/packages/acebayes/index.html">the R package for ACE</a>. This performs combinatorial optimisation by moving design points between replicated groups.</p> <p>Whether or not there are repeated design points, <strong>we always recommend running our method multiple times from multiple starting designs</strong>. This checks for multiple local maxima.</p> <p>It’s unclear whether repeated design points should be regarded as problematic or not. For example <a href="https://amstat.tandfonline.com/doi/abs/10.1080/00401706.2018.1469433">Binois et al</a> recently argued that replicated observation times can be highly informative. Alternatively the tendency for replication in this example could represent some undesirable features of the utility function. I’ll discuss this further in the <a href="/blog/2019/experimental_design_pt2/">second part</a> of this blog post.</p> <h2 id="future-research-directions">Future research directions</h2> <p>We’ve used off-the-shelf stochastic gradient optimisation methods to allow fast Bayesian optimal design which can scale up to higher dimensional designs than most existing methods. These optimisers are typically designed for neural network applications. It would be interesting to see if variants can be designed specifically for experimental design. For example these could try to escape local maxima using tempering or line search.</p> <p>Also all our examples were for fully observed models. The required Fisher information calculations are harder for models with latent/nuisance variables. Extending our method to this setting is another interesting possibility.</p>]]></content><author><name></name></author><category term="research"/><category term="Bayesian statistics"/><category term="Experimental design"/><summary type="html"><![CDATA[Edit: This post is now very out of date! See version 3+ of the paper for a new approach.]]></summary></entry><entry><title type="html">Bibtex tips</title><link href="https://dennisprangle.github.io/blog/2019/bibtex/" rel="alternate" type="text/html" title="Bibtex tips"/><published>2019-08-04T00:00:00+00:00</published><updated>2019-08-04T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/bibtex</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/bibtex/"><![CDATA[<p>This post lists a few tips I’ve found useful for using bibtex, the standard tool for creating a bibliography in LaTeX:</p> <ul> <li> <p><strong>Essential</strong> tips on getting thing displayed in the “standard” way (at least for statistics/machine learning community I work in). These should be pretty familiar to regular users, but hopefully are helpful to people writing their first papers.</p> </li> <li> <p><strong>Optional</strong> tips which are often broken in papers, but do make your bibliography look professional (although that’s sometimes a marginal concern!)</p> </li> <li> <p><strong>Miscellaneous</strong> tips, mainly those that are hard to come up with the right search term from on the internet.</p> </li> </ul> <p>Note that rules for particular journals and/or bibtex style files may differ from what’s below, so double-check!</p> <p>Here’s a <a href="https://serialmentor.com/blog/2015/10/2/Bibtex">nice nice blog post on some of the mysteries of bibtex</a>.</p> <h2 id="essential-tips">Essential tips</h2> <ul> <li> <p>Google scholar is a great place to download a bibtex reference for papers from. First click on the quotation mark symbol under a listing, as shown in this screenshot.<br/> <img src="/assets/img/cite1.png" alt="google scholar screenshot" title="screenshot" height="100px"/><br/> Then click on the “BibTeX” link at the bottom of the window that pops up.<br/> However google scholar listings often have various errors, so it’s worth double-checking them! This is also true of other internet sources of bibtex code. Some of the formatting problems listed below are quite common. But basic details like author names can also sometimes be incorrect, so check against the actual paper.</p> </li> <li> <p>Bibtex has facilitities for many fields which are rarely required in bibliographies e.g. publication month, URL, ISSN. Unfortunately if you complete these they often end up in the bibliography output (depending on the bibtex style file). To be safe it’s easiest to simply delete these fields. You typically just need author, title, journal, year, volume, pages, or similar for conferences. For books you also need publisher.</p> </li> <li> <p>If space is an issue, shorten long journal or conference names. Long lists of editors can also usually be omitted.<br/> For example: “In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.” can usually be shortened to “International Conference on Machine Learning, 2018” or even just “ICML 2018”.</p> </li> <li> <p>Truncate very long author lists and add “and others” to get references saying “et al”. See <a href="https://tex.stackexchange.com/a/123607">this stackoverflow answer</a> for an example. Exactly how many authors to leave in is up to you!</p> </li> <li> <p>Put full stops (/periods) after each middle initials and spaces between them. Otherwise many bibtex styles will leave them out or display them incorrectly. This is important for authors whose identity becomes unclear without the middle initials!</p> </li> <li> <p>Use <code class="language-plaintext highlighter-rouge">\cite</code> to cite a reference in text e.g. Bayes (1763) and <code class="language-plaintext highlighter-rouge">\citep</code> to cite a reference in parentheses (Bayes, 1763). More complicated citations (see e.g. Bayes, 1763) can be achieved using <code class="language-plaintext highlighter-rouge">\citealt</code> and <code class="language-plaintext highlighter-rouge">\citealp</code>, <a href="https://tex.stackexchange.com/a/102549">as described here</a>. An alternative is to pass optional arguments to <code class="language-plaintext highlighter-rouge">\citep</code>. This and many other variants of these commands is described <a href="http://merkel.texture.rocks/Latex/natbib.php">in this reference</a>.</p> </li> </ul> <h2 id="optional-tips">Optional tips</h2> <ul> <li> <p>Use curly braces to indicate words which should remain capitalised e.g. {Markov} chain {Monte Carlo} in {Bayesian} statistics.</p> </li> <li> <p>Be in consistent within a particular bibliography e.g. in what you call authors, journals, conferences etc.</p> </li> <li> <p>Double-check before submission whether any preprints now have published versions.</p> </li> <li> <p>Make your bibtex keys consistent. One common format is author, year, first word of title e.g. <code class="language-plaintext highlighter-rouge">@book{zeng2013state</code>.</p> </li> </ul> <h2 id="miscellaneous-tips">Miscellaneous tips</h2> <ul> <li> <p>Write hyphenated first names in full e.g. “Jean-Michel”. They will then be shown correctly in the bibliography e.g. “J.-M.”</p> </li> <li> <p>There are options in the ‘natbib’ package for sorting and compressing numerical citations e.g. so that [4,2,1,3] is converted to [1-4]. Select these when importing the package: <code class="language-plaintext highlighter-rouge">\usepackage[numbers, sort&amp;compress]{natbib}</code> For more details see <a href="https://texfaq.org/FAQ-citesort">here</a>.</p> </li> <li> <p>An annoying bug when using bibtex and natbib is that papers with the same first author and year, but different author lists, are sometimes given the same citation. See <a href="https://tex.stackexchange.com/q/310628">here</a> for a fuller description of the problem. The <a href="https://tex.stackexchange.com/a/84982">best resolution</a> to this I’ve seen is to use biblatex and biber instead.</p> </li> </ul>]]></content><author><name></name></author><category term="Tips"/><category term="Tips"/><category term="LaTeX"/><summary type="html"><![CDATA[This post lists a few tips I’ve found useful for using bibtex, the standard tool for creating a bibliography in LaTeX:]]></summary></entry><entry><title type="html">Posters in LaTeX</title><link href="https://dennisprangle.github.io/blog/2019/latex-posters/" rel="alternate" type="text/html" title="Posters in LaTeX"/><published>2019-05-12T00:00:00+00:00</published><updated>2019-05-12T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/latex-posters</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/latex-posters/"><![CDATA[<p>LaTeX is designed for typesetting mathematical documents, but it can also be used for posters. It’s not the only option, but it’s pretty convenient if you want to include a lot of mathematics in your poster and/or quickly reuse material from an article. This post distills the advice I usually give students who are making their first poster.</p> <p>There are several LaTeX packages for posters. I use <em>beamerposter</em> which I think is the most popular. This is great for making a professional poster quickly, but if you want to stand out try something more unusual. I’ve heard some good things about alternatives including <a href="http://asishghoshal.com/blog/2017/minimal-poster/">minimal-poster</a> and <a href="https://ctan.org/pkg/tikzposter">tikzposter</a> but haven’t tried them. See <a href="https://tex.stackexchange.com/questions/341/how-to-create-posters-using-latex">this stack exchange answer</a> for many more options.</p> <p>A good place to start by editting an existing example such as <a href="http://www.latextemplates.com/template/jacobs-landscape-poster">this template</a> or the one in this <a href="http://robjhyndman.com/hyndsight/beamer-poster/">blog post by Rob Hyndman</a>. When creating a poster you need to select a theme describing some style choices. The beamerposter package comes with some <a href="https://github.com/deselaers/latex-beamerposter/tree/master/themes">defaults</a>. For colleagues/students at Newcastle University, <a href="https://gist.github.com/dennisprangle/788783f6a7679f4dde7373b6dc21cb9e">here’s a theme including the university logo</a> (created by editting a theme passed down to me by a former colleague.) You’ll need to download the logo separately. The exact file I used is at available <a href="http://www.nodes.ac.uk/wp-content/themes/hotrod/img/logo/university/Newcastle_University.png">here</a> for example. (This logo is probably a bit out of date now. There are some <a href="https://wiki.mas.ncl.ac.uk/mas/SchoolGraphics">more recent files</a> on the NU maths wiki, if you have access to that. But you may need to play around with image sizes etc. to make it look nice.)</p> <p>The <code class="language-plaintext highlighter-rouge">.sty</code> file used to define a beamerposter theme is fairly easy to edit, and lets you tweak a lot of the appearance options. An undergraduate dissertation student a couple of years ago improved on my theme file a lot like this but sadly I never got hold of his code!</p> <p>For more on beamerposter, here’s <a href="http://tug.org/pracjourn/2012-1/shang/shang.pdf">a journal article on using it</a>, its <a href="https://ctan.org/pkg/beamerposter">Comprehensive TeX Archive Network page</a> and its <a href="https://github.com/deselaers/latex-beamerposter">github page</a>. Finally, here are some tips on how you can <a href="https://veronikach.com/lifestyle/how-to-recycle-your-fabric-poster-faq/">recycle your used fabric poster into clothing</a>.</p>]]></content><author><name></name></author><category term="Tips"/><category term="Posters"/><category term="Tips"/><category term="LaTeX"/><category term="Newcastle university"/><summary type="html"><![CDATA[LaTeX is designed for typesetting mathematical documents, but it can also be used for posters. It’s not the only option, but it’s pretty convenient if you want to include a lot of mathematics in your poster and/or quickly reuse material from an article. This post distills the advice I usually give students who are making their first poster.]]></summary></entry><entry><title type="html">Mailing lists</title><link href="https://dennisprangle.github.io/blog/2019/mailing-lists/" rel="alternate" type="text/html" title="Mailing lists"/><published>2019-04-28T00:00:00+00:00</published><updated>2019-04-28T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2019/mailing-lists</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2019/mailing-lists/"><![CDATA[<p>I’ve been meaning to resurrect my blog to write a few posts on background information for graduate students. These are things I wished I knew when I was doing my PhD 10 years ago, and will be most relevant for people working the same field of computational statistics as me. Hopefully this will at least be useful to the students I’m advising if no-one else! These posts are unlikely to be exhaustive, so please let me know about anything I’ve missed in the comments or on twitter.</p> <p>This post is a short one on the topic of <strong>mailing lists</strong>. Although a slightly old fashioned technology now, I find mailing lists are still the best place to read about announcements of conferences, workshops, jobs, interships etc.</p> <p>The main mailing list for UK statistics announcements is <a href="https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=ALLSTAT">allstat</a>. There’s also a nice <a href="https://twitter.com/allstat_mail">@allstat_mail</a> feed of posts to the list.</p> <p>The <a href="https://groups.google.com/forum/#!forum/ML-news">ML-news</a> google group is good for international announcements on machine learning.</p> <p>These two mailing lists have a huge number of posts. The others I’m subscribed to have far fewer, but still contain interesting information:</p> <ul> <li>The Royal Statistical Society’s <a href="https://groups.google.com/forum/?forum/rss-csml#!forum/rss-csml">Computational Statistics and Machine Learning list</a></li> <li>Sheffield’s <a href="http://www.mucm.ac.uk/Pages/UCMMailingList.html">Managing uncertainty in complex models</a></li> </ul>]]></content><author><name></name></author><category term="Tips"/><category term="Email"/><category term="Tips"/><category term="Statistics"/><category term="Machine Learning"/><summary type="html"><![CDATA[I’ve been meaning to resurrect my blog to write a few posts on background information for graduate students. These are things I wished I knew when I was doing my PhD 10 years ago, and will be most relevant for people working the same field of computational statistics as me. Hopefully this will at least be useful to the students I’m advising if no-one else! These posts are unlikely to be exhaustive, so please let me know about anything I’ve missed in the comments or on twitter.]]></summary></entry><entry><title type="html">Bayesian inference by neural networks. Part 1: background</title><link href="https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks/" rel="alternate" type="text/html" title="Bayesian inference by neural networks. Part 1: background"/><published>2016-06-07T00:00:00+00:00</published><updated>2016-06-07T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks/"><![CDATA[<p>Recently George Papamakarios and Iain Murray published <a href="http://arxiv.org/pdf/1605.06376.pdf">an arXiv preprint</a> on likelihood-free Bayesian inference which substantially beats the state-of-the-art performance by a neat application of neural networks. I’m going to write a pair of blog posts about their paper. First of all this post summarises background material on likelihood-free methods and their limitations. The <a href="/blog/2016/bayesian-inference-by-neural-networks2/">second post</a> will review and comment on the new paper. Over the next few months I’m hoping to spend some time experimenting with their method, and I might post about my experiences in implementing it, if it’s amenable to short blog posts!</p> <p><strong>Edit Nov 2016:</strong> I started trying to implement this method but got distracted by new research ideas! Also I found George Papamakarious’s <a href="https://github.com/gpapamak/epsilon_free_inference">theano code</a> for this paper. Amongst other things, this illustrates how to implement Cholesky products neatly in theano, something I’d have struggled to figure out by myself. More generally the <a href="http://edwardlib.org/tutorials/mixture-density-network">Edward library</a> can implement MDNs using TensorFlow, although I’m not sure if it automates Cholesky products.</p> <h2 id="intractable-likelihoods">Intractable likelihoods</h2> <p><em>Model-based statistics</em> assumes that the observed data (e.g. deaths from an infectious disease) has been produced from a random distribution or <em>probability model</em>. The model usually involves some unknown <em>parameters</em> (e.g. controlling rates of infection and death for a disease). <em>Statistical inference</em> aims to learn the parameters from the data. This might be an end in itself - if the parameters have interesting real world implications we wish to learn - or as part of a larger workflow such as prediction or decision making.</p> <p>Classical approaches to statistical inference are based on the probability (or probability density) of the observed data \(y_0\) given particular parameter values \(\theta\). This is known as the <em>likelihood function</em>, \(\pi(y_0|\theta)\). Since \(y_0\) is fixed this is a function of \(\theta\) and so can be written \(L(\theta)\). Approaches to inference involve optimising this, used in <a href="https://en.wikipedia.org/wiki/Maximum_likelihood">maximum likelihood</a> methods, or exploring it, for <a href="https://en.wikipedia.org/wiki/Bayesian_statistics">Bayesian</a> methods, which are described in more detail shortly. A crucial implicit assumption of both approaches is that it’s possible and computationally inexpensive to numerically evaluate the likelihood function.</p> <p>As computing power has increased over the last few decades, there are an increasing number of interesting situations for which this assumption doesn’t hold. Instead models are available from which data can be simulated, but where the likelihood function is <em>intractable</em>, in that it cannot be numerically evaluated in a practical time. Examples include models of:</p> <ul> <li>Climate</li> <li>High energy physics reactions</li> <li>Variation in genetic sequences over a population</li> <li>Molecular level biological reactions</li> <li>Infectious diseases</li> </ul> <p>One common reason for intractability is that there are a very large number of ways in which the observable data can be generated, and it would be necessary to sum the probability contributions of all of these.</p> <h2 id="bayesian-inference">Bayesian inference</h2> <p>The majority of work in this area, including the paper I’m discussing, is focused on the Bayesian approach to inference. Here a probability distribution must be specified on the unknown parameters, usually through a density \(\pi(\theta)\). This represents <em>prior beliefs</em> about the parameters before any data is observed. The aim is to learn the <em>posterior beliefs</em> resulting from updating the prior to incorporate the observations. Mathematically this is an application of conditional probability using Bayes theorem: the posterior is \(\pi(\theta | y_0) = k \pi(\theta) L(\theta)\), where \(k\) is a constant of proportionality that is typically hard to calculate. A central aim of Bayesian inference is to produce methods which approximate useful properties of the posterior in a reasonable time.</p> <h2 id="simulator-based-inference-and-abc">Simulator based inference and ABC</h2> <p><a href="/blog/2016/LFtimeline/">Several methods</a> have been proposed for inference using simulators rather than the likelihood function, sometimes called “likelihood-free inference”. One of the most popular is <a href="https://en.wikipedia.org/wiki/Approximate_Bayesian_computation">approximate Bayesian computation</a>. The simplest version of this is based on <a href="https://en.wikipedia.org/wiki/Rejection_sampling">rejection sampling</a>:</p> <ol> <li>Sample \(\theta_i\) values for \(1 \leq i \leq n\) from \(\pi(\theta)\).</li> <li>Simulate datasets \(y_i\) from the model given parameters \(\theta_i\) for \(1 \leq i \leq n\).</li> <li>Accept parameters for which \(d(y_i, y_0) \leq \epsilon\), and reject the remainder.</li> </ol> <p>Here the user must specify the number of iterations \(n\), the acceptance threshold \(\epsilon\), and the distance function \(d(\cdot,\cdot)\).</p> <p>The accepted parameters are a sample from an approximation to the posterior with density proportional to \(\int \pi(\theta | y) I(d(y,y_0) \leq \epsilon) dy\) (where \(I\) represents an indicator function: 1 when \(y\) makes its argument is true and 0 otherwise.)</p> <p>Obtaining a sample from the posterior is a standard approach to Bayesian inference known as the <em>Monte Carlo method</em>. Such a sample can be used to approximate most interesting properties of the posterior. Sampling from an approximation to the posterior, as in ABC, allows inference but adds an extra layer of approximation.</p> <p>Rejection sampling is inefficient. Typically the posterior is much more concentrated than the prior, especially if there are more than a handful of parameters to learn. Therefore most simulations will be rejected. Several more sophisticated ABC algorithms have been invented to avoid this difficulty. These include versions of <a href="http://www.pnas.org/content/100/26/15324.short">Markov chain Monte Carlo</a> (MCMC) and <a href="http://rsif.royalsocietypublishing.org/content/6/31/187.short">sequential Monte Carlo</a> (SMC). Both of these propose \(\theta\) values which attempt to focus on regions of higher posterior probability.</p> <p>More recently several other algorithms have been proposed to improve the efficiency of ABC. These include ideas such as <a href="http://arxiv.org/abs/1502.05503">Bayesian optimisation</a>, <a href="http://papers.nips.cc/paper/5881-optimization-monte-carlo-efficient-and-embarrassingly-parallel-likelihood-free-inference">learning latent variables</a> <a href="http://arxiv.org/abs/1512.00205">expectation propagation</a> and <a href="http://arxiv.org/abs/1305.4283">classical testing theory</a>, as well as various methods which, like that of Papamakarios and Murray, use <a href="http://arxiv.org/abs/1506.02169">classifiers</a> and <a href="http://arxiv.org/abs/1605.05537">regression</a> methods from machine learning.</p> <h2 id="limitations-of-likelihood-free-methods">Limitations of likelihood-free methods</h2> <p>ABC works well for sufficiently simple problems. For example see this <a href="http://www.annualreviews.org/doi/abs/10.1146/annurev-ecolsys-102209-144621?journalCode=ecolsys">review article</a> on applications in genetics and ecology. But it has several serious drawbacks in more difficult problems.</p> <h3 id="1-tuning-requirements">1) Tuning requirements</h3> <p>The ABC rejection algorithm outlined above requires selection of a threshold \(\epsilon\). There’s some theoretical work on its optimal choice in an asymptotic regime of a very large number of simulations, but it’s hard to apply this in practice. One reason is that more complex ABC algorithms require many other tuning choices with interact with selection of \(\epsilon\). A particularly challenging issue is the choice of summary statistics (see item 4 in this list).</p> <h3 id="2-validation">2) Validation</h3> <p>ABC samples from an approximation to the posterior, and it’s hard to know how much to trust this approximation.</p> <h3 id="3-expensive-simulators">3) Expensive simulators</h3> <p>Even efficient ABC algorithms usually require at least tens of thousands of simulations. This can be impractical for expensive simulators.</p> <h3 id="4-high-dimensional-data-and-parameters">4) High dimensional data (and parameters)</h3> <p>ABC suffers from a <em>curse of dimensionality</em> problem. This is because it uses a nearest neighbours type approach. Parameters are inferred based on the simulated data sets which are closest to the observations. But as the dimension of the data increases, the simulations become increasingly sparse in the space of data sets, so the nearest neighbours become worse representations of the observed data. This can be a problem for ABC even when the dimension of the data reaches as low as the tens!</p> <p>To deal with this problem practitioners have used dimension reduction methods to replace high dimensional data with low dimensional summary statistics. This tuning choice involves some loss of information about the parameters. It’s hard to judge which choice of summaries makes the best trade-off between information and dimension, although many methods have been proposed.</p> <p>ABC usually also performs poorly for high dimensional parameters. This is because learning such parameters generally entails having data which is high dimensional enough to cause problems.</p> <p>In the <a href="/blog/2016/bayesian-inference-by-neural-networks2/">second blog post</a> I’ll look at how the new paper tackles some of these problems.</p>]]></content><author><name></name></author><category term="research"/><category term="ABC"/><category term="Likelihood-free"/><category term="Neural networks"/><summary type="html"><![CDATA[Recently George Papamakarios and Iain Murray published an arXiv preprint on likelihood-free Bayesian inference which substantially beats the state-of-the-art performance by a neat application of neural networks. I’m going to write a pair of blog posts about their paper. First of all this post summarises background material on likelihood-free methods and their limitations. The second post will review and comment on the new paper. Over the next few months I’m hoping to spend some time experimenting with their method, and I might post about my experiences in implementing it, if it’s amenable to short blog posts!]]></summary></entry><entry><title type="html">Bayesian inference by neural networks. Part 2: new paper</title><link href="https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks2/" rel="alternate" type="text/html" title="Bayesian inference by neural networks. Part 2: new paper"/><published>2016-06-07T00:00:00+00:00</published><updated>2016-06-07T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks2</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2016/bayesian-inference-by-neural-networks2/"><![CDATA[<p>In <a href="/blog/2016/bayesian-inference-by-neural-networks/">part 1</a> I reviewed likelihood-free inference and its limitations. This post looks at a <a href="http://arxiv.org/pdf/1605.06376.pdf">new approach</a> by George Papamakarios and Iain Murray which avoids some of these issues and delivers an orders-of-magnitude improvement in performance. Most of the post will describe their paper. Then I’ll close with a few comments on the method’s advantages and possible limitations.</p> <h2 id="regression-approaches-to-likelihood-free-inference">Regression approaches to likelihood-free inference</h2> <p>For now I’ll consider the problem of approximating the posterior \(\pi(\theta \vert y_0)\) given simulations \((\theta_i, y_i)\) from \(\pi(\theta) \pi(y \vert \theta)\) for \(1 \leq i \leq N\). The paper also simulates from other distributions, which I’ll discuss below later. (n.b. Out of habit, I’m using slightly different notation to the paper. They use \(x\) for datasets, \(x_o\) for the observations, and \(p\) instead of \(\pi\).)</p> <p>As described in <a href="/blog/2016/bayesian-inference-by-neural-networks/">part 1</a>, ABC approaches operate by a nearest neighbours approach. That is, it approximates the posterior using \(\theta_i\) values such that \(y_i\) is close to \(y_0\). But this performs poorly unless \(y\) is low dimensional.</p> <p>An alternative approach is to use <em>regression</em>. This uses the simulations to train a system predicting \(\theta\) from \(y\) and then returns the predictions for \(y_0\). Rather than just base its output on the nearest neighbours, regression uses <em>all</em> the data to learn relationships between <em>features</em> of \(y\), \(f_1(y), f_2(y), \ldots\), and \(\theta\). (The assumption that such relationships exist is, I think, what the machine learning community sometimes refers to as “compositionality”.) Hopefully even \(y_i\) values which are not close to \(y_0\) are useful in learning about these relationships. <a href="https://en.wikipedia.org/wiki/Linear_regression">Classical linear regression</a> requires the user to define the features and allows only linear relationships. Modern methods such as neural networks (a) can learn the features and (b) use non-linear relationships, although allowing more complexity in either requires more data to learn well.</p> <p>Most regression methods output a single “point” prediction. This is problematic here as we want to learn more than this. In the Bayesian setting we want to learn a whole distribution, summarising the uncertainty about \(\theta\) given \(y_0\). In the next section I’ll outline how Papamakarios and Murray deal with this.</p> <p>There is a history of using regression in likelihood-free methods. <a href="http://www.genetics.org/content/162/4/2025.short">Beaumont Zhang and Balding</a> find nearest neighbours in a traditional ABC step, then use these for regression. A nice feature of this approach is that the set of nearest neighbours gives a distribution for \(\theta\), which is then adjusted by the regression. <a href="http://link.springer.com/article/10.1007/s11222-009-9116-0">Blum and François</a> generalise this to use neural network regression. <a href="http://www.degruyter.com/view/j/sagmb.2011.10.issue-1/1544-6115.1684/1544-6115.1684.xml">Bonassi and West</a> propose a regression approach (with no initial ABC step) based on fitting a mixture of normals to the \((\theta_i,y_i)\) simulations.</p> <h2 id="mixture-density-networks">Mixture density networks</h2> <p>Papamakarios and Murray use a <a href="https://en.wikipedia.org/wiki/Feedforward_neural_network">feed-forward neural network</a> approach. These are composed of several layers of variables, the initial layer being the inputs, in this case \(y\). The next layer is created by applying a linear transformation and then element-wise non-linear transformations. That is, an element of the second layer is a formed by taking a weighted sum of the \(y\)s and then applying a <a href="https://en.wikipedia.org/wiki/Logistic_function">logistic function</a> or something similar. Subsequent layers are formed similarly. The final layer is the output, which for example could be predictions of \(\theta\). The network is specified by all the weights it uses. These are tuned by optimisation: ensuring the predictions are as close as possible to the true \(\theta_i\)s according to some mathematical function (e.g. minimising sum of squared errors, or maximising likelihood). A lot of techniques have been created to allow this to be done well. One technique used in this paper (Section 2.5) which seemed important, although I didn’t entirely follow it, was to use a stochastic variational inference (SVI) method to avoid overfitting due to small sample sizes.</p> <p>As mentioned above, neural network regression provides the advantages of learning features of \(y\) - the variables in intermediate layers - and fitting non-linear relationships. However it has the disadvantage of not outputting a distribution. To deal with this the paper uses a <em>mixture density network</em> (MDN), which outputs the parameters of a <em>mixture distribution</em>, in this paper a normal mixture. This can be viewed as representing the posterior distribution as several clusters. Each cluster has an associated weight, and is defined by its mean vector and variance matrix. The final layer of neural network contains all of these details, represented in a neat form that ensures any output gives a valid distribution. The network is fitted by maximising the density of the observed \(\theta\) values under the mixture density, which is performed iteratively on small batches of data using an efficient variant on stochastic gradient descent.</p> <p>One reason to concentrate on mixtures of normals is that it is straightforward to calculate many posterior summaries without the need to resort to Monte Carlo. They also facilitate the sequential methods described below.</p> <p>A nice feature of the paper is that the neural networks are not deep. They use only one or two hidden layers and are fitted to a relatively small amount of simulated data. Only up to around \(10^5\) simulated datasets are used for training, and much fewer for the most efficient of the proposed methods. (Although one example does also require a pilot of \(10^5\) simulations.)</p> <h2 id="sequential-simulation">Sequential simulation</h2> <p>The set-up above tries to learn the global relationship between the posterior \(\pi(\theta \vert y)\) and \(y\), which is potentially very complicated. The paper proposes focusing on a local part of this relationship which is relevant to learning \(\pi(\theta \vert y_0)\), with the goal of reducing the amount of simulated data required.</p> <p>Papamakarios and Murray do this by using a sequential approach. First they learn a rough estimate of the posterior \(\tilde{\pi}(\theta)\) using the MDN approach outlined above. As will be seen shortly, it turns out to be useful to just fit a normal distribution rather than a mixture. Then they sample \((\theta_i, y_i)\) pairs from the distribution \(\tilde{\pi}(\theta) \pi(y|\theta)\). Using a MDN the corresponding mixture estimate \(q(\theta | y_0)\) is learnt. This is adjusted by importance sampling to take into account the sampling distribution, to produce \(\frac{\pi(\theta)}{\tilde{\pi}(\theta)} q(\theta | y_0)\). The paper focuses on the case where \(\pi(\theta)\) is normal or uniform. In this case, since \(\tilde{\pi}(\theta)\) is also normal, the resulting posterior estimate can be shown to itself be a mixture of normals (see Appendix C of the paper).</p> <p>The paper considers several schemes:</p> <ol> <li>A non-sequential approach fitting a mixture estimate.</li> <li>Several iterations of sequential scheme above, always returing a normal estimate of the posterior. (This was where the SVI method mentioned above was needed.)</li> <li>Using the result of 2 as a proposal density to fit a mixture estimate of the posterior.</li> </ol> <p>As noted in the paper, this general idea of a sequential approach is similar in spirit to existing sequential Monte Carlo algorithms for ABC. Edit: In this literature, it’s considered to be a good idea to sample \(\theta\) from a wider distribution than the current approximation of the posterior: see <a href="http://biomet.oxfordjournals.org/content/96/4/983">Beaumont et al</a> and a more theoretical argument in <a href="http://arxiv.org/abs/1506.03481">Li and Fearnhead</a>. I wonder if the same applies here.</p> <h2 id="simulation-studies">Simulation studies</h2> <p>The paper contains several simulation studies, studying how well the method learns for observations simulated under known parameter values. In all studies the MDN methods substantially outperform ABC methods: rejection, MCMC and SMC. Typically fitting the <em>entire posterior</em> has a cost is comparable to producing a <em>single</em> effective sample under ABC. And the quality of the posterior fits is comparable to or better than the best produced under ABC, without the need to worry about what value of \(\epsilon\) should be used.</p> <p>Of the 3 MDN schemes mentioned above, the sequential methods require substantially fewer parameters. In some cases the quality of the fit is similar for both of these methods, but in others the mixture model is superior to the normal model.</p> <h2 id="comments">Comments</h2> <p>This paper certainly seems like a big step forwards for likelihood-free inference, making substantial progress on most of the limitations listed in my <a href="/blog/2016/bayesian-inference-by-neural-networks/">first post</a>. Benefits include:</p> <ul> <li>Beating the performance of ABC methods by orders of magnitude.</li> <li>Avoiding the tuning parameter \(\epsilon\), which is notoriously hard to select and interpret.</li> <li>Reducing - but not eliminating, see below - the need to choose summary statistics.</li> </ul> <p>However as an academic I’m required to be cautious and say further research is needed to validate the performance of the algorithm in applied settings. In particular one issue with existing ABC regression methods is that they can produce very poor estimates when the observations are substantially different to the simulated data. This is because the regressions need to extrapolate rather than interpolate. I wonder if the MDN approach is robust to this sort of problem.</p> <p>Finally here are some other comments on the approach.</p> <ul> <li> <p><strong>Tuning choices</strong> Is there a good way to decide tuning issues such as how many mixture components to use and the architecture the neural network?</p> </li> <li> <p><strong>Scaling to high dimensional data</strong> The paper considers two examples with high dimensional data, a model of population dynamics and a queuing system. The population example has around 300 observations (large in the context of likelihood-free methods!) The queuing example has a variable number of observations. In both case a small number of summary statistics of the data are used as input to the neural network. This raises several questions (a) what’s a good way to choose summary statistics here - are methods proposed for ABC still of any use? (b) can we judge how much information is lost by using summary statistics (c) can dimension reduction be included as an initial stage of the neural network e.g. through some suitable sparse network structure to avoid needing an enormous amount of data.</p> </li> <li> <p><strong>Parameterisation</strong> Some posteriors are closer to normal after a parameter transformation. Perhaps a suitable transformation - e.g. elementwise Box Cox transformations - could be learnt jointly with the rest of the model.</p> </li> <li> <p><strong>Uncertainty</strong> It would be nice to take into account the uncertainty of the estimated posterior. Perhaps the Bayesian SVI method mentioned in the paper could produce this as a by-product.</p> </li> <li> <p><strong>Validation</strong> Is it any easier to validate the quality of a fitted posterior than for ABC output?</p> </li> <li> <p><strong>Scaling to high dimensional parameters</strong> The variance matrices in the mixture model requires \(O(p^2)\) parameters (where \(p\) is the number of parameters) which might make scaling to large \(p\) difficult.</p> </li> <li> <p><strong>Latent variables</strong> Sometimes we’d like to include latent variables as parameters, and then integrate them out. For example in model choice it’s generally efficient to learn about the parameters of each model. Similarly in parameter inference perhaps it would be beneficial to learn about latent variables representing part of the stochastic simulation process.</p> </li> <li> <p>Edit: <strong>Tails</strong> Normal mixtures won’t be able to match especially heavy or light tailed posteriors. Is there a flexible alternative?</p> </li> </ul>]]></content><author><name></name></author><category term="research"/><category term="ABC"/><category term="Likelihood-free"/><category term="Neural networks"/><summary type="html"><![CDATA[In part 1 I reviewed likelihood-free inference and its limitations. This post looks at a new approach by George Papamakarios and Iain Murray which avoids some of these issues and delivers an orders-of-magnitude improvement in performance. Most of the post will describe their paper. Then I’ll close with a few comments on the method’s advantages and possible limitations.]]></summary></entry><entry><title type="html">Jupyter and R basics</title><link href="https://dennisprangle.github.io/blog/2016/jupyter-and-r-basics/" rel="alternate" type="text/html" title="Jupyter and R basics"/><published>2016-01-17T00:00:00+00:00</published><updated>2016-01-17T00:00:00+00:00</updated><id>https://dennisprangle.github.io/blog/2016/jupyter-and-r-basics</id><content type="html" xml:base="https://dennisprangle.github.io/blog/2016/jupyter-and-r-basics/"><![CDATA[<p>Below are some slides I wrote on the basics of using R with the <a href="http://jupyter.org/">Jupyter notebook</a>. Navigate by pressing space to avoid missing any slides! You can also see this in notebook form <a href="https://github.com/dennisprangle/R-North-East-Talk-2016">here</a>.</p> <iframe width="840" height="630" src="http://nbviewer.ipython.org/format/slides/github/dennisprangle/R-North-East-Talk-2016/blob/master/Jupyter%20talk%20for%20R%20North-East%20meetup.ipynb" frameborder="0" allowfullscreen="true"> </iframe>]]></content><author><name></name></author><category term="Software"/><category term="Jupyter"/><category term="R"/><category term="Computing"/><summary type="html"><![CDATA[Below are some slides I wrote on the basics of using R with the Jupyter notebook. Navigate by pressing space to avoid missing any slides! You can also see this in notebook form here.]]></summary></entry></feed>