Showing posts with label evidential decision theory. Show all posts
Showing posts with label evidential decision theory. Show all posts

Further notes on causation

Some further topics on causal models, as a follow-up to the previous introductory article.

Table of contents

  • Causal models and truth tables
  • The do operator; ceteris paribus
  • d-separation, RCT and the do operator
  • Ancestral graphs
  • Time
  • Newcomb's problem and the limits of CDT

Causal models and truth tables

When first introduced to causal modeling (or for that matter any multivariate modeling that involves looking at conditional distributions), you wondered why one couldn't just directly apply the joint probability distribution to model your data, rather than talk about conditional independences, etc. Well, the standard answer has to do with computational problems with dealing with joint distributions with way too many free parameters, but some insight can be gained from considering the logical analog of the statistical problem.

The logical analog of a joint distribution is a truth table. Well, formally these propositions should be considered quantified over some variable, or over some models with incomplete theories, etc. so the propositions aren't just always true or always false. Then a truth table represents every possible state the propositions could have in any model.

$$\begin{array}{*{20}{c}}{\begin{array}{*{20}{c}}P&Q&R\\\hline0&0&0\\0&1&1\\1&0&1\\1&1&0\end{array}}&{\begin{array}{*{20}{c}}P&Q&R\\\hline0&0&0\\1&1&1\end{array}}\end{array}$$

Above are two possible truth tables for some propositions $P,Q,R$. Causally, they can be represented by the following diagrams respectively.

$$\begin{array}{*{20}{c}}{\begin{array}{*{20}{c}}P& {} &Q\\{}& \searrow & \downarrow \\{}&{}&R\end{array}}&{P \to Q \to R}\end{array}$$

These arrows do not directly represent implication (although they do up to negation), and obviously the precise conditional implications need to be specified to extract the joint distribution, but the causal diagrams tell us, as before, the pattern of conditional independences. Learning the precise distribution given a causal model (i.e. given a causal graph, without knowledge of the precise implications/"conditional distributions" represented by each link) amounts to checking smaller truth tables for each vertex in the causal model.

So for a system with $i$ propositions, learning the truth table directly would take $2^i$ passes, but given a causal model would take $\sum_v 2^{i_v}\sim i2^{i_v}$ passes (where $i_v$ is the number of parents $v$ has), which is far more computationally scalable.

Evaluating models is also more efficient in causal form, although this is less important -- the example models above, in truth table form, respectively read formally as:

$$\left( {\neg P \wedge \neg Q \wedge \neg R} \right) \vee \left( {\neg P \wedge Q \wedge R} \right) \vee \left( {P \wedge \neg Q \wedge R} \right) \vee \left( {P \wedge Q \wedge \neg R} \right)$$

$$(P \wedge Q \wedge R) \vee (\neg P \wedge \neg Q \wedge \neg R)$$

And in causal form, read as (in a way analogous to Markov factorization):

$$\left( {P \vee \neg P} \right) \wedge \left( {Q \vee \neg Q} \right) \wedge \left( {\neg P \wedge \neg Q \to \neg R} \right) \wedge \left( {\neg P \wedge Q \to R} \right) \wedge \left( {P \wedge \neg Q \to R} \right) \wedge \left( {P \wedge Q \to \neg R} \right)$$

$$\left( {P \to Q} \right) \wedge \left( {\neg P \to \neg Q} \right) \wedge \left( {Q \to R} \right) \wedge \left( {\neg Q \to \neg R} \right)$$

While the causal expressions may seem more convoluted, consider the problem of checking whether a given state $(P,Q,R)$ is valid according to our truth table (testing a model in the logical setting amounts to checking whether given data points fit the model). This is a decidable problem -- there is a simple algorithm to reduce any logical expression with given values of $(P,Q,R)$ to a boolean value. Which expression is computationally more feasible to evaluate?

In the first model, the truth table takes 7.5 equality checks, while the causal model takes an average of 10.5 equality checks. In the second model, the truth table takes an average of 5.625 equality checks, while the causal model takes an average of 6 equality checks. But look at how these values scale -- in general for some causal model, the causal model takes the following number of equality checks on average:

$$\sum_{v\in V}{\sum_{w\in 2^I_v}{2-\frac{1}{2^{i_v+o_w}}}}\approx \sum_{v}{2^{i_v+1}}$$

Where $v\in V$ are the vertices (variables) in the model, $w\in 2^{I_v}$ are the $2^{i_v}$ possible configurations of $v$'s $i_v$ causal variables $I_v$, $o_w$ is the number of possibilties left open even after all causal variables are specified (i.e. the noise term). While the truth table takes the following number of equality checks on average:

