<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[Bayesian Computations of Expected&nbsp;Utility]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><a href="http://www.givewell.org/">GiveWell</a> is an organization that rates charities.  They&#8217;ve met people who argue that</p>
<blockquote>
<p>charities working on reducing the risk of sudden human extinction must be the best ones to support, since the value of saving the human race is so high that “any imaginable probability of success” would lead to a higher expected value for these charities than for others.</p>
</blockquote>
<p>For example, say I have a dollar to spend on charity.  One charity says that with this dollar they can save the life of one child in Somalia.   Another says that with this dollar they can increase by .000001% our chance of saving 1 billion people from the effects of a massive asteroid colliding with the Earth.</p>
<p>Naively, in terms of the expected number of lives saved, the latter course of action seems 10 times better, since</p>
<div align="center">
.000001% &times; 1 billion = 10
</div>
<p>But is it really better?</p>
<p>It&#8217;s a subtle question, with all sorts of complicating factors, like <i>why should I trust these guys?</i>  </p>
<p>I&#8217;m not ready to present a thorough analysis of this sort of question today.   But I would like to hear what you think about it.  And I&#8217;d like you to read what the founder of Givewell has to say about it:</p>
<p>&bull; Holden Karnofsky, <a href="http://blog.givewell.org/2011/08/18/why-we-cant-take-expected-value-estimates-literally-even-when-theyre-unbiased/">Why we can’t take expected value estimates literally (even when they’re unbiased)</a>, 18 August 2011.</p>
<p>He argues against what he calls an &#8216;explicit expected value&#8217; or &#8216;EEV&#8217; approach:</p>
<blockquote><p>
The mistake (we believe) is estimating the “expected value” of a donation (or other action) based solely on a fully explicit, quantified formula, many of whose inputs are guesses or very rough estimates. We believe that any estimate along these lines needs to be adjusted using a “Bayesian prior”; that this adjustment can rarely be made (reasonably) using an explicit, formal calculation; and that most attempts to do the latter, even when they seem to be making very conservative downward adjustments to the expected value of an opportunity, are not making nearly large enough downward adjustments to be consistent with the proper Bayesian approach.
</p></blockquote>
<p>His focus, in short, is on the fact that anyone saying &#8220;this money can increase by .000001% our chance of saving 1 billion people from an asteroid impact&#8221; is likely to be <i>pulling those numbers from thin air</i>.  If they can&#8217;t really back up their numbers with a lot of hard evidence, then our lack of confidence in their estimate should be taken into account somehow. </p>
<p>His article spends a lot of time analyzing a less complex but still very interesting example:</p>
<blockquote><p>
It seems fairly clear that a restaurant with 200 Yelp reviews, averaging 4.75 stars, ought to outrank a restaurant with 3 Yelp reviews, averaging 5 stars. Yet this ranking can’t be justified in an explicit expected utility framework, in which options are ranked by their estimated average/expected value.
</p></blockquote>
<p>This is the only question I really want to talk about today.  Actually I&#8217;ll focus on a similar question that Tim van Beek posed <a href="https://johncarlosbaez.wordpress.com/2011/07/15/rationality-in-humans-and-monkeys/#comment-6751">on this blog</a>:</p>
<blockquote><p>
You have two kinds of fertilizer, A and B. You know that of 4 trees who got A, three thrived and one died. Of 36 trees that got B, 24 thrived and 12 died. Which fertilizer would you buy?
</p></blockquote>
<p>So, 3/4 of the trees getting fertilizer A thrived, while only 2/3 of those getting fertilizer B thrived.  That makes fertilizer A seem better.  However, the sample size is considerably larger for fertilizer B, so we may feel <i>more confident</i> about the results in this case.  Which should we choose?</p>
<p>Nathan Urban <a href="https://johncarlosbaez.wordpress.com/2011/07/15/rationality-in-humans-and-monkeys/#comment-6790">tackled the problem in an interesting way</a>.  Let me sketch what he did before showing you his detailed work.  </p>
<p>Suppose that before doing any experiments at all, we assume the probability <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> that a fertilizer will make a tree thrive is a number <i>uniformly distributed between 0 and 1</i>.  This assumption is our &#8220;Bayesian prior&#8221;. </p>
<p>Note: I&#8217;m not saying this prior is &#8220;correct&#8221;.  You are allowed to choose a different prior!  Choosing a different prior will change your answer to this puzzle.  That can&#8217;t be helped.  We need to make some assumption to answer this kind of puzzle; we are simply making it explicit here.</p>
<p>Starting from this prior, Nathan works out the probability that <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> has some value <i>given that when we apply the fertilizer to 4 trees, 3 thrive</i>.   That&#8217;s the black curve below.   He also works out the probability that <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> has some value  <i>given that when we apply the fertilizer to 36 trees, 24 thrive</i>.  That&#8217;s the red curve:</p>
<div align="center"><a href="http://img30.imageshack.us/img30/1774/binomial.png" rel="nofollow"><img width="450" src="https://i0.wp.com/img30.imageshack.us/img30/1774/binomial.png" /></a></div>
<p>The red curve, corresponding to the experiment with 36 trees, is much more sharply peaked.  That makes sense.   It means that <i>when we do more experiments, we become more confident that we know what&#8217;s going on</i>.</p>
<p>We still have to choose a criterion to decide which fertilizer is best!  This is where &#8216;decision theory&#8217; comes in.  For example, suppose we want to maximize the expected number of the trees that thrive.  Then Nathan shows that fertilizer A is slightly better, despite the smaller sample size.</p>
<p>However, he also shows that if fertilizer A succeeded 4 out of 5 times, while fertilizer B succeeded 7 out of 9 times, the same evaluation procedure would declare fertilizer B better!  Its percentage success rate is less: about 78% instead of 80%.  However, the sample size is larger.  And in this particular case, <i>given our particular Bayesian prior</i> and <i>given what we are trying to maximize</i>, that&#8217;s enough to make fertilizer B win.</p>
<p>So if someone is trying to get you to contribute to a charity, there are many interesting issues involved in deciding if their arguments are valid or just a bunch of&#8230; fertilizer.</p>
<p>Here is Nathan&#8217;s detailed calculation:</p>
<blockquote>
<p>It&#8217;s fun to work out an official &#8216;correct&#8217; answer mathematically, as John suggested.  Of course, this ends up being a long way of confirming the obvious&#8212;and the answer is only as good as the assumptions&#8212;but I think it&#8217;s interesting anyway.  In this case, I&#8217;ll work it out by maximizing expected utility in Bayesian decision theory, for one choice of utility function.  This dodges the whole risk aversion point, but it opens discussion for how the assumptions might be modified to account for more real-world considerations.  Hopefully others can spot whether I&#8217;ve made mistakes in the derivations.</p>
<p>In Bayesian decision theory, the first thing you do is write down the data-generating process and then compute a posterior distribution for what is unknown.</p>
<p>In this case, we may assume the data-generating process (likelihood function) is a binomial distribution <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BBin%7D%28s%2Cn%7C%5Cpi%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Bin}(s,n|&#92;pi)' title='&#92;mathrm{Bin}(s,n|&#92;pi)' class='latex' /> for <img src='https://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' /> successes in <img src='https://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> trials, given a probability of success <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' />.  Fertilizer A corresponds to <img src='https://s0.wp.com/latex.php?latex=s%3D3&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s=3' title='s=3' class='latex' />, <img src='https://s0.wp.com/latex.php?latex=n%3D4&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n=4' title='n=4' class='latex' /> and fertilizer B corresponds to <img src='https://s0.wp.com/latex.php?latex=s%3D24&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s=24' title='s=24' class='latex' />, <img src='https://s0.wp.com/latex.php?latex=n%3D36&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n=36' title='n=36' class='latex' />.</p>
<p>The probability of success <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> is unknown, and we want to infer its posterior conditional on the data, <img src='https://s0.wp.com/latex.php?latex=p%28%5Cpi%7Cs%2Cn%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='p(&#92;pi|s,n)' title='p(&#92;pi|s,n)' class='latex' />.  To compute a posterior we need to assume a prior on <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' />.</p>
<p>It turns out that the <a href="http://en.wikipedia.org/wiki/Beta_distribution" rel="nofollow">Beta</a> distribution is <a href="http://en.wikipedia.org/wiki/Conjugate_prior" rel="nofollow">conjugate</a> to a binomial likelihood, meaning that if we assume a Beta distributed prior, the then the posterior is also Beta distributed.  If the prior is <img src='https://s0.wp.com/latex.php?latex=%5Cpi+%5Csim+%5Cmathrm%7BBeta%7D%28%5Calpha_0%2C%5Cbeta_0%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi &#92;sim &#92;mathrm{Beta}(&#92;alpha_0,&#92;beta_0)' title='&#92;pi &#92;sim &#92;mathrm{Beta}(&#92;alpha_0,&#92;beta_0)' class='latex' /> then the posterior is </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpi+%5Csim+%5Cmathrm%7BBeta%7D%28%5Calpha%3D%5Calpha_0%2Bs%2C%5Cbeta%3D%5Cbeta_0%2Bn-s%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi &#92;sim &#92;mathrm{Beta}(&#92;alpha=&#92;alpha_0+s,&#92;beta=&#92;beta_0+n-s).' title='&#92;pi &#92;sim &#92;mathrm{Beta}(&#92;alpha=&#92;alpha_0+s,&#92;beta=&#92;beta_0+n-s).' class='latex' /></p>
<p>One choice for a prior is a uniform prior on <img src='https://s0.wp.com/latex.php?latex=%5B0%2C1%5D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,1]' title='[0,1]' class='latex' />, which corresponds to a <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BBeta%7D%281%2C1%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Beta}(1,1)' title='&#92;mathrm{Beta}(1,1)' class='latex' /> distribution.  There are of course other prior choices which will lead to different conclusions.  For this prior, the posterior is <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BBeta%7D%28%5Cpi%3B+s%2B1%2C+n-s%2B1%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Beta}(&#92;pi; s+1, n-s+1)' title='&#92;mathrm{Beta}(&#92;pi; s+1, n-s+1)' class='latex' />.  The posterior mode is </p>
<p><img src='https://s0.wp.com/latex.php?latex=%28%5Calpha-1%29%2F%28%5Calpha%2B%5Cbeta-2%29+%3D+s%2Fn&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(&#92;alpha-1)/(&#92;alpha+&#92;beta-2) = s/n' title='(&#92;alpha-1)/(&#92;alpha+&#92;beta-2) = s/n' class='latex' /> </p>
<p>and the posterior mean is </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Calpha%2F%28%5Calpha%2B%5Cbeta%29+%3D+%28s%2B1%29%2F%28n%2B2%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha/(&#92;alpha+&#92;beta) = (s+1)/(n+2).' title='&#92;alpha/(&#92;alpha+&#92;beta) = (s+1)/(n+2).' class='latex' /></p>
<p>So, what is the inference for fertilizers A and B?  I made a graph of the posterior distributions.  You can see that the inference for fertilizer B is sharper, as expected, since there is more data.  But the inference for fertilizer A tends towards higher success rates, which can be quantified.</p>
<div align="center"><a href="http://img30.imageshack.us/img30/1774/binomial.png" rel="nofollow"><img width="450" src="https://i0.wp.com/img30.imageshack.us/img30/1774/binomial.png" /></a></div>
<p>Fertilizer A has a posterior mode of 3/4 = 0.75 and B has a mode of 2/3 = 0.667, corresponding to the sample proportions.  The mode isn&#8217;t the only measure of central tendency we could use.  The means are 0.667 for A and 0.658 for B; the medians are 0.686 for A and 0.661 for B.  No matter which of the three statistics we choose, fertilizer A looks better than fertilizer B.</p>
<p>But we haven&#8217;t really done &#8220;decision theory&#8221; yet.  We&#8217;ve just compared point estimators.  Actually, we have done a little decision theory, implicitly.  It turns out that picking the mean corresponds to the estimator which minimizes the expected squared error in <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' />, where &#8220;squared error&#8221; can be thought of formally as a loss function in decision theory.  Picking the median corresponds to minimizing the expected absolute loss, and picking the mode corresponds to minimizing the minimizing the 0-1 loss (where you lose nothing if you guess <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> exactly and lose 1 otherwise).</p>
<p>Still, these don&#8217;t really correspond to a decision theoretic view of the problem.  We don&#8217;t care about the quantity <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> at all, let alone some point estimator of it.  We only care about <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> indirectly, insofar as it helps us predict something about what the fertilizer will do to new trees.  For that, we have to move from the posterior distribution <img src='https://s0.wp.com/latex.php?latex=p%28%5Cpi%7Cs%2Cn%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='p(&#92;pi|s,n)' title='p(&#92;pi|s,n)' class='latex' /> to the predictive distribution </p>
<p><img src='https://s0.wp.com/latex.php?latex=p%28y%7Cs%2Cn%29+%3D+%5Cint+p%28y%7C%5Cpi%2Cn%29%5C%2Cp%28%5Cpi%7Cs%2Cn%29%5C%2Cd%5Cpi+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='p(y|s,n) = &#92;int p(y|&#92;pi,n)&#92;,p(&#92;pi|s,n)&#92;,d&#92;pi ,' title='p(y|s,n) = &#92;int p(y|&#92;pi,n)&#92;,p(&#92;pi|s,n)&#92;,d&#92;pi ,' class='latex' /> </p>
<p>where <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> is a random variable indicating whether a new tree will thrive under treatment.  Here I assume that the success of new trees follows the same binomial distribution as in the experimental group.</p>
<p>For a Beta posterior, the predictive distribution is beta-binomial, and the expected number of successes for a new tree is equal to the mean of the Beta distribution for <img src='https://s0.wp.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> &#8211; i.e. the posterior mean we computed before, <img src='https://s0.wp.com/latex.php?latex=%28s%2B1%29%2F%28n%2B2%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(s+1)/(n+2)' title='(s+1)/(n+2)' class='latex' />.  If we introduce a utility function such that we are rewarded 1 util for a thriving tree and 0 utils for non-thriving tree, then the expected utility is equal to the expected success rate.  Therefore, under these assumptions, we should choose the fertilizer that maximizes the quantity <img src='https://s0.wp.com/latex.php?latex=%28s%2B1%29%2F%28n%2B2%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(s+1)/(n+2)' title='(s+1)/(n+2)' class='latex' />, which, as we&#8217;ve seen, favors fertilizer A (0.667) over fertilizer B (0.658).</p>
<p>An interesting mathematical question is, does this ever work out to a &#8220;non-obvious&#8221; conclusion?  That is, if fertilizer A has a sample success rate which is greater than fertilizer B&#8217;s sample success rate, but expected utility maximization prefers fertilizer B?  Mathematically, we&#8217;re looking for a set <img src='https://s0.wp.com/latex.php?latex=%7Bs%2Cs%27%2Cn%2Cn%27%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='{s,s&#039;,n,n&#039;}' title='{s,s&#039;,n,n&#039;}' class='latex' /> such that <img src='https://s0.wp.com/latex.php?latex=s%2Fn%3Es%27%2Fn%27&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s/n&gt;s&#039;/n&#039;' title='s/n&gt;s&#039;/n&#039;' class='latex' /> but <img src='https://s0.wp.com/latex.php?latex=%28s%2B1%29%2F%28n%2B2%29+%3C+%28s%27%2B1%29%2F%28n%27%2B2%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(s+1)/(n+2) &lt; (s&#039;+1)/(n&#039;+2)' title='(s+1)/(n+2) &lt; (s&#039;+1)/(n&#039;+2)' class='latex' />.  (Also there are obvious constraints on <img src='https://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=s%27&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s&#039;' title='s&#039;' class='latex' />.)  The answer is yes.  For example, if fertilizer A has 4 of 5 successes while fertilizer B has 7 of 9 successes.</p>
</blockquote>
<p>By the way, on a quite different note: <a href="http://neo.jpl.nasa.gov/risk/a99942.html">NASA</a> currently rates the chances of the asteroid <a href="http://en.wikipedia.org/wiki/99942_Apophis">Apophis</a> colliding with the Earth in 2036 at 4.3 &times; 10<sup></sup><sup>-6</sup>.  It estimates that the energy of such a collision would be comparable with a 510-megatonne thermonuclear bomb.  This is ten times larger than the largest bomb actually exploded, the <a href="http://en.wikipedia.org/wiki/Tsar_Bomba">Tsar Bomba</a>.  The Tsar Bomba, in turn, was ten times larger than all the explosives used in World War II.</p>
<div align="center">
<a href="http://en.wikipedia.org/wiki/File:Tsar_photo11.jpg"><br />
<img src="https://i1.wp.com/upload.wikimedia.org/wikipedia/en/c/c9/Tsar_photo11.jpg" /><br />
</a>
</div>
<p>There&#8217;s an interesting <a href="http://www.technologyreview.com/blog/arxiv/27088/?ref=rss">Chinese plan</a> to deflect Apophis if that should prove necessary.  It is, however, quite a sketchy plan.  I expect people will make more detailed plans shortly before Apophis comes close to the Earth in 2029.  </p>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/img30.imageshack.us/img30/1774/binomial.png?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[]]></thumbnail_height><thumbnail_width><![CDATA[]]></thumbnail_width></oembed>