Lecture2009_1_Heidel..
Download
Report
Transcript Lecture2009_1_Heidel..
4th IMPRS Astronomy Summer School
Drawing Astrophysical Inferences from Data Sets
William H. Press
The University of Texas at Austin
Lecture 1
IMPRS Summer School 2009, Prof. William H. Press
1
Additivity or “Law of Or-ing”
“Law of Exhaustion” for EME
X
P (R i ) = 1
P (A [ B ) = P (A) + P (B ) ¡ P (AB )
i
Independence:
Multiplicative Rule or “Law of And-ing”
“given”
P (AB ) = P (A)P (B jA) = P (B )P (AjB )
P (B jA) =
P (AB )
P (A)
“conditional probability”
“renormalize the
outcome space”
Event s A and B are independent if
P (AjB ) = P (A)
so P (AB ) = P (B )P (AjB ) = P (A)P (B )
IMPRS Summer School 2009, Prof. William H. Press
2
Law of Total Probability or “Law of de-Anding”
H’s are exhaustive and
mutually exclusive (EME)
X
P (B ) = P (B H 1 ) + P (B H 2 ) + : : : =
i
X
P (B ) =
P (B H i )
P (B jH i )P (H i )
i
“How to put Humpty-Dumpty back together again.”
IMPRS Summer School 2009, Prof. William H. Press
3
Example: A barrel has 3 minnows and 2 trout, with
equal probability of being caught. Minnows must
be thrown back. Trout we keep.
What is the probability that the 2nd fish caught is a
trout?
H 1 ´ 1st caught is minnow, leaving 3 + 2
H 2 ´ 1st caught is t rout , leaving 3 + 1
B ´ 2nd caught is a t rout
P (B ) = P (B jH 1 )P (H 1 ) + P (B jH 2 )P (H 2 )
=
2
5
¢3 +
5
1
4
¢ 2 = 0:34
5
IMPRS Summer School 2009, Prof. William H. Press
4
Bayes Theorem
Thomas Bayes
1702 - 1761
(same picture as before)
P (H i B )
Law of And-ing
P (B )
P (B jH i )P (H i )
= P
P (B jH j )P (H j )
P (H i jB ) =
j
We usually write this as
Law of de-Anding
P (H i jB ) / P (B jH i )P (H i )
this means, “compute the normalization by using the
completeness of the Hi’s”
IMPRS Summer School 2009, Prof. William H. Press
5
• As a theorem relating probabilities, Bayes is
unassailable
• But we will also use it in inference, where the H’s are
hypotheses, while B is the data
– “what is the probability of an hypothesis, given the data?”
– some (defined as frequentists) consider this dodgy
– others (Bayesians like us) consider this fantastically powerful
and useful
– in real life, the war between Bayesians and frequentists is long
since over, and most statisticians adopt a mixture of techniques
appropriate to the problem.
• Note that you generally have to know a complete set of
EME hypotheses to use Bayes for inference
– perhaps its principal weakness
IMPRS Summer School 2009, Prof. William H. Press
6
Example: Trolls Under the Bridge
Trolls are bad. Gnomes are benign.
Every bridge has 5 creatures under it:
20% have TTGGG (H1)
20% have TGGGG (H2)
60% have GGGGG (benign) (H3)
Before crossing a bridge, a knight captures one of the 5
creatures at random. It is a troll. “I now have an 80%
chance of crossing safely,” he reasons, “since only the case
20% had TTGGG (H1) now have TGGG
is still a threat.”
IMPRS Summer School 2009, Prof. William H. Press
7
so,
P (H i jT ) / P (T jH i )P (H i )
2 ¢1
2
5 5
P (H 1 jT ) =
=
2 ¢1 + 1 ¢1 + 0 ¢3
3
5
5
5
5
5
The knight’s chance of crossing safely is actually only 33.3%
Before he captured a troll (“saw the data”) it was 60%.
Capturing a troll actually made things worse! [well…discuss]
(80% was never the right answer!)
Data changes probabilities!
Probabilities after assimilating data are called posterior
probabilities.
IMPRS Summer School 2009, Prof. William H. Press
8
Commutivity/Associativity of Evidence
P (H i jD 1 D 2 ) desired
We see D 1 :
P (H i jD 1 ) / P (D 1 jH i )P (H i )
T hen, we see D 2 :
P (H i jD 1 D 2 ) / P (D 2 jH i D 1 )P (H i jD 1 )
But ,
= P (D 2 jH i D 1 )P (D 1 jH i )P (H i )
= P (D 1 D 2 jH i )P (H i )
this is now a prior!
this being symmetrical shows that we would get the same answer
regardless of the order of seeing the data
All priors P (H i ) are act ually P (H i jD ),
condit ioned on previously seen dat a! Oft en
writ e t his as P (H i jI ).
background information
IMPRS Summer School 2009, Prof. William H. Press
9
Our next topic is Bayesian Estimation of
Parameters. We’ll ease into it with…
The Jailer’s Tip:
• Of 3 prisoners (A,B,C), 2 will be released tomorrow.
• A, who thinks he has a 2/3 chance of being released, asks
jailer for name of one of the lucky – but not himself.
• Jailer says, truthfully, “B”.
• “Darn,” thinks A, “now my chances are only ½, C or me”.
Here, did the data (“B”) change the probabilities?
IMPRS Summer School 2009, Prof. William H. Press
10
Further, suppose the jailer is not indifferent
about responding “B” versus “C”.
P (SB jB C) = x;
(0 · x · 1)
“says B”
P (AjSB ) = P (AB jSB ) + P (ACjSB0)
1
1/3
P (SB jAB )P (AB )
=
P (SB jA B )P (AB ) + P (SB jB C)P (B C) + P (SB jCA)P (CA)
=
1
3
1 ¢1 + x ¢1 + 0
3
=
3
1
1+ x
x
So if A knows the value x, he can calculate his chances.
If x=1/2, his chances are 2/3, same as before; so he got no new information.
If x≠1/2, he does get new info – his chances change.
But what if he doesn’t know x at all?
IMPRS Summer School 2009, Prof. William H. Press
11
“Marginalization” (this is important!)
• When a model has unknown, or uninteresting,
parameters we “integrate them out” …
• Multiplying by any knowledge of their distribution
– At worst, just a prior informed by background information
– At best, a narrower distribution based on data
• This is not any new assumption about the world
– it’s just the Law of de-Anding
R
(e.g., Jailer’s Tip):
P (AjSB I ) =
=
x
R
law of de-Anding
P (AjSB xI ) p(xjI ) dx
1
x 1+ x
p(xjI ) dx
IMPRS Summer School 2009, Prof. William H. Press
12
We are trying to estimate a parameter
x = P (SB jB C);
(0 · x · 1)
What should Prisoner A take for p(x) ?
Maybe the “uniform prior”?
p(x) = 1; (0 · x · 1)
R
P (AjSB I ) = 1 1 dx = ln 2 = 0:693
0 1+ x
Not the same as the “massed prior at x=1/2”
p(x) = ±(x ¡
P (AjSB I ) =
1 );
2
1
1+ 1=2
(0 · x · 1)
= 2=3
“Dirac delta function”
substitute value and
remove integral
This is a sterile exercise if it is just a debate about priors.
What we need is data! Data might be a previous history
of choices by the jailer in identical circumstances.
BCBCCBCCCBBCBCBCCCCBBCBCCCBCBCBBCCB
IMPRS Summer School 2009, Prof. William H. Press
13
BCBCCBCCCBBCBCBCCCCBBCBCCCBCBCBBCCB
N = 35;
N B = 15;
N C = 20
(What’s wrong with: x=15/35=0.43?
Hold on…)
We hypothesize (might later try to check) that these are i.i.d. “Bernoulli
trials” and therefore informative about x
“independent and identically distributed”
P (dat ajx)
We now need
P (dat ajx)
is the (forward) statistical model in both frequentist vs. Bayesian
contexts. But it means something slightly different in each of the
two.
A forward statistical model assumes that all parameters, assignments,
etc., are known, and gives the probability of the observed data set. It is
almost always the starting point for a well-posed analysis. If you can’t
write down a forward statistical model, then you probably don’t understand
your own experiment or observation!
IMPRS Summer School 2009, Prof. William H. Press
14
the frequentist considers the universe of what might have been, imagining
repeated trials, even if they weren’t actually tried:
since i.i.d. only the N ’s can matter (a so-called “sufficient statistic”).
µ
P (dat ajx) =
¶
N prob. of exact sequence seen
x N B (1 ¡ x) N C
NB
¡ ¢
n
k
=
n!
k !( n ¡ k ) !
no. of equivalent arrangements
the Bayesian considers only the exact data seen:
P (xjdat a) / x N B (1 ¡ x) N C p(xjI )
prior is still with us
No binomial coefficient, since independent of x and absorbed in the
proportionality. Use only the data you see, not “equivalent arrangements”
that you didn’t see. This issue is one we’ll return to, not always entirely
sympathetically to Bayesians (e.g., goodness-of-fit).
IMPRS Summer School 2009, Prof. William H. Press
15
To get a normalized probability, we must integrate the denominator:
we’ll assume a uniform prior
This is the Bayesian estimate of
the parameter x, namely p(x)
IMPRS Summer School 2009, Prof. William H. Press
16
Properties of our Bayesian estimate of x:
derivative has this simple factor
“maximum likelihood” answer is to estimate x as exactly the fraction seen
mean is the 1st moment
standard error involves the
2nd moment, as shown
This shows how p(x)
gets narrower as the
amount of data
increases.
IMPRS Summer School 2009, Prof. William H. Press
17
The basic paradigm of Bayesian parameter estimation :
•
Construct a statistical model for the
probability of the observed data as a
function of all parameters
– treat dependency in the data correctly
•
Assign prior distributions to the parameters
– jointly or independently as appropriate
– use the results of previous data if available
•
•
Use Bayes law to get the (multivariate)
posterior distribution of the parameters
Marginalize as desired to get the
distributions of single (or a manageable
few multivariate) parameters
Cosmological models are typically fit to many
parameters. Marginalization yields the distribution of
parameters of interest, here two, shown as contours.
IMPRS Summer School 2009, Prof. William H. Press
18