$$2^i o-\frac{o(o-1)}{2}$$

Where $i$ is the total number of variables and $o$ is the number of allowed states (i.e. the total unexplained variance). For $i_v << i<o$, the causal model is far more efficient to test than the joint distribution. Perhaps some connection can be made to divide-and-conquer or factorization algorithms -- or maybe not, since divide-and-conquer is recursive while this isn't.

The do operator; ceteris paribus

Causation is the idea that crashing cars won't cause people to drink more. It does so within the framework of statistical modeling by observing that "accident rate" and "go crash a car" are two different variables, and when you "go crash a car" in the real world, the precise mechanism by which you do so does not involve increasing people's drinking ability. "Go crash a car" is an instrumental variable, and is typically denoted using Pearl's do operator as do(crash). In the below diagram, releasing storks is "do(stork)".

The do operator captures the basic intuition, or motivation, behind causality. We're interested in finding out what increasing tax rates does to the GDP -- it doesn't matter for our purposes that richer countries tend to have higher taxes for political reasons, we'll change taxes without all that politics -- conditioning on the politics.

What the do operator does is allow us to formalize the notion of ceteris paribus. On first glance, the concept of ceteris paribus seems inherently flawed -- suppose you have four variables: momentum, mass, velocity and crater size; then saying "an increase in mass results in an increase in crater size, ceteris paribus" is ill-defined -- you can't hold velocity and momentum constant while increasing mass.

No, the notion of ceteris paribus is defined with respect to a causal model -- thus, both the following models are ok:


