<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Douglas Hamilton on Medium]]></title>
        <description><![CDATA[Stories by Douglas Hamilton on Medium]]></description>
        <link>https://medium.com/@dougmh?source=rss-2ffa03b79ca7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iyyhN3bcePsrbAnNAZVUSw.jpeg</url>
            <title>Stories by Douglas Hamilton on Medium</title>
            <link>https://medium.com/@dougmh?source=rss-2ffa03b79ca7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:48:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dougmh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Information Theory: Principles and Apostasy]]></title>
            <link>https://medium.com/data-science/information-theory-principals-and-apostasy-a7c1be72be5f?source=rss-2ffa03b79ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7c1be72be5f</guid>
            <category><![CDATA[blasphemy]]></category>
            <category><![CDATA[information-theory]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[stochastic-process]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Douglas Hamilton]]></dc:creator>
            <pubDate>Tue, 19 Oct 2021 17:09:18 GMT</pubDate>
            <atom:updated>2021-10-20T23:30:47.310Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the third in a series of articles about Information Theory and its relationship to data driven enterprises and strategy. While there will be some equations in each section, they can largely be ignored for those less interested in the details and more in the implications. The prior article about Mutual Information &amp; oddly the plot of MacBeth can be found </em><a href="https://towardsdatascience.com/mutual-information-prediction-as-imitation-da2cfb1e9bdd"><em>here</em></a><em>.</em></p><p><strong>Causality is Overrated</strong></p><p>Let’s create a situation. Suppose there was some random process, call it X. This process accepts some input (µ) and then produces an output based on a Cauchy distribution centered at µ. Cauchy distributions are troublesome because they look in almost every way like a normal distributions but with slightly higher likelihoods of extreme events (slightly fatter tails). The result is that while Normal processes have well defined expectations and vary in expected ways, Cauchy distributions have an undefined mean and vary infinitely wildly. Let’s define another process called Y. The result of the Y process is caused X such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*-4ExgghxP2SEgC-hluKXiQ.png" /><figcaption>Note: All Images by Author</figcaption></figure><p>Y is caused by X and X is caused by µ. Knowing the input to X gives you almost no information about X, while knowing Y gives you modest information about X. If you want to know X you are much better off knowing the correlative information (Y) than the causal information (µ).</p><p>The focus on causality is driven in large part by a fear of spurious correlation<a href="#_ftn1">[1]</a> and putting too much faith in ephemeral relationships. To see this consider the following series generated by randomly selecting 1 and 0 at equal odds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*kWv-Y0pLuI2Fd6m0xOZmyg.png" /></figure><p>Without knowing the generating function Series 2 and 3 offer perfect information of each other. Of course there’s no guarantee this trend will continue — in fact it’s very unlikely to persist beyond 3 or 4 more digits. Put another way, we could make a simple rule: when series 2 presents a 1, series 3 presents a 0 and vice versa. In fact, any rule derived from these observations is guaranteed to eventually fail catastrophically as the series continue.</p><p>As the above example demonstrates its not crazy to be concerned with causality but it is somewhere between foolish to painfully stupid to only be concerned with it. Causality is notoriously difficult to prove, especially in the social sciences…especially in business settings. Consider the following set of sequential events:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*8wBkzF0fmIfZNe4em11Ddg.png" /></figure><p>In the above diagram A is an instantiating event for events B &amp; C. The outcome of A impacts B &amp; C through some unknown, causal processes. In a panglossian world we would have perfect knowledge of event A, its outcomes and the process by which it causes B and/or C. Ours is not the best of all possible worlds though. A few reasons that we may not have access to this information include problems of:</p><p>1. Confidentiality: The scenario may be in some sense illegal to know about either the outcome of A or process for influencing B&amp;C. See: secret information and materially important nonpublic Information as examples</p><p>2. Irreducible Complexity: The scenario may be so hopelessly complex that no one has the intellectual capacity<a href="#_ftn1">[2]</a> to understand either event A or the myriad of confounding factors and interactions in the causal process. See: public health and social psychology</p><p>3. Expense: The scenario may be incredibly expensive to understand, either in terms of direct cost, technology debt or time cost. See astrophysics (we tend not to visit far flung stars) and macroeconomics (we tend not to crash the economy to see what will happen)</p><p>If any of these apply all is not lost though. If A is causal of B we would expect it to hold considerable (or at least a non 0) amount of mutual information with B. Same for A &amp; C. And since mutual information is symmetric:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*6BFCvIw2eztcEPCGyZsa-g.png" /><figcaption>Correlative Events (B&amp;C) can give information about each other even if they are not causal (A)</figcaption></figure><p>Put more succinctly, observing event B gives information about event C even though B is non-causal. But the situation is even better. Not only does B provide information about C in a correlative sort of way it even passes the sniff test because they are related through A. But wait, there’s more. If you have some historical data about the general relationship between A &amp; B then it obviates the need to understand the complex causal processes linking A to either B or C.</p><p>Growth in sales and ARR are causal of price movement, though they are confidential ahead of an earnings call. The number of reviews left on their website is not confidential and while a review does not cause a sale, it may well provide information about the number of sales made (more sales -&gt; more reviews presumably). Likewise, a Thursday night Seahawks game does not cause accidents on the factory floor, but may portend them. Causality is expensive and misleading, mutually informative events are inexpensive and useful.</p><p><strong>The Disproportionate Information of Rare Events: A Gameification Crisis</strong></p><p>Let’s start with a data science interview question. Usually, as part of an initial screening round for entry level candidate I like to find an example on their CV of a project that used real life data. Real life data is much nastier than academic and research data. Its chalked full of missing data, mixed (integer and string) data and outliers that make consuming and modeling the information grossly more difficult. Invariably most of the conversation revolves around these real world considerations. How do you handle missing data? Usual answers involve some sort of information replacement strategy like replace them with the average value of the column. Fair and reasonable. How do we deal with malformed or mixed data? Again usually a fair answer involving mapping strings to numbers. Finally what did you do about the large outlier events? Usually the answer is that they ‘removed them’ because you ‘can’t be expected to predict rare events.’ The ultimate justification: it improved the models accuracy. That’s good answer if building a forecast is a game or contest, much worse if you want to use it.</p><p>Outliers are intensely important. While it may be fair to remove them, we also must exercise caution in their treatment. We can see this from both an information theory and an intuitive perspective. As always let’s start with the theory. To begin let’s consider the partial entropy of an outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*EHfoXg4EqYBvVL8K-u7RiQ.png" /><figcaption>Partial Entropy</figcaption></figure><p>Partial Entropy is the amount of information a particular outcome has in a random process. The sum of partial entropy for each outcome is the entropy of the random process X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*wzWKIEGTEOsbXTVrJxp_BQ.png" /><figcaption>Partial Entropy (y axis) of events with different likelihoods (x axis)</figcaption></figure><p>From the above graph we notice a few things. First, that information form outcomes is not symmetric. Outcomes with a 40% likelihood of occurring do not contain the same information as those with 60%. In fact partial entropy is skewed toward rarer events; an event with 40% probability contains more information than its 60% counterpart. This leads us to the second observation that rare events, those with near 0 probability, contain the same amount of information as very common events. Events with a 96.4% chance of occurring add about .05 bits of information roughly the same as an event with .7% chance of occurring. It would be unwise to ignore 96.4% of the world, it’s equally unwise to ignore the .7% of it.</p><p>The mechanics of callously ignoring rare events makes is an even more dangerous activity. Let’s consider a process X with outcomes A, B C such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*JBtdJF1AC5Q3TSRksChyog.png" /></figure><p>And let’s suppose we have 1000 observations that we are going to build our model on. The entropy of X is ~.72. let’s consider another metric that comes from entropy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*HLGv2t8Rc2OlTyAUmPXV7Q.png" /><figcaption>The information contained in any observation</figcaption></figure><p>The Marginal Entropy of an Observation looks at the amount of information carried by a single observation. It is useful for assessing the impact of removing (ignoring) individual rows of data. By applying both marginal and partial entropy we can assess the impact of ignoring any portion of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*oKIMnzSqHkQujV3vzMbI3w.png" /><figcaption>Partial Information (H) vs Marginal Information (h) for each event; marginal information grows as events become rarer</figcaption></figure><p>Individual observations about event C carry 3 times the information as event B, and 20x observations of A. You would not ignore observations about 80% (A) of your outcomes without good cause, and you should need a much better reason to ignore observations about C. Outcome C also contains 8% of the total amount of information in the data. While it may be ok to ignore 8% of the world, its worthwhile to be extraordinarily cautious.</p><p>Removing these events doesn’t just lose information, it also produces false confidence in your forecast. From the perspective of mutual information, a good forecast is one that maximized the mutual information between a model and the world. Once we remove rare events we are no longer modeling the world, but something else. We are modeling a gamified version of it, one where the goal isn’t risk-mitigation or return capture, but one where the goal is to get a high score. This may be good for instructive purposes but is terrible for marking well reasoned decisions.</p><p>Theory aside, the practice of removing extreme events should disturb our guts as well. The vast majority of car collisions involve fenders and bumpers at low speed. Love taps in dense traffic, backing into a beam in a parking lot, that sort of thing. If you remove the outliers, you end up ignoring the types of collisions you actually care about. Factories do not come to a grinding halt because the shipment arrived in the afternoon rather than the morning and economies don’t collapse due to the day to day variation in asset prices. Extreme events are events of both consequence and disproportionate information.</p><p><strong>Information Risk: A Second Look</strong></p><p>In the <a href="https://towardsdatascience.com/information-theory-a-gentle-introduction-6abaf99835ac">first article</a> we briefly described a concept called information risk. Thus far we have discussed how, in an uncertain world, we can better understand uncertainty and how we can cope with it. We have also shown how malformed perceptions of certainty or over reliance of ‘causality’ can be at best detrimental and at worst catastrophically wrong. Information Risk in these scenarios largely means being overly confident when we shouldn’t be. In the next section we will look at what happens when even deterministic systems — those with perfect mutual information between observations and outcomes — become more complex than we can hope to understand.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — —-</p><p><a href="#_ftnref1">[1]</a> And something called the No Free Lunch Theorem</p><p><a href="#_ftnref1">[2]</a> We will treat this in a future article as ‘channel capacity’</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7c1be72be5f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/information-theory-principals-and-apostasy-a7c1be72be5f">Information Theory: Principles and Apostasy</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Devil’s Roulette: a Failure of Expected Value]]></title>
            <link>https://medium.com/data-science/the-devils-roulette-a-failure-of-expected-value-e0a4bae97302?source=rss-2ffa03b79ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0a4bae97302</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[stochastic-process]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[betting-strategies]]></category>
            <category><![CDATA[data-driven-decisions]]></category>
            <dc:creator><![CDATA[Douglas Hamilton]]></dc:creator>
            <pubDate>Mon, 24 May 2021 15:20:58 GMT</pubDate>
            <atom:updated>2021-06-09T14:49:19.738Z</atom:updated>
            <content:encoded><![CDATA[<p>With the propagation of data, technocrats and pop-books about statistics an increasingly large portion of the population are familiar with Expected Value. For the uninitiated Expected Value is the ‘average’, result from some random process –statistics texts denoted this as E[X]. Sometime this means the most common result . If you randomly selected a computer science PhD candidate you would expect them to be a man because the overwhelming proportion of comp sci PhD candidates are men. Sometimes this means the value that minimizes your error. If you sample a person at random in the US you would expect them to be about 38, not because most people are 38 but because it minimizes the amount you miss by on average.</p><p>Expected Value is a very useful concept in many instances. It will tell you what to, well, expect. And if we know what to expect it is not unreasonable to think we should know what to do. If you are going to Iceland in winter you should expect it to be cold and pack a coat. If you go to med school you should expect to accrue $200k in debt and maybe just be a software engineer instead. If you are offered a bet that has a positive expected return you should take it.</p><p>The focus of this article will be on that last statement. A great interview question guaranteed to mess with new grads from quanty programs: can you devise a betting game with negative expected value that you are guaranteed to win? Somewhat surprisingly the answer is yes, though it requires some supernatural oddities. Suffice to say, you should never play roulette with the Devil.</p><p><strong>The Stooge</strong></p><p>Let’s introduce the first character. The Stooge is a recently minted PhD from some notable institution in a field like Political Science. The Stooge is familiar with statistics &amp; hypothesis testing and has a firm belief in their power. They live their life by a few simple maxims:</p><p>1. If the expected value of an event is positive do it</p><p>2. Take the smallest risk possible so you can play the game again</p><p>3. If something seems too good to be true it probably is, so be careful</p><p>Seem like good rules. The first makes sure you won’t play a losing game like the suckers buying lotto tickets. The second makes sure that you tend to capture the expected value of an event and reduce your exposure to variance. The third is due diligence.</p><p>After a long day of polling work in near the Mississippi delta’s in late August our protagonist begins to head to his hotel. If you have never had the pleasure of living in Mississippi, its hot there in August. The pollster wanted a drink. At an intersection near his hotel he sees a bar he hadn’t noticed earlier and it just happens to have his favorite beer so in he goes.</p><p>The bar is a little divey with an oddly well-dressed bartender, a few patrons and a video roulette machine. The Stooge sits down next to it, curious how fleeced players would be. The game is mostly what you would expect: 38 numbers on a dial colored black &amp; red (curiously no green), and odds that are only slightly awful. A single number bet (1/38 chance to hit) pays out 37x, a $1.00 bet tends to return $.97…not good. The first 12 (12/38 chance to hit) pays out 3x, your dollar gets you $.94 back…still not good. Anyone familiar with a casino knows that they make their money by having each bet favor the house, but only slightly.</p><p>Curiously, though, a color bet (1/2 chance to hit) also pays out 3x. The stooge’s interest is piqued. The expected value of a dollar bet is $1.50. It’s a winner. The machine is certified by Mississippi’s Society for Actuarial Testing and Accurate Numbering, a reasonably well regarded organization in the gambling world. The bet size for color bets is $10, and a few cents for all others.</p><p><strong>A Strange Game</strong></p><p>Our protagonist consults his maxims. Is the payout positive? Absolutely, if the game is fair he’s drinking for free tonight. Is the risk small enough he can play again? With a $200 in petty cash for the trip he can play 20 times. Does it seem too good to be true? Yes! The game could be rigged even in spite of the certification.</p><p>The Stooge has a solution, he takes out a dollar and plays 50 rounds betting on individual numbers recording the red and black results as well as wins. 27 red, 23 black, 2 wins. Applying a simple T-Test (a statistical test for the veracity of ideas) the results imply a fair game, or at least one that’s not sufficiently rigged against the player to make the color bet unattractive. The Stooge loads $200 into the machine.</p><p>He wins the first roll and is up $30. The machine changes the bet size for a color bet to $40. Spin again, winner, up $120. The bet size changes again to $130. As The Stooge considers walking away the payout on the machine improves to 4x. Another spin, a loss. He’s down $10 now, the game resets the bet size to $10 and the payout to 3x. The bet is still small, the expected value still positive, and now the Doc is stuck. He spins again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*DQ8Hx0q_18f74l2vSit7aw.jpeg" /><figcaption>An example of 5 rounds of the game</figcaption></figure><p><strong>The Devil Wins Every Time</strong></p><p>This game continues until the bettor is out of cash, and eventually he will always be out of cash. Note the challenge here is to devise a game that doesn’t simply <em>tend</em> to make The Devil win, but guarantees it. Guarantee means you will eventually get a result with absolute certainty, while tends implies only that a results it more likely than not. What is guaranteed in this game is that the bettor will eventually lose. We exploit that by increasing the bet size in proportion to the payout trying to coax the opponent into ruin.</p><p>Ruin here can mean a few things. First it can describe a situation where the Stooge get’s phenomenally unlucky and loses 20 spins in a row. The odds of this are astronomically small, and the results uninteresting so we’ll note it can happen and move on. Second it can describe what happens when you bet too much and lose, even if the odds look good. In either case your wallet gets much thinner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*MNg9wpItgu7gOT_KARzy2A.jpeg" /><figcaption>Example of a game and the slow march to 0</figcaption></figure><p>If we analyze this game in a little more detail we see that the roulette spin itself is a recurrent subgame to the much larger actual game. The subgame has positive expected value, you will be right half the time and receive more than a 2x payout for it. The recurrent game has negative expected value: you will eventually lose and when you do you will lose everything.</p><p>Another way to interpret this: while our protagonist has good rules of thumb for navigating an uncertain world, they have no grounding concept of risk management. A decent start here might be to add a 4th maxim that increased risk should be meted out with increased reward. In investment speak we’d like generate alpha, in business speak we’d like to get positive risk adjusted NPV. Most people would take the second bet in the game’s series: $40 for a 3x payout. Let’s try a strategy where you walk away when the ratio of payout multiplier to bet size is less than .1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*B-nu0lWov--gcZnXTJQ5xg.jpeg" /><figcaption>A few examples of Risk aware stopping, you still lose everything</figcaption></figure><p>Not so great. Your opponent can increase the payout to keep you playing, and while your returns are spikier — in one of the sample games above your wallet climbs above $4000 — you still eventually lose everything.</p><p><strong>Know When to Walk Away</strong></p><p>Yet another Interpretation of this game is as follows. The Devil is paying The Stooge a premium early to make <em>suicidal bets</em> later. Suicidal bets are bets so large that they result in ruin. In my experience it’s a good idea to avoid suicide. One way to do this is to not play. Not playing has an expected value of 0, which is better than losing everything but worse than a policy of walking away after the first spin — expected return $15.</p><p>If you do end up playing Roulette with the Devil you should have 2 goals. First is to not go bust, many strategies that lets you walk away if the bet is above a certain low threshold will accomplish this. It’s not every day that it cost a dollar to buy $1.50 though, leading to the second goal: get what you can while you can. Threshold approaches don’t do this. Instead we need a strategy that metes out reward with risk of ruin rather than just risk of loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*wNzxy89Xa2gobxVq9FfKDQ.jpeg" /><figcaption>A few games with Kelly Style Stopping</figcaption></figure><p>The above runs were generated using a specific stopping strategy known as the Kelly Criterion. All of them end with positive returns, though Kelly stopping does not guarantee a win it does tend to produce them. The derivation and history of the formula is beyond the scope of this article, though its well documented. The intuition, however is well within scope. If we’re thinking about risk, reward and ruin we know:</p><p>1. We are only ruined when we lose</p><p>2. We only collect payouts when we win</p><p>3. We want to make bigger bets as payout improves</p><p>4. We become ruined when our bets become to large relative to our wallet</p><p>If we turn these statements into a formula we would want to limit our bets based on the likelihood of losing, the payout, and size of our wallet. As our wallet grows, the payout increases or probability of winning increases we increase the max bet we are willing to make. As we lose money, the payout decreases or our chance of losing grows we bet less or walk away. Finally, we want a limiting factor that, even if payouts become arbitrarily large allows us to walk away. Kelly stopping does this in an optimal way.</p><p>In the real word of course we often don’t know the payout nor do we know the odds. We hire quants, data scientists, experts and late night voodoo priests from MBBs to try to work them out; though, of course, there is uncertainty in their forecasts. One thing we do know, though, is what we can reasonably lose and keep moving forward. While probabilities and payouts are important, for any sufficiently long game they pale in comparison to managing ruin.</p><p><em>Disclaimer: The views expressed herein are those of the author and not necessarily those of any employer, organization or affiliate thereof.</em></p><p>© 2021 Douglas Hamilton</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0a4bae97302" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/the-devils-roulette-a-failure-of-expected-value-e0a4bae97302">The Devil’s Roulette: a Failure of Expected Value</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mutual Information: Prediction as Imitation]]></title>
            <link>https://medium.com/data-science/mutual-information-prediction-as-imitation-da2cfb1e9bdd?source=rss-2ffa03b79ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/da2cfb1e9bdd</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[notes-from-industry]]></category>
            <category><![CDATA[data-leadership]]></category>
            <category><![CDATA[data-driven-decisions]]></category>
            <category><![CDATA[information-theory]]></category>
            <dc:creator><![CDATA[Douglas Hamilton]]></dc:creator>
            <pubDate>Thu, 06 May 2021 19:42:33 GMT</pubDate>
            <atom:updated>2021-06-11T16:37:48.160Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/notes-from-industry">Notes from Industry</a></h4><p><em>This is the second in a series of articles about Information Theory and its relationship to data driven enterprises and strategy. While there will be some equations in each section, they can largely be ignored for those less interested in the details and more in the implications. The first article on </em><a href="https://dougmh.medium.com/information-theory-a-gentle-introduction-6abaf99835ac"><em>Entropy can be found here.</em></a></p><p>After defeating the combined armies of Norway and Ireland in Act I of Macbeth, the titular character comes across 3 witches. The Witches then make three prophecies, Macbeth will be</p><p>1. Thane of Glamis, his current title</p><p>2. Thane of Cawdor, the title of his recently defeated foe</p><p>3. And finally King of Scotland</p><p>Later on they would deliver two more prophecies with more dire connotations. Their 4th prophecies is that no man (of woman born) will slay Macbeth and their 5th that he will be safe until the nearby woods encroach on a nearby hill. To the extent you can spoil one of the most well read pieces in western lit, Macbeth is eventually slain by Macduff after Macduff’s armies use camouflage made from the nearby woods to take the nearby hill<a href="#_ftn1">[1]</a>. Like many other oracles from Delphi to Omaha the witches’ prophecies came true thanks to a goodly mix of luck, inference and sufficient vagary that makes it hard to be wrong.</p><p>Of course these days’ executives tend to care less about how their competitors were born and have very little time for arborous riddles. Instead they want actionable information, clearly stated that doesn’t require 5 acts and a full cast of characters to play out. Often times, particularly in operational environments, they want answers before data can be carefully collected and models rigorously tested.</p><p>Mutual Information provides both a formal as well as a notional way to approach the problem of prediction by reimaging inference as a game of optimal imitation. It give us a way to both formally and instinctively evaluate the value of information we see and understand how to cut through the noise to prevent information overload. Here we will discuss how to use information to make effective predications and the surprising ancillary utility of this approach.</p><p><strong>Hidden Information — Three Flavors of Prediction</strong></p><p>Back to the witches and their first 3 prophecies. Their 3rd prophecy, that Macbeth would be king, is the kind of thing most of us think of when we say prediction. The event they describe is occurring in the future, and is by no means a given. If it comes to pass it is proof of some special knowledge or foresight that others do not possess. It’s the type of soothsaying practiced by basic cable weathermen, Wall Street analysts and collect call psychics.</p><p>For our purposes we need a more generalized definition of prediction, one that captures a multitude of scenarios. When a computer is shown an image of a dog and correctly labels it as a dog that is a type of prediction. Likewise when an investigator attempts to put together the root cause of a factory accident that too is a type of prediction. The thread that ties all these together is that they are trying to understand information that is otherwise hidden to them. Rather than strictly trying to understand the near term future a better definition of prediction, then, is something like: <strong><em>Prediction is the task of uncovering hidden information from expertise, intuition and observation</em>.</strong> As we will continue to do throughout this series let’s satisfy our gut that this makes sense. Again, predictions from the Scottish Play:</p><p>1. Thane of Glamis: Past — recovering information or investigating</p><p>2. Thane of Cawdor: Present — inferring information and coactivity</p><p>3. King of Scotland: Future — proper prediction</p><p>It is easy for us to see the 3rd prophecy as prediction. Let’s check the first. If you randomly picked anyone on the planet at any time in history (e.g. you have no special information whatsoever) it is very unlikely that they would be an 11th century Scotsman, and even less likely that they would a noble from Glamis. In order to correctly classify someone as having that peerage you would need at least some special information, and even with that information you could be mistaken.</p><p>By the same token the witches 2nd prophecy also is a prediction. Most people most of the time are not the Thane of Cawdor, and while the title is in the process of being bestowed upon Macbeth the witches do not have direct knowledge of this. Through some mysticism they infer it is occurring though, again uncovering hidden information.</p><p>Finally, let’s check if this definition of hidden information tracks with our intuition. Per our intuition, predictions are usually forward looking statements. Applying the same logic as before we see that most people, most of the time are not and will never be King of Scotland. Once again, correctly classifying someone as the future King of Scotland would require either considerable special information or considerable luck.</p><p>Through these three examples we have described a consistent process of prediction. First have special information or insight. Second, consider the importance and implication of that information. Finally make a falsifiable statement about an event that may be wrong. This fits very nicely with our definition above.</p><p>Now a new problem emerges. The world is full of information, most information is not useful. Knowing the weather in Peoria is unlikely to give you insight into royal lineage. Ideally you want to rely on information that is relevant, reliable and high quality and ignore information that is not. How do we measure the quality of information at our disposal?</p><p><strong>Imitation &amp; Mutual Information</strong></p><p>Consider the following game: flip a coin, whatever face it lands on flip a second coin until it lands on the same face, record the results. It’s not an interesting game. In fact this game has the same exact entropy as the original flip: 1 bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/148/1*bDr-4_VWfZob88Zl41ofsA.jpeg" /><figcaption>Some examples from the coin flip game</figcaption></figure><p>We’re going to change the game a little bit. Instead of just recording the result we are now going to try to predict the outcome. Without any information there is a 50/50 chance of getting a HH or TT outcome. Here’s our new game:</p><p>1. Flip the first coin and hide the result</p><p>2. You may then know any one piece of information in the universe past or present,</p><p>3. Guess the final state of the game</p><p>4. Flip the second coin until it matches the first</p><p>Our new goal is to find some data that informs us about the final outcome. The solution here is obvious, uncover the first flip and you will know the game’s final state. Put another way the final flip is a perfect imitation of the first. Alternatively we could flip a coin outside the game, this would tell us nothing about the final state of the game and provide no information.</p><p>In this flipping game we want to make an observation the shares maximum Mutual Information with the end state. Mutual information tells us how much one event reduces the uncertainty in another. It is the degree to which an observed signal mimics –even imperfectly — a separate signal. The second flip is a perfect facsimile of the first. A coin outside the game is independent and therefore provides no new information. Knowing someone is an 11th century Scot does not guarantee they will be king, but it gives some small amount of information you would otherwise have not had. Mutual Information is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*MLMElr3HeXKUYiNxaZju-w.jpeg" /><figcaption>Mutual Information I(X;Y); p(x, y) is the joint probability of members of X and Y while p(x) and p(y) are their individual probabilities</figcaption></figure><p>Admittedly this one is a little more intimidating than the previous articles equations, but no less intuitive. The equation states that Mutual information (I) of two events (X and Y) is proportional to the probability of each set of outcomes p(x, y) for X and Y together and their independent probabilities p(x) and p(y). Just like with entropy this is a formalized way to state something we already know: the more interlinked two events are the more information they tell us about each other. If we consider the two coins in the flipping game they share a mutual information of 1 bit because they are entirely dependent. Knowing the result of the first flip removes 1 bit of uncertainty from a game with 1 bit of entropy. The coin from outside the game though offers 0 bits of Mutual Information and knowing that is irrelevant to the game’s outcome.</p><p><strong>Strategy Analysis</strong></p><p>Informative imitation is not always as obvious as our coin flipping game. Consider the following trading strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*gn4fJGzpNB1hLDKHf_rtwg.jpeg" /><figcaption>Returns for two strategies on the S&amp;P 500 form April 2016 — April 2021</figcaption></figure><p>While the two time series here do not look like exact mimics they do hold maximum Mutual Information about each other.<a href="#_ftn2">[2]</a></p><p>These two strategies will be regulars in our toys for understanding information so it’s worthwhile to understand what they are. The blue strategy is a simple Momentum. A simple momentum strategy looks at what the market did yesterday and assumes it will do the same thing today. If the market went up yesterday then you buy today, if it went down sell. Simple mean reversion — in orange — is the opposite: if the market went up assume its overvalued and sell today, if it went down assume its undervalued now so buy. Knowing what position one strategy takes perfectly informs you about the position of the other.</p><p>Momentum and mean reversion are interesting strategies from an information theoretic perspective for another reason as well. Recall from the previous section we defined a minimum information strategy called Buy and Hold. This strategy merely buys and holds (hence the name) a security<a href="#_ftn3">[3]</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*vnL2dVCzWTU_S8fVKr33Gg.jpeg" /><figcaption>Same strategies benchmarked against buy and hold, a lower information strategy</figcaption></figure><p>While momentum and mean reversion are perfect predictors of each other they also share minimum Mutual Information with Buy and Hold, our default strategy to beat. This trio, a minimum information approach and its informational adversaries form a basis for benchmarking strategies more broadly. New, more exotic approaches should improve upon these simple strategies and can be described as having a momentum or mean reversion bias. Since both mean reversion and momentum go through periods of over and under performance the ideal exotic strategy will be biased toward neither.</p><p>A quick aside on strategy. We will spend a great deal of time in this series discussing portfolio construction and trading strategies as they relate to equity investment. The reason for this is, primarily, the availability of financial data. From both an information, notional and statistical<a href="#_ftn4">[4]</a> perspective there is very little difference between making decisions about how and when to move in and out of a position in the S&amp;P 500 and how and when to expose a set of people to an advertising campaign. There is very little difference between dividing a pile of money among a portfolio of securities to capture returns (portfolio construction) and delegating a pile of tasks across personnel or machines to hit KPIs.</p><p><strong>Optimal Guessing</strong></p><p>Any strategy is a perfect predictor of Buy and Hold, but no optimal guessing strategy can be designed from buy and hold to predict either the actions a momentum or mean reversion strategy. In this series ‘guessing’ will be distinguished from ‘predicting’ in a way similar to how we distinguish between the two in common parlance. Guessing is haphazard and quickly done, predicting is more considerate and more time consuming. More specifically guessing is a type of prediction that has no exigent information about an event beside at most the probabilities of outcomes. The two types of guessing we will tend to discuss are</p><p>· Pure guessing: a strategy is that randomly chooses outcome from all possible outcomes</p><p>· Optimal guessing: a strategy that chooses an outcome and is correct as often as possible without careful study of exigent information</p><p>We have encountered Pure Guessing before. In the dice rolling game in the previous section we used a pure guessing strategy to correctly guess the outcome for both a fair and unfair dice 16.7% of the time. We have also encountered an optimal guessing strategy. US Large Cap Equities tend to produce positive returns, or at least have for the last ~120+ years. If that is all the information you have an optimal guessing strategy is to buy the market and walk away.</p><p>As you may have guessed by its inclusion in this article optimal guessing is intimately linked to mutual information. Let’s think about our dice again. As a reminder a fair dice has a 1/6 chance of coming up any face; the unfair one has a 90% chance of ‘1’ and 2% for each other face. A pure guessing strategy produces the same results for each, but it seems like there should be a better strategy for the unfair dice.</p><p>From the mutual information equation (eqn 4) make X the outcome of a dice roll and Y the outcome of our guess. An optimal guessing strategy will maximally align the true outcome with the guess. Another way to say this, an optimal guess maximizes the mutual information between the roll and the guess. A strategy that does for the unfair dice is to always guess ‘1.’ This is a pretty good imitation of the actual dice rolls we see and you’ll be right 90% of the time.</p><p>Optimal guessing is crucial for quick decisions. This is the domain of real experts. Real experts use their experience to know the uninformed probabilities as well as heuristics to capture information from anecdotal observation. How to check if an expert actually has expertise is a problem for later. Optimal guessing is also crucial for low information decisions. Venture Capital and Angel Investors have very little real information about early round firms, but if they can identify a subset of types of firms that on average produce returns it makes sense to invest in all of them<a href="#_ftn5">[5]</a>.</p><p><strong>Information Overload &amp; Information Pruning</strong></p><p>One quirk form the optimal guessing strategy above, a strategy of ‘always guess 1’ has the same mutual information with the unfair dice as a strategy of ‘always guess 2.’ An information first approach says that, while 2 comes up rarely, the information it provides can be used in a better way. If we built a second rule, for example, that said ‘whenever we guess 2, change it to 1’ we’d perform very well. Said another way, <strong>mutual information tells us when the data is good but the model is bad</strong>.</p><p>If mutual information can tell us when data is good, it can also tell us when data is bad. Conjecture: you should ignore bad data. Incidentally it can also be used to tell us if data is redundant. A strategy of ‘always guess 1’ gives no information that a strategy of ‘always guess 2’ doesn’t give. A simple momentum strategy gives no information a simple mean reversion strategy doesn’t give. We can ignore one of those 2 strategies and be no worse off.</p><p>In the real world we seldom find perfect information substitutes though, nor do we find completely irrelevant information. Even the rain in LA can be lightly correlated with correlated with trading behavior<a href="#_ftn6">[6]</a>. If you combine this with our insights about the power of information, that more information always reduces uncertainty, it’s no surprise that operations managers receive 50 page reports of charts and figures every morning. 50 pages that are impossible for a person to make sense of. We need a way to limit information intake to match our bandwidth to consume it.</p><p>A traditional statistical approach to pruning all these charts into something more readable is principal component analysis (PCA). PCA combines all your charts into just handful, which is the goal. Unfortunately the handful of charts are synthetically generated admixtures of your initial 50 and have no intuitive relationship to the factory floor. A much better approach would be to remove redundant and irrelevant information and only keep the relevant and unique charts.</p><p>Again we have a formal and intuitive mutual information based solution. Formally we want to find a set of predictors with maximum mutual information with a target while also being minimally redundant with each other. Less formally we want to find signals that mimic KPIs while not mimicking each other. This is often called a Maximum Relevance Minimum Redundancy (mRMR)<a href="#_ftn7">[7]</a> approach to feature selection. It’s not hard to write or find an mRMR algorithm to prune a morning report. It can also be done with a few rules of thumbs: do my charts look like my target right side up or upside down (relevance), does each chart look different or do a bunch of them look the same (redundancy), can I fit all the charts on 1 page per KPI (bandwidth preservation). With this strategy it’s possible to reduce massive information overload to an easily consumable 5 page report.</p><p><strong>The Basics</strong></p><p>With entropy and Mutual information firmly established we’re now in possession of the building blocks of information theory. We have seen a number of toys, allegories and anecdotes that point to the unique power and flexibility of this approach. In the next article we will use our building blocks to establish a number of Axioms and Principals that enable us to approach data driven decisions and information risk in more complex way.</p><p><a href="#_ftnref1">[1]</a> Macbeth, by Shakespeare…do I really need to cite this?</p><p><a href="#_ftnref2">[2]</a> S&amp;P data retrieved from yahoo finance</p><p><a href="#_ftnref3">[3]</a> Think a stock or bond</p><p><a href="#_ftnref4">[4]</a> For more about the grim/infuriating statistics of Financial Markets see Taleb’s <em>Black Swan</em> or Mandelbrot’s <em>Misbehavior of Markets</em></p><p><a href="#_ftnref5">[5]</a> At the time of writing this Andeerssen Horowitz has more than 250 active members of its portfolio (5/6/2021, <a href="https://a16z.com/portfolio/)">https://a16z.com/portfolio/)</a></p><p><a href="#_ftnref6">[6]</a> For examples of silly correlations <a href="https://www.tylervigen.com/spurious-correlations">https://www.tylervigen.com/spurious-correlations</a></p><p><a href="#_ftnref7">[7]</a> Peng, H.C., Long, F., and Ding, C., “Feature selection based on mutual information: criteria of max-dependency, max-relevance, and min-redundancy,” IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 27, №8, pp. 1226–1238, 2005.</p><p><em>Disclaimer: The views expressed herein are those of the author and not necessarily those of any employer, organization or affiliate thereof.</em></p><p>© 2021 Douglas Hamilton</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da2cfb1e9bdd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/mutual-information-prediction-as-imitation-da2cfb1e9bdd">Mutual Information: Prediction as Imitation</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Information Theory: A Gentle Introduction]]></title>
            <link>https://medium.com/data-science/information-theory-a-gentle-introduction-6abaf99835ac?source=rss-2ffa03b79ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6abaf99835ac</guid>
            <category><![CDATA[data-leadership]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-driven-decisions]]></category>
            <category><![CDATA[information-theory]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Douglas Hamilton]]></dc:creator>
            <pubDate>Wed, 28 Apr 2021 12:49:09 GMT</pubDate>
            <atom:updated>2021-06-10T13:05:53.471Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the first in a series of articles about Information Theory and its relationship to data driven enterprises and strategy. While there will be some equations in each section, they can largely be ignored for those less interested in the details and more in the implications.</em></p><p>The early and middle parts of the 20th century saw an explosion in telecommunication technologies and capabilities. With this, engineers and researchers were faced with numerous questions that had never really been rigorously tackled before such as:</p><p>· How do I convert words and sounds into dots and dashes?</p><p>· How do I reconstruct electronic signals into words and sounds?</p><p>· What about when there is noise added to the electronic signals?</p><p>· How little information can I transmit and still reconstruct a message?</p><p>· What is information anyway?</p><p>In doing so these researchers accidentally built one of the most powerful set of tools applied math has given us for approaching and solving a myriad of otherwise ‘not so mathy’ problems. The questions above and the adjunct questions they spawned were clearly inspired by telecommunication; however those very same challenges have analogs to modern challenges both data driven enterprises and the modern analytics leader face:</p><p>· What information do I absolutely always need?</p><p>· What information can I ignore and when can I ignore it?</p><p>· How complex is my portfolio or strategy and does the data I have justify it?</p><p>· Should I trust the data or my experience more? (perhaps surprisingly we will see the answer is frequently ‘don’t trust the data’)</p><p>· Where is my project likely to fail?</p><p>· What systematic risk do I face in my financial exposure?</p><p>· Now that I have the data, what should I do?</p><p>Over the course of the first few article we’ll introduce 5 tools — Entropy, Mutual Information, Huffman Codes, Kolmogorov Complexity and Fisher Information — for assessing these and other challenges in both personal and professional life. And while future posts will focus more on the principals and implication, first we have to introduce the building block of Information Theory: Entropy</p><p><strong>Entropy: a Measure of Randomness</strong></p><p>If you talk to a quantitative professional and ask them how long they’ve been at it the usual, diplomatic answer involves their number of years since finishing undergrad. The reality, though, for most people I have known in data science and its adjacent fields is that they have been steeped in the subject matter since at least their mid-teens. With each year the same material, more or less, is presented with an additional layer of precision, care and/or complexity. Usually definitions are additive. Gravity, as an example, is initially the thing that causes apples to fall, before being about the way massive bodies interact with each other, then having something to do with acceleration and distortions on manifolds. Each more complex, each more complete.</p><p>Not Entropy though. In my 20 years studying and practicing I have been given a half dozen definitions of Entropy. While the definitions have had some time and manner utility, they were not additive and not easy. Here are a few of the worse ones:</p><p><em>Entropy is…</em></p><p>· The disorder or chaos in a system</p><p>· The number of degrees of freedom in a system</p><p>· A ‘force’ that obscures the initial conditions of a system</p><p>The first definition, probably the most common, is flat out wrong. The second two, while reasonably correct, leave you with no intuition behind what it means.</p><p>Here is Information Theory’s first great triumph: a sensible and intuitive definition for the most misunderstood concept in science. <strong><em>Entropy is the degree of uncertainty –or randomness — in a system</em>.</strong><a href="#_ftn1"><strong>[1]</strong></a><strong><em> </em></strong>That’s a little better than just calling it disorder or chaos, but it implies something profound. Namely different systems and different random events have different levels of randomness. Let’s check our intuition with statisticians’ two favorite toys, a coin and a dice. Is a coin toss or a dice roll more random? Let’s check in 2 ways. First we ask the question, if we guessed randomly (or later optimally) how often would be we right? For a coin toss its 50% of the time and for a dice roll it’s ~16.7% of the time. Second let’s ask how many possible states (read: outcomes) could occur. For a coin its 2 (heads or tails) and a dice its 6 (1,2,3,4,5,6). In both cases it looks like the dice is more random than a coin. The notion that different events have different levels or randomness pass the sniff test.</p><p>For fair coins and fair dice it’s easy<a href="#_ftn2">[2]</a> to see which is more random, and our intuition quickly agrees. Now let’s change the comparison. Suppose we still have our fair coin, but now we want to compare it to a weighted dice. This weighted dice comes up ‘1’ 90% of the time, and 2% of the time for each remaining face (2% for 2, 2% for 3, etc). Now which is more random. Random guessing is still 50% effective for the coin, and 16.7% for the dice<a href="#_ftn3">[3]</a>. Again, there are two states for the coin and six for the dice. But the loaded dice feels less random than the fair one; after all it almost always comes up ‘1’. Now we need a more rigorous definition of entropy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*dBbkCNO96NSNWxWX9IeM9A.jpeg" /><figcaption>Entropy (H) is dependent on the number of possiblestates and their probabilities</figcaption></figure><p>This is usually the part where people tune out, big sigmas are intimidating. However all equation 1 says is something we already feel to be true<strong><em>: events with more outcomes tend to be more random than those with fewer and events with more evenhanded outcomes tend to be more random than events heavily skewed to just a few outcomes</em></strong>. Equation 1 gives us a formal way to describe this by stating that for an event X with outcomes i, the entropy H is equal to the sum of the probability of each outcome and the logarithm base 2 of that probability. Why base 2? Because most complex scenario can be decomposed into many 2 state events described by: yes or no, is or is not, true or false, equals or does not equal.</p><p>Now back to our scenario, the loaded dice vs the coin. Let’s start by stratifying our intuition by comparing the fair dice to the fair coin. The fair dice has an entropy of 2.58, while our fair coin has an entropy of exactly 1. This certainly agrees with our intuition noted above. And the loaded dice? The loaded dice has an entropy of ~0.7, lower than the fair dice (agrees with our gut) and lower than the coin. Now that we have a better handle on randomness, entropy and how to us it to measure systems, events and processes we can move on to how this relates to Information.</p><p><strong>Entropy and Information</strong></p><p>As a reminder a coin flip had an entropy of exactly 1. We’ve established that that means it’s less random than a dice roll, but it also means it contains less information. More precisely what it means is that a coin flip can be represented in 1 bit of information.</p><p>A bit is a unit of information that can exist in one of two states, a 1 or 0. The reason a coin flip can be represented as one bit is that a coin has two sides that come up equally likely. We map<a href="#_ftn4">[4]</a> the 0 to tails and 1 to heads and see that our coin flip can be represented in 1 bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/139/1*sRhNlLMwOH28lq-mKLHuUw.jpeg" /><figcaption>Mapping a Bit to a Coin Toss</figcaption></figure><p>The case of the fair dice is a bit more complicated. It has an entropy of 2.58 and can therefore be written in 2.58 bits. But bits are discrete and there is no such thing as .58 bits. We can try to represent it in 2 or 3 bits though. First with 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*gvyLAlWsWJiOx99Qa4ojng.jpeg" /><figcaption>A 3 bit dice roll has additional capacity; we null out 2 possible states to account for this</figcaption></figure><p>With 3 bits we have excess capacity, or put another way with 3 bits we have a considerably more complex model of the scenario than we need. If we try to write the dice roll on to 2 bits though we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*6agrqn6kfdb5qKswyZbutA.jpeg" /><figcaption>A 2 bit dice roll destroys information</figcaption></figure><p>We are not able to fully write the fair dice onto 2 bits. This is a <strong><em>lossy </em></strong>representation. We lose information — in this case outcomes of ‘5’ and ‘6’ — when we try to represent the event on too little information.</p><p>All three of these — the 1 bit coin flip, 2 bit dice roll and 3 bit dice roll — are models of events. As the model’s bits go up so does its complexity. We can create a rule of thumb here: <strong><em>if we try to represent a system with too complex a model we are inefficient at best and at worst overly complex and in danger of being very wrong. If we represent a system with too few, we are losing important information.</em></strong></p><p>Finally let’s look at our unfair dice. It had an entropy of .7. Two things should strike you here. First, we would lose about the same amount of information with a model on our unfair dice that states ‘this dice only comes up as 1’ as we would with a 2-bit model on our fair dice. <strong><em>This leads us to another rule of thumb: even though the events are rare, removing outliers can remove huge amounts of information.</em></strong> Second, it has much lower entropy and can fit in a much simpler model than the fair dice. Let’s next examine how the increased amount of information we had about the unfair dice led to this result.</p><p><strong>Conditional Entropy and the Power of Information</strong></p><p>Going back to the definition, entropy is a measure of uncertainty. If you want to understand — or better yet exploit — a system having less of it is generally good. We’ve already examined one bad way to reduce the entropy of an event: make a lossy model that does not accurately depict the scenario. Here we will examine the best way to reduce uncertainty by finding useful information.</p><p>First an aside though, a quirk of probability is that if you know nothing about a scenario aside from the possible states the best guess you can make is that all states are equally likely. This is true even if you are told a scenario is unfair in some non-specific way. For example, if you are told a coin is unfair but not by how much or in which direction than the average of all the ways it could be unfair is for it to be fair.</p><p>In the case of our weighted dice we are given a crucial piece of information. Notably that the dice is heavily weighted to ‘1’ such that the probability of a ‘1’ appearing is 90%. With that we also infer that the probability of a 2,3,4,or 5 appearing is 2% each. The result is conditional entropy. More formally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*kDJpFOk_HHTjlHNQmH8qbA.jpeg" /><figcaption>Conditional Entropy (H(X|Y) is entropy with more information; all else being equal it is always less than uninformed entropy</figcaption></figure><p>Just like with equation 1 these look more intimidating than they are. All equation 2 says is that conditional entropy replaces the probability of an event occurring with the probability given some new information. In the weighted dice case the new information (Y) is that the probability of ‘1’ appearing is 90%. Equation 3 follows from equation 2 and notes that the conditional entropy always reduces the uncertainty of a system. A little less formally <strong><em>relevant information always reduces the uncertainty of a system.</em></strong><a href="#_ftn5"><strong><em>[5]</em></strong></a></p><p>Let’s look at another scenario. Suppose you live in a LA. It rains about 33 days per year there, so on any given day the chance of it raining is ~10%. Without any additional information LA’s precipitation schedule can be effectively modeled in ~170 bits. LA does have a rainy season though, ~90% of rainy days (30 of them) occur between Nov 1 and April 30. By knowing there is a rainy season and its impact on the likelihood of rain the entropy of the precipitation schedule reduces to ~ 145 bits, a 15% reduction in uncertainty.</p><p><strong>Portfolio Analysis: DJI is a Weird Index</strong></p><p>As mentioned earlier, this article will be unique in the amount of time spent on toy problems and fundamentals. Getting a good technical and intuitive understanding of entropy will be critical as we encounter more complex topics. Now that we have a good understanding though we can leave behind toy problems and get to more compelling examples. For many of these examples the Dow Jones Industrial Average will serve as a whipping boy.</p><p>If you are looking for a system chalked full of uncertainty that people would like to exploit, equity markets are probably a good place to start. Suppose you wanted to build a portfolio to capture returns in the exchange space. The exchange space is dominated by 3 firms: The Intercontinental Exchange (ICE, $68B Market Cap, trading @ ~120), The London Exchange Group (LDNXF, $53 Market Cap, trading @ ~105) and Nasdaq (NDAQ, $26B Market Cap, @ ~160). Future returns are uncertain, but we can leverage the principals covered thus far to construct a few sensible strategies for trying.</p><p>To begin, let’s note that a portfolio is little more than a model of where returns may be. If we have no other information we should pursue a strategy that maximizes portfolio entropy. This yields a portfolio made up of 1/3 ICE, 1/3 LDNXF and 1/3 NDAQ.</p><p>There are a few other sensible ways to construct a portfolio. If we want to replicate the current state of the industry we may pursue a market cap weighting strategy — 44% ICE, 39% LDNXF, 17% NDAQ — and we will cover why in the next article. Similarly if we have special knowledge of future returns we again may pursue a strategy based on our expectation of how returns are distributed across the three. That brings us to the Dow.</p><p>The Dow Jones Industrial Average is a price weighted portfolio. This means the elements are weighted by the price they are trading at. In our case of exchanges that would produce a portfolio of 31% ICE, 27% LDNXF, and 42% NDAQ. There is no information intuition for this strategy. It’s just weird.</p><p><strong>Trading and Benchmarking</strong></p><p>One last example before we close out. Instead of constructing a portfolio suppose instead we wanted to build a strategy to trade particular stock or index. For the sake of simplicity our strategy can do one of 2 things on a given day: buy or hold, sell or do nothing and hold cash. We need a way to determine if any given strategy we devise is effective. Note that a strategy, just like a portfolio, is nothing more than a model of returns.</p><p>Since strategies involve making numerous sequential decisions, each decision should add value above a considerable more simple model. Recall that a simple model is one that can be represented is very few bits. There are 2 strategies here that that can be written in 0 bits. The first is pretty trivial: just hold cash. I think anyone would agree if your strategy can’t beat holding cash it’s a bad strategy; intuition check passed. The second 0-bit strategy is buy and hold, a strategy where you buy the stock on the first trading day and then hold it through the duration. There are a myriad of real world reason this is a good benchmark including transaction costs and tax optimization. Our information intuition, though, is that a more complex model ought to provide improved returns. A 1 bit model should improve on the 0 bit strategy and a 2 bit model should improve even further.</p><p><strong>Information Risk</strong></p><p>A natural corollary from our assessment of benchmarking is that increased complexity should be meted out with increased returns. This is our first encounter with a concept I am calling <strong><em>Information Risk</em></strong>. Information Risk is a kind of fragility born from moving to far from a robust, low information strategy without sufficient relevant data to justify it. It’s related to concepts like overfitting, regularization, and cross-validation but has a slightly different flavor. How to use information in robust and sensible way that reduces Information Risk will be the driving factor behind this series.</p><p>Next Article: Mutual Information as Prediction</p><p><a href="#_ftnref1">[1]</a>Elements of Information Theory, Cover &amp; Thomas</p><p><a href="#_ftnref2">[2]</a> As an aside, from here on out things that are easy will be referred to as easy, things that are hard as trivial, and thing that are impossible as ‘exercises left to the reader’</p><p><a href="#_ftnref3">[3]</a> We will cover optimal guessing in the next article</p><p><a href="#_ftnref4">[4]</a> Mathematician speak for ‘substitute one thing for another’</p><p><a href="#_ftnref5">[5]</a> Again we will give this a more formal treatment when we introduce mutual information</p><p><em>Disclaimer: The views expressed herein are those of the author and not necessarily those of any employer, organization or affiliate thereof.</em></p><p>© 2021 Douglas Hamilton</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6abaf99835ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/information-theory-a-gentle-introduction-6abaf99835ac">Information Theory: A Gentle Introduction</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>