{"id":397,"date":"2017-12-12T05:23:50","date_gmt":"2017-12-12T05:23:50","guid":{"rendered":"http:\/\/morganredfield.com\/blog\/?p=397"},"modified":"2022-03-22T01:10:19","modified_gmt":"2022-03-22T01:10:19","slug":"mutual-information-in-a-causal-context","status":"publish","type":"post","link":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/","title":{"rendered":"Mutual Information in a Causal Context"},"content":{"rendered":"<p>Mutual information is the idea that learning something about one variable might tell you about another. For example, learning that it&#8217;s daytime might give you information about whether the sun is shining. it could still be cloudy, but you can be more sure that it&#8217;s sunny than before you learned it was daytime.<\/p>\n<p>Mathematically, mutual information is represented using the concept of entropy. The information gained about a variable X, assuming you learn Y, is given by: <span class=\"katex-eq\" data-katex-display=\"false\">I(X;Y) = H(X) - H(X|Y)<\/span><\/p>\n<p>In this case, <span class=\"katex-eq\" data-katex-display=\"false\">H(.)<\/span> is a measure of the entropy. It is given by <span class=\"katex-eq\" data-katex-display=\"false\">H(X) = \\sum_x p(x) \\log_2(\\frac{1}{p(x)})<\/span><\/p>\n<p>Mutual information is supposed to be symmetric (<span class=\"katex-eq\" data-katex-display=\"false\">I(X;Y) = I(Y;X)<\/span>), but I&#8217;m interested in how that works in a causal context.<\/p>\n<p>Let&#8217;s say you have a lightbulb that can be turned on from either of two light switches. If either lightswitch is on, then the bulb is on. Learning that one light switch is on tells you the bulb is on, but learning that the bulb is on does *not* tell you that one specific light switch is on. It tells you that at least one is on (but not which one).<\/p>\n<p>Let&#8217;s assume for the sake of argument that each light switch has a probability p(on) = 0.25 of being turned on (and equivalently a probability p(off) = 0.75 of being off). Assume also that they&#8217;re independent.<\/p>\n<p>The entropy of switch one is<\/p>\n<p><span class=\"katex-eq\" data-katex-display=\"false\">H(S1) = p(on)\\log_2(\\frac{1}{p(on)}) + p(off)\\log_2(\\frac{1}{p(off)})<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">H(S1) = 1\/4* \\log_2(4) + 3\/4 * \\log_2(\\frac{4}{3})<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">H(S1) = 0.811<\/span><\/p>\n<p>Since either switch has a probability of 0.25 of being on, and they&#8217;re independent, the bulb itself has a probability of 7\/16 of being on.<\/p>\n<p>The entropy of the bulb is<\/p>\n<p><span class=\"katex-eq\" data-katex-display=\"false\">H(B) = p(on)\\log_2(\\frac{1}{p(on)}) + p(off)\\log_2(\\frac{1}{p(off)})<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">H(B) = 7\/16 * \\log_2(\\frac{16}{7}) + 9\/16 * \\log_2(\\frac{16}{9})<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">H(B) = 0.989<\/span><\/p>\n<p>If you know switch 1&#8217;s state, then the information you have about the light is given by<\/p>\n<p><span class=\"katex-eq\" data-katex-display=\"false\">I(B;S1) = H(B) - H(B|S1)<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">I(B;S1) = H(B) - (3\/4*H(B|S1=off) + 1\/4*H(B|S1=on))<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">I(B;S1) = 0.989 - (3\/4*0.811 + 1\/4*0) = 0.380<\/span><\/p>\n<p>If instead you know the bulb&#8217;s state, then the information you have about switch 1 is given by<\/p>\n<p><span class=\"katex-eq\" data-katex-display=\"false\">I(S1;B) = H(S1) - H(S1|B)<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">I(S1;B) = H(S1) - (9\/16*H(S1|B=off) + 7\/16*H(S1|B=on))<\/span><br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">I(S1;B) = 0.811 - (9\/16*0 + 7\/16 * 0.985) = 0.380<\/span><\/p>\n<p>So even in a causal case the mutual information is still symmetric.<\/p>\n<p>For me the point that helps give an intuitive sense of this is that if you know S1 is on, you know the bulb is on. Symmetrically, if you know the bulb is off, you know that S1 is off.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mutual information is the idea that learning something about one variable might tell you about another. For example, learning that it&#8217;s daytime might give you information about whether the sun is shining. it could still be cloudy, but you can be more sure that it&#8217;s sunny than before you learned it was daytime. Mathematically, mutual &hellip; <a href=\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mutual Information in a Causal Context&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[87],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-information"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mutual Information in a Causal Context - Theory and Practice<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mutual Information in a Causal Context - Theory and Practice\" \/>\n<meta property=\"og:description\" content=\"Mutual information is the idea that learning something about one variable might tell you about another. For example, learning that it&#8217;s daytime might give you information about whether the sun is shining. it could still be cloudy, but you can be more sure that it&#8217;s sunny than before you learned it was daytime. Mathematically, mutual &hellip; Continue reading &quot;Mutual Information in a Causal Context&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\" \/>\n<meta property=\"og:site_name\" content=\"Theory and Practice\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-12T05:23:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-22T01:10:19+00:00\" \/>\n<meta name=\"author\" content=\"morgan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"morgan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\"},\"author\":{\"name\":\"morgan\",\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd\"},\"headline\":\"Mutual Information in a Causal Context\",\"datePublished\":\"2017-12-12T05:23:50+00:00\",\"dateModified\":\"2022-03-22T01:10:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\"},\"wordCount\":503,\"publisher\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd\"},\"keywords\":[\"information\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\",\"url\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\",\"name\":\"Mutual Information in a Causal Context - Theory and Practice\",\"isPartOf\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/#website\"},\"datePublished\":\"2017-12-12T05:23:50+00:00\",\"dateModified\":\"2022-03-22T01:10:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/morganredfield.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mutual Information in a Causal Context\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/morganredfield.com\/blog\/#website\",\"url\":\"https:\/\/morganredfield.com\/blog\/\",\"name\":\"Theory and Practice\",\"description\":\"Exploring life through science and art.\",\"publisher\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/morganredfield.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd\",\"name\":\"morgan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0da7fa0a0a07a8497d51de4300111d978b649e254fc1afa26dc67f3b83d24c38?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0da7fa0a0a07a8497d51de4300111d978b649e254fc1afa26dc67f3b83d24c38?s=96&d=mm&r=g\",\"caption\":\"morgan\"},\"logo\":{\"@id\":\"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/morganredfield.com\/blog\/author\/morgan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mutual Information in a Causal Context - Theory and Practice","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/","og_locale":"en_US","og_type":"article","og_title":"Mutual Information in a Causal Context - Theory and Practice","og_description":"Mutual information is the idea that learning something about one variable might tell you about another. For example, learning that it&#8217;s daytime might give you information about whether the sun is shining. it could still be cloudy, but you can be more sure that it&#8217;s sunny than before you learned it was daytime. Mathematically, mutual &hellip; Continue reading \"Mutual Information in a Causal Context\"","og_url":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/","og_site_name":"Theory and Practice","article_published_time":"2017-12-12T05:23:50+00:00","article_modified_time":"2022-03-22T01:10:19+00:00","author":"morgan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"morgan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#article","isPartOf":{"@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/"},"author":{"name":"morgan","@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd"},"headline":"Mutual Information in a Causal Context","datePublished":"2017-12-12T05:23:50+00:00","dateModified":"2022-03-22T01:10:19+00:00","mainEntityOfPage":{"@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/"},"wordCount":503,"publisher":{"@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd"},"keywords":["information"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/","url":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/","name":"Mutual Information in a Causal Context - Theory and Practice","isPartOf":{"@id":"https:\/\/morganredfield.com\/blog\/#website"},"datePublished":"2017-12-12T05:23:50+00:00","dateModified":"2022-03-22T01:10:19+00:00","breadcrumb":{"@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/morganredfield.com\/blog\/2017\/12\/mutual-information-in-a-causal-context\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/morganredfield.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Mutual Information in a Causal Context"}]},{"@type":"WebSite","@id":"https:\/\/morganredfield.com\/blog\/#website","url":"https:\/\/morganredfield.com\/blog\/","name":"Theory and Practice","description":"Exploring life through science and art.","publisher":{"@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/morganredfield.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/15fce334735dd60ce7bb5712c44a62dd","name":"morgan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0da7fa0a0a07a8497d51de4300111d978b649e254fc1afa26dc67f3b83d24c38?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da7fa0a0a07a8497d51de4300111d978b649e254fc1afa26dc67f3b83d24c38?s=96&d=mm&r=g","caption":"morgan"},"logo":{"@id":"https:\/\/morganredfield.com\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/morganredfield.com\/blog\/author\/morgan\/"}]}},"_links":{"self":[{"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":4,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":577,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions\/577"}],"wp:attachment":[{"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/morganredfield.com\/blog\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}