My reason for writing this is not to correct Eliezer. Rather, I want to expand on his distinction between prior information and prior probability. Pages 87-89 of Probability Theory: the Logic of Science by E. T. Jaynes (2004 reprint with corrections, ISBN 0 521 59271 2) is dense with important definitions and principles. The quotes below are from there, unless otherwise indicated.

Jaynes writes the fundamental law of inference as

  P(H|DX) = P(H|X) P(D|HX) / P(D|X)         (4.3)

Which the reader may be more used to seeing as

 P(H|D) = P(H) P(D|H) / P(D)


 H = some hypothesis to be tested
 D = the data under immediate consideration
 X = all other information known

X is the misleadingly-named ‘prior information’, which represents all the information available other than the specific data D that we are considering at the moment. “This includes, at the very least, all it’s past experiences, from the time it left the factory to the time it received its current problem.” --Jaynes p.87, referring to a hypothetical problem-solving robot. It seems to me that in practice, X ends up being a representation of a subset of all prior experience, attempting to discard only what is irrelevant to the problem. In real human practice, that representation may be wrong and may need to be corrected.

“ ... to our robot, there is no such thing as an ‘absolute’ probability; all probabilities are necessarily conditional on X at the least.” “Any probability P(A|X) which is conditional on X alone is called a prior probability. But we caution that ‘prior’ ... does not necessarily mean ‘earlier in time’ ... the distinction is purely a logical one; any information beyond the immediate data D of the current problem is by definition ‘prior information’.”

“Indeed, the separation of the totality of the evidence into two components called ‘data’ and ‘prior information’ is an arbitrary choice made by us, only for our convenience in organizing a chain of inferences.” Please note his use of the word ‘evidence’.

Sampling theory, which is the basis of many treatments of probability, “ ... did not need to take any particular note of the prior information X, because all probabilities were conditional on H, and so we could suppose implicitly that the general verbal prior information defining the problem was included in H. This is the habit of notation that we have slipped into, which has obscured the unified nature of all inference.”

“From the start, it has seemed clear how one how one determines numerical values of of sampling probabilities¹ [e.g. P(D|H) ], but not what determines prior probabilities [AKA ‘priors’ e.g. P(H|X)]. In the present work we shall see that this s only an artifact of the unsymmetrical way of formulating problems, which left them ill-posed. One could see clearly how to assign sampling probabilities because the hypothesis H was stated very specifically; had the prior information X been specified equally well, it would have been equally clear how to assign prior probabilities.”

Jaynes never gives up on that X notation (though the letter may differ), he never drops it for convenience.

“When we look at these problems on a sufficiently fundamental level and realize how careful one must be to specify prior information before we have a well-posed problem, it becomes clear that ... exactly the same principles are needed to assign either sampling probabilities or prior probabilities ...” That is, P(H|X) should be calculated. Keep your copy of Kendall and Stuart handy.

I think priors should not be cheaply set from an opinion, whim, or wish. “ ... it would be a big mistake to think of X as standing for some hidden major premise, or some universally valid proposition about Nature.”

The prior information has impact beyond setting prior probabilities (priors). It informs the formulation of the hypotheses, of the model, and of “alternative hypotheses” that come to mind when the data seem to be showing something really strange. For example, data that seems to strongly support psychokinesis may cause a skeptic to bring up a hypothesis of fraud, whereas a career psychic researcher may not do so. (see Jaynes pp.122-125)

I say, be alert for misinformation, biases, and wishful thinking in your X. Discard everything that is not evidence.

I’m pretty sure the free version Probability Theory: The Logic of Science is off line. You can preview the book here: .

Also see the Unofficial Errata and Commentary for E. T. Jaynes’s Probability Theory: The Logic of Science



  1. There are massive compendiums of methods for sampling distributions, such as
    • Feller (An Introduction to Probability Theory and its Applications, Vol1, J. Wiley & Sons, New York, 3rd edn 1968 and Vol 2. J. Wiley & Sons, New York, 2nd edn 1971) and Kendall and
    • Stuart (The Advanced Theory of Statistics: Volume 1, Distribution Theory, McMillan, New York 1977).
      ** Be familiar with what is in them.

Edited 05/05/2010 to put in the actual references.

Edited 05/19/2010 to put in SEE ALSO

Priors as Mathematical Objects

by Eliezer Yudkowsky 4 min read12th Apr 200719 comments


Followup to:  "Inductive Bias"

What exactly is a "prior", as a mathematical object?  Suppose you're looking at an urn filled with red and white balls.  When you draw the very first ball, you haven't yet had a chance to gather much evidence, so you start out with a rather vague and fuzzy expectation of what might happen - you might say "fifty/fifty, even odds" for the chance of getting a red or white ball.  But you're ready to revise that estimate for future balls as soon as you've drawn a few samples.  So then this initial probability estimate, 0.5, is not repeat not a "prior".