(Our use of the do operator is perhaps non-standard, but equivalent to the standard one. We define $\mathrm{do}(X=x)$ as a random variable with conditional probabilities $P(X=x'\mid\mathrm{do}(X)=x)=\delta_{xx'}$, and $P(X=x'\mid \mathrm{do}(X)=\bot)$ is as before. This becomes equivalent to erasing causal arrows from parents when $\mathrm{do}(X)$ is active. If you let $\mathrm{do}(X)$ be distributed in some way, this captures the notion of a randomized control trial.)

d-separation, RCT and the do operator

The idea of "do" interventions is given formal grounding by the idea of d-separation, which is the basic calculus of causation upon which all experiments to establish causation are based.

Fundamentally, d-separation describes when a causal pathway allows for the "flow of information" (a concept that is also relevant to belief propagation stuff) between random variables. The rules of d-separation follow from the Markov and faithfulness assumptions:

  • In a chain junction $A\to B\to C$, conditioning on $B$ blocks the pathway.
  • In a confounding (fork) junction $A\leftarrow B\to C$, conditioning on $B$ blocks the pathway.
  • In a colliding junction $A\to B\leftarrow C$, the opposite is true: chain starts out blocked, but conditioning on $B$ unblocks it due to the "explain-away effect". For example, a sprinkler may operate independently of the rain, but if you're told that the grass is wet, then they become negatively correlated.
  • Conditioning on the descendant of a variable is like also like conditioning on the variable itself. Conditioning on the descendant of a mediator or confounding variable partially blocks the pathway; conditioning on the descendant of a collider partially unblocks the pathway. This is "partial", in the sense that parent nodes take priority over child nodes in deciding how the pathway is blocked.
So by adding $\mathrm{do}(X)$ to a causal model, $X$ becomes a collider, and so $\mathrm{do}(X)$ can be adjusted independently of $X$'s other parents, thus blocking the flow of information through the parents' causal pathways -- this is also precisely what a randomized control trial does, in which $\mathrm{do}(X)$ is given some distribution.

Ancestral graphs

Here's a somewhat harder example, involving common causes: suppose the true model of smoking and cancer looks like this:

And suppose that risk-averseness is unobserved/not part of our universe. Can we still recover the fact that there is no causal link between smoking and cancer (according to this model) without this common cause being known? In other words, consider the following scenario: a correlation is observed between smoking and cancer, but a randomized experiment shows no increase in cancer from do(Smoking), and no increase in smoking from do(Cancer) either (so you can't just point an arrow from cancer to smoking either). The true model looks something like this:

To simplify, let's consider a logical model -- the truth table looks like this:

Risk do(smoking) smoking do(cancer) cancer
0 0 0 0 0
0 0 0 1 1
1 0 1 0 1
1 0 1 1 1
0 1 1 0 0
1 1 1 0 1
0 1 1 1 1
1 1 1 1 1

And if risk is unobserved:

do(smoking) smoking do(cancer) cancer
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 1 0 0
1 1 0 1
1 1 1 1

Well, here's the thing: smoking's parent cannot be do(smoking) alone, because smoking and cancer are not independent once conditioned on do(smoking) -- you can't have smoking and cancer take on different values if do(smoking) is 0. And if you condition on do(smoking) and do(cancer) both, then you can't have smoking and cancer take on different values if do(smoking) and do(cancer) are both 0. So cancer must itself be a parent to smoking -- and by a similar argument, smoking must itself be a parent to cancer. 

Obviously, this is not possible in a DAG, so if we assume that the universe is causal, this data implies the existence of an unobserved hidden cause. Such data -- where some vertices of a DAG are marginalized over -- can be represented with an ancestral graph [1]. The question, then, is how the full DAG can actually be learned from the data, i.e. what the causal structure is, what its distribution is, etc. Some relevant papers: [1][2][3][4] Fundamentally, however, this seems closely related to the problem of causal discovery and representation learning.

Time

One may imagine taking the limit to a continuum of random variables, in which a DAG approaches a partial order. 

It is notable that this is a partial order, and not a total order. This allows for something like relativity, in which time ordering cannot be established for spacelike separated events. Indeed, the causal model of spacetime in special relativity looks like this, and light cones are simply sets of paths in the DAG:


Newcomb's problem and the limits of CDT

An AI offers you two boxes, and gives you the options of choosing either only Box A, or Box A + Box B. It says it has modelled your mind, and set up the boxes based on its predictions of your behavior: Box B will contain £1 no matter what, but Box A will contain £1000 only if you one-box. What do you choose?

Causation is fundamentally a decision-theoretic idea, and Newcomb's problem reveals a fundamental problem with causal decision theory: causal decision theory pretends that the agent is completely independent of the environment -- from physics. In reality, the agent is a "part" of physics -- the $\mathrm{do}(X)$ variable itself has arrows going into it -- 

I believe that causal decision theory should be considered a special case of evidential decision theory in which certain choices can be made "freely", in which true "do" operators exist

A similar problem arises with time travel as in Harry Potter and the Methods of Rationality. Here too there are arrows pointing into $\mathrm{do}(X)$, arising from the causal graph no longer being DAG. 

There was another pause, and then Madam Bones’s voice said, "I have information which I learned four hours into the future, Albus. Do you still want it?" Albus paused— (weighing, Minerva knew, the possibility that he might want to go back more than two hours from this instant; for you couldn’t send information further back in time than six hours, not through any chain of Time-Turners) —and finally said, “Yes, please.”

(Of course, "I have information from four hours into the future" is itself information, as is any such interaction, and indeed if time loops of constant length exist at every point in time then arbitrarily large time loops can be created simply by adding them.)

Positivism as the rejection of anthropic reasoning

The Sleeping Beauty problem
The following experiment is performed on Sleeping Beauty: on Sunday, she is put to sleep, after which a coin is flipped.

If the coin came up heads, she will be woken up once on Monday. If the coin came up tails, she will be woken up twice, on Monday and Tuesday.

Each time she is woken up (with no indication of given of what day/which instance it is), she is asked the odds that the coin came up heads, then her memory of the waking is wiped and she is put back to sleep.

Given that she knows how the experiment works, should she answer odds of 1/2 or 1/3?
The answer is obviously 1/2. That is the prior probability of the coin coming up heads, and being woken up gives her no new information -- it just tells her that she's been woken up at least once. She already knew she'd be woken up -- if she expects her odds at being woken up to be 1/3, then her odds would have already been 1/3 before she started the experiment (this is, of course, a standard trick).

$$P(H|W\ge 1)=\frac{P(W\ge 1|H)\cdot P(H)}{P(W\ge 1)}=P(H)=\frac12 $$
A very large number of people, however -- including on LessWrong -- argue that Beauty should answer "1/3", or that that "both answers are right, depending on how you formulate the problem", or something to that flavour.

But this is a perfectly well-posed problem -- both answers cannot be right. The LW post is right that I notice I am confused, but wrong about what I notice I am confused by.

I don't find the problem itself confusing. I find people's minds and people's intuitions confusing -- including my own, because I can certainly see the intuition for 1/3.

One might say that this is uninteresting -- it doesn't matter what you "feel", the truth is the truth.

Well, an important scientific skill is to correct your intuitions to reflect reality. When you learned about relativity, you had to fix your intuition about fixed lengths and time intervals by thinking about four-vectors. When you learned about quantum mechanics, you had to fix your intuition about there being an absolute reality by learning about state vectors and how observation projects it rather than revealing an underlying reality.

Because human heuristic reasoning/understanding/skip-aheads is almost entirely in terms of such mental models, i.e. intuition, I would go so far as to say that if you don't understand why your intuition goes wrong, you don't understand why it is wrong in the first place, because it is your intuition that reflects your understanding, your model of the physical world.



Fair bets

So why do you sometimes "feel" that the answer is 1/3, even when Bayes's theorem says it is 1/2?

I would explain my intuition in terms of Monte-Carlo simulations: I think -- "probability (kindasorta) means how many times will something be true if repeated, right?" So if we repeat the experiment 100 times, then out of the 150 times she's woken up, 50 times the answer would be "heads" and 100 times the answer would be "tails".

Or in other words, if Beauty had the option to bet which way the coin had come up (e.g. she gets 1pt if her prediction is correct, 0pt if wrong), then if she consistently bet tails, she'd end up with 100pt, while if she consistently bet heads, she'd end up with 50pt.

And what of her making this bet before the experiment begins? What if she is given a choice, before the experiment begins to either: (a) bet, when she wakes up, that the coin came up heads or (b) bet, when she wakes up, that the coin came up tails?

Aha! But that's not a fair bet! That's giving her the option to bet twice that the coin came up heads, or bet once that the coin came up tails -- which is really a bet offering her 2:1 odds on the coin coming up tails -- so of course she should take tails.

But that still doesn't eliminate our entire confusion. Sure, from the perspective of SleepingBeauty-before-the-experiment, this is a bet offering 2:1 odds ... but from the perspective of SleepingBeauty-who-just-woke-up, there's no 2:1 odds, is there?



A prisoner's dilemma against a temporally-displaced copy of yourself that may or may not exist

When Beauty wakes up, she knows that there is a 1/2 probability that the coin came tails, and so a 1/2 probability that there will be another time she'll be woken up and asked the same question, offered the same bet -- and a 1/2 probability that that the coin came up heads, and so a 1/2 probability that there won't be such a time.

So she is really playing Prisoner's Dilemma against an identical copy of herself. If she chooses heads, then her twin -- who may or may not exist -- will also choose heads, because two identical copies cannot act differently. If she chooses tails, then that possibly-existent twin will also choose tails.

So if the coin came out heads (of which there's a 50% chance), then her choosing heads will lead to a payout of 1pt, but if the coin came out tails, then her choosing tails will lead to a payout of 2pt.

So if Beauty accepts evidential decision theory, she will, in fact, win, while also holding the true belief about the probability of a heads -- 1/2. Of course she will lose if she accepts causal decision theory, but that's fine -- causal decision theorists lose all the time.

(In fact there is a problem that even EDT seems to fail at, which I will discuss in a future post, but this has nothing to do with anthropics and Sleeping Beauties, so I don't believe it to be relevant here.)



Positivism vs. Anthropic reasoning

The "halfer" argument can be considered a rejection of anthropic reasoning. Anthropic reasoning can be illustrated with simpler, less unwieldy examples:
  • Bostrom's Simulation Argument: If we are not living in a computer simulation, then it is unlikely that humans will ever make a large number of universe simulations, so we'll probably go extinct very soon or something. Also Boltzmann brains.
  • Celibate Adam: You are the Bibilical Adam, and decide, on a whim, to procreate with Eve if and only if a coin toss comes up heads. So an anthropist Adam reasons that the coin toss will almost certainly come up tails, because what are the odds that he has billions of progeny and he just happened to be in this body?
The last riddle makes the problem with anthropic reasoning manifestly obvious, since the decision to only count human bodies and not animals, rocks, and random disparate sets of particles is a completely arbitrary one. 

Anthropic reasoning carries an underlying assumption that there is some metaphysical process that randomly allocates "souls" into human bodies. The basic belief of the anthropists is that metaphysical claims can be information -- like "I am conscious" (note that the basic problem here isn't "conscious" as much as it is "I").

Well, I obviously don't have much respect for this sort of fluff -- I simply reject this kind of thing at the level of epistemology.

The fundamental lesson of logical positivism is that your beliefs should not depend on your metaphysical gauge -- in particular, they should not depend on whether you believe in philosophical zombies (or rather, what you consider to be philosophical zombies), universal minds or many worlds.

The model of Celibate Adam problem according to anthropists.
And by the way, this also explains the "non-anthropic equivalents" that anthropists provide for anthropic problems -- these non-anthropic equivalents are just scenarios which make these metaphysical models real. For example, the "non-anthropic equivalent" of the Sleeping Beauty problem looks like this (and I encourage you to work it out before reading):
There are two Awake Beauties. A coin is flipped -- if the coin comes up Heads, then one Awake Beauty is randomly selected for interview; if the coin comes up Tails, then both Awake Beauties are interviewed. You, who are one of the Awake Beauties, are interviewed -- what is your credence for the coin having come up heads?

The model of Sleeping Beauty problem according to anthropists.
And these sorts of "metaphysical models" are implicit in the betting-based arguments -- when you say, "people in computer simulations would benefit from betting that they are, so so should you", you are in effect putting yourself in the same category as the simulated people to set up the frequentist "experiment". But whether what the simulated people should do is correlated with what you should do is entirely a matter of your Bayesian prior, and there's nothing in the prior that requires anthropic considerations.

By the way, this is why frequentism cannot be a fundamental basis of defining probability. E.g. if you're trying to place odds on an unfair coin toss, and you say "well, my coin-tosses have been 75-25 so far, so that means the probability is 75-25", then you are making the arbitrary decision that the results of your previous coin-tosses predict the next one, you are arbitrarily putting them in the same category. Your Bayesian prior is what justifies this categorization, this believed correlation, the belief that some weird systematic gust of wind won't affect your 101th toss, your Bayesian prior is what lets you do sample tests. Sample tests are not a definition of probability, and in the absence of sample tests -- i.e. without assuming known correlations between some observed phenomenon and the phenomenon you're trying to predict -- like in the case of questions like "what is the probability of us being in a simulation?", your prior is all that matters.

And so similarly with Doomsday arguments, "the mediocrity assumption" or "the Copernican assumption" is just some basically arbitrary Bayesian prior (and in that case we do have additional evidence that correlates with whether the world will end or not, so we should be updating this belief, in whatever direction, and mediocrity should not be the basis of our decisions, just like how we have information on human life expectancies, so a 5-year old should not believe that he will die at 10).

In the Sleeping Beauty problem, if you replaced the monetary reward for something completely short-term, like a cookie, so Beauty does not care about whether her other awakening gets it or not, then betting on tails no longer gives her an advantage over betting on heads. You might say "well, but if she always bets on tails, she gets twice as many cookies", but this is irrelevant -- there's no reason to regard that as a relevant frequentist experiment that affects her beliefs about the probability of the coin coming up heads. Her prior is 50-50, and no new (real, non-metaphysical) information has been introduced to her. 

Hacking Evidential Decision Theory

In the previous article, we discussed the Sleeping Beauty problem, rejected anthropic reasoning and and explained how the "halfer" position is the correct one and it only "loses" if you accept Causal Decision Theory, but that's okay since CDT agents lose all the time.

Well, upon some thinking, it seems that agents EDT agents can also lose, but this has nothing to do with anything anthropic. Here are two equivalent (to each other) problems that "beat" Evidential Decision Theory:
  • Vincent Conitzer (2017) (simplified version):  Two coins are flipped. Our good friend and lab rat Sleeping Beauty is woken up on (if HH or HT) Monday and Tuesday (if TH) Monday and Wednesday (if TT) Tuesday and Wednesday. When woken up, she is told what day it is, and offered the following bet: "1pt for correctly guessing Heads, 3pt for correctly guessing Tails". Should she take the bet?
In terms of precommitment, committing to bet heads means an expected return of 1pt, while committing to bet tails means an expected return of 1.5pt. So she should bet tails.

But if she wakes up on Monday (or symmetrically Tuesday), then betting heads means an expected return of 1.33pt, while betting tails means an expected return of 1pt. So she bets heads.

(The problem can be formulated in terms of sending two different agents into rooms, so there's nothing anthropic/memory loss/splitting people in two about this.)
  • Psy-Kosh's non-anthropic problem: You have 10 identical agents with shared finances. Flip a coin -- if Heads, send 9 agents to green rooms and 1 agent to a red room. If Tails, send 1 agent to a green room and 9 agents to red rooms. Offer the agents in green rooms $(G-3R)$pt, where $G$ and $R$ are the number of agents in green and red rooms -- and the offer is executed only if all agents agree to accept it. Should they take the offer?
If the coin comes up heads, $G-3R=6$. If the coin comes up tails $G-3R=-26$. 

In terms of precommitment, we know that the probability of heads is 50%, and the expected gain from taking the bet is -10pt, so the agent's shouldn't take the bet.

But when an agent actually wakes up in a green room, it figures that means a 90% chance of Heads, and the expected gain from taking the bet is 2.80pt.

I.e. you end up with maybe 1, maybe 9 green agents who think -- perfectly rationally -- "what are the odds of there being just one green agent and it happening to be me?" and assign 10% odds to that possibility, and therefore to Tails, even though 50% of the cases are actually Tails, because 90% of the times that you end up in Green, the coin has come up Heads. 

It seems that superrationality is not good enough. 

+related to simpson's paradox?