An introduction to Bayes's Rule for confused students might refer to the population frequency of breast cancer as the "prior probability of breast cancer", and the revised probability after a mammography as the "posterior probability". But in the scriptures of Deep Bayesianism, such as Probability Theory: The Logic of Science, one finds a quite different concept - that of prior information, which includes e.g. our beliefs about the sensitivity and specificity of mammography exams. Our belief about the population frequency of breast cancer is only one small element of our prior information.

In my earlier post on inductive bias, I discussed three possible beliefs we might have about an urn of red and white balls, which will be sampled without replacement:

  • Case 1:  The urn contains 5 red balls and 5 white balls;
  • Case 2:  A random number was generated between 0 and 1, and each ball was selected to be red (or white) at this probability;
  • Case 3:  A monkey threw balls into the urn, each with a 50% chance of being red or white.

In each case, if you ask me - before I draw any balls - to estimate my marginal probability that the fourth ball drawn will be red, I will respond "50%".  And yet, once I begin observing balls drawn from the urn, I reason from the evidence in three different ways:

  • Case 1:  Each red ball drawn makes it less likely that future balls will be red, because I believe there are fewer red balls left in the urn.
  • Case 2:  Each red ball drawn makes it more plausible that future balls will be red, because I will reason that the random number was probably higher, and that the urn is hence more likely to contain mostly red balls.
  • Case 3:  Observing a red or white ball has no effect on my future estimates, because each ball was independently selected to be red or white at a fixed, known probability.

Suppose I write a Python program to reproduce my reasoning in each of these scenarios.  The program will take in a record of balls observed so far, and output an estimate of the probability that the next ball drawn will be red.  It turns out that the only necessary information is the count of red balls seen and white balls seen, which we will respectively call R and W.  So each program accepts inputs R and W, and outputs the probability that the next ball drawn is red:

  • Case 1:  return (5 - R)/(10 - R - W)    # Number of red balls remaining / total balls remaining
  • Case 2:  return (R + 1)/(R + W + 2)    # Laplace's Law of Succession
  • Case 3:  return 0.5

These programs are correct so far as they go.  But unfortunately, probability theory does not operate on Python programs.  Probability theory is an algebra of uncertainty, a calculus of credibility, and Python programs are not allowed in the formulas.  It is like trying to add 3 to a toaster oven.

To use these programs in the probability calculus, we must figure out how to convert a Python program into a more convenient mathematical object - say, a probability distribution.

Suppose I want to know the combined probability that the sequence observed will be RWWRR, according to program 2 above.  Program 2 does not have a direct faculty for returning the joint or combined probability of a sequence, but it is easy to extract anyway.  First, I ask what probability program 2 assigns to observing R, given that no balls have been observed.  Program 2 replies "1/2".  Then I ask the probability that the next ball is R, given that one red ball has been observed; program 2 replies "2/3".  The second ball is actually white, so the joint probability so far is 1/2 * 1/3 = 1/6.  Next I ask for the probability that the third ball is red, given that the previous observation is RW; this is summarized as "one red and one white ball", and the answer is 1/2.  The third ball is white, so the joint probability for RWW is 1/12.  For the fourth ball, given the previous observation RWW, the probability of redness is 2/5, and the joint probability goes to 1/30.  We can write this as p(RWWR|RWW) = 2/5, which means that if the sequence so far is RWW, the probability assigned by program 2 to the sequence continuing with R and forming RWWR equals 2/5.  And then p(RWWRR|RWWR) = 1/2, and the combined probability is 1/60.

We can do this with every possible sequence of ten balls, and end up with a table of 1024 entries.  This table of 1024 entries constitutes a probability distribution over sequences of observations of length 10, and it says everything the Python program had to say (about 10 or fewer observations, anyway).  Suppose I have only this probability table, and I want to know the probability that the third ball is red, given that the first two balls drawn were white.  I need only sum over the probability of all entries beginning with WWR, and divide by the probability of all entries beginning with WW.

We have thus transformed a program that computes the probability of future events given past experiences, into a probability distribution over sequences of observations.

You wouldn't want to do this in real life, because the Python program is ever so much more compact than a table with 1024 entries.  The point is not that we can turn an efficient and compact computer program into a bigger and less efficient giant lookup table; the point is that we can view an inductive learner as a mathematical object, a distribution over sequences, which readily fits into standard probability calculus.  We can take a computer program that reasons from experience and think about it using probability theory.

Why might this be convenient?  Say that I'm not sure which of these three scenarios best describes the urn - I think it's about equally likely that each of the three cases holds true.  How should I reason from my actual observations of the urn?  If you think about the problem from the perspective of constructing a computer program that imitates my inferences, it looks complicated - we have to juggle the relative probabilities of each hypothesis, and also the probabilities within each hypothesis.  If you think about it from the perspective of probability theory, the obvious thing to do is to add up all three distributions with weightings of 1/3 apiece, yielding a new distribution (which is in fact correct).  Then the task is just to turn this new distribution into a computer program, which turns out not to be difficult.

So that is what a prior really is - a mathematical object that represents all of your starting information plus the way you learn from experience.