a general theory of goodness of fit in likelihood fits

18
Sep 14, 200 5 Rajendran Raja, PHYSTAT05, Oxfor d, England 1 A General Theory of Goodness of Fit in Likelihood fits Rajendran Raja Fermilab Phystat05, Oxford England SLAC PHYSTAT03 Gave a solution to the unbinned goodness of fit problem Generalizing this to Binned and Unbinned goodness of fit as a general theory Calculation of Errors– Obviates the need for Bayesian Priors. Poster Session. Mathematical Proof. Can provide Fortran Subroutines do perform unbinned goodness of fit. See physics/0509008 for further details

Upload: quang

Post on 12-Feb-2016

54 views

Category:

Documents


0 download

DESCRIPTION

A General Theory of Goodness of Fit in Likelihood fits. Rajendran Raja Fermilab Phystat05, Oxford England SLAC PHYSTAT03 Gave a solution to the unbinned goodness of fit problem Generalizing this to Binned and Unbinned goodness of fit as a general theory - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 1

A General Theory of Goodness of Fit in Likelihood fits

Rajendran RajaFermilab

Phystat05, Oxford England

SLAC PHYSTAT03 Gave a solution to the unbinned goodness of fit problem

Generalizing this to Binned and Unbinned goodness of fit as a general theory

Calculation of Errors– Obviates the need for Bayesian Priors. Poster Session. Mathematical Proof.

Can provide Fortran Subroutines do perform unbinned goodness of fit.

See physics/0509008 for further details

Page 2: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 2

Format of talk• State Maximum likelihood formulas for unbinned fits.• Quote “theorem” as to why Goodness of Fit(GoF) cannot

exist for unbinned likelihood fits.• Derive Bayes’ Theorem• Motivate Likelihood Ratios• Use PDE’s to estimate the pdf of data and introduce the

concept of feeding in data into Bayes’ theorem.• Illustrative Example for 1d unbinned fits.• Empirical Measure of GoF• End of Bayesianism-

» Measure the Bayesian prior using data. » Show that the Bayesian prior in this scheme is a number

NOT a distribution.» Derive the Posterior likelihood function, which is the same

as the frequentist formula• Rewriting Bayes’ Equations to take into account the fact

that a priori distributions depend on the number of events.• Application to binned cases eg 2

• Conclusions» GoF exists for unbinned fitsSolve the unsolved problem. As

a result a new insight into the Bayes’ prior results.» Bayes’ prior in the Bayesian formula is the value of the

Bayes’ prior distribution at the true value. » Frequentist error formulae obtain» Bayes Theorem lives, but Bayesianism is no longer needed» 2 can also be shown as a –log likelihood ratio !.

• If time permits will discuss new method to do PDE’s

Page 3: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 3

Notation

s denotes signal. Can be multi-dimensional.

c denotes configurations and signifies data. Can be multi-dimensional

P(s|c) signifies the conditional probability density in s, given c.

P(c|s) signifies the conditional probability density in c, given s. I.e It defines the theoretical model-theory pdf which obeys normalization condition.

Let denote the dataset Then

is the likelihood of observing the dataset

1)|( dcscP

nc

,nici 1,

)|()|(1

scPscPLni

iin

nc

Page 4: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 4

Maximum Likelihood method for fitting theory to data

• Due to R.A. Fisher• Maximize

• The maximum likelihood point s* yields the best fit to the data of the theoretical model specified by P(c|s)

• This yields the optimum estimate for the true value of s. However, no goodness of fit criterion exists. Likelihood at maximum likelihood point is NOT such a measure.

)|()|(1

scPscPLni

iin

Page 5: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 5

To show that Likelihood does not furnish goodness of fit measure

• Goodness of fit must be invariant under change of variable c’=(c’(c))

1|'

|*)|(*)|'(

*)|(|'|

)|()('

0.5,0.1))/exp()/((exp

)/exp()|(

1

*

21

21

ccscPscP

scPcc

dtstPcc

ccscscs

scscP

c

c

Page 6: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 6

Likelihood Ratios

• Introduce the concept of “data likelihood” as derived from data. If P(c) is the “frequentist” pdf of the data, the the “data likelihood” for dataset is defined as

• This object may be thought of as the pdf of the n-object .

• Then the likelihood ratio

• Is invariant under change of variable since the Jacobians cancel in the numerator and denominator.

• Likelihood ratios multiply.

nc

ni

iin

data cPcP1

)()(

nc

)()|(

ndatan

R cPscPL

)()|(

)()|(

ndatan

mdatamn

RmR

nmR cP

scPcPscPLLL

Page 7: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 7

Historical use of Likelihood ratios

• Likelihood ratios are enshrined in statistics by the Neyman-Pearson lemma which states that the cut

will have the optimum power in differentiating between the hypotheses s1 and s2 where is a cut chosen to obtain the requisite purity.

• Note that the Neyman-Pearson use of the likelihood ratio is between two theoretical distributions both in the numerator and the denominator.

• We believe, we are introducing the notion of data likelihood as evaluated using the data pdf alone. This quantity restores the goodness of fit in both the binned and unbinned likelihood fits, yielding a general theory of goodness of fit.

• It does away with the Bayesian prior! See Poster session

• What is it– It is mere a generalized pdf of the n-object

)|()|(

2

1

scPscPL

n

nR

nc

Page 8: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 8

Binned Likelihood goodness of fit

• Let there be nb bins and let the kth bin whose center abscissa is given by ck contain nk entries.

• Then the probability of obtaining the histogram containing a total of n events is given by the multinomial

• Histogram is degenerate with degeneracy factor

• Each such histogram has the same goodness of fit• So We can just solve the problem for one of them.

nn

scPn

nhistogramP

b

bk

b

nk

kk

nk

k

nknk

kk

1

1

1

)|(!

!)(

bnk

kkn

nD

1

!

!

Page 9: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 9

Binned Likelihood goodness of fit

• Then the binned likelihood ratio is

• We can estimate the denominator by

where is the bin width for the kth bin. This yields

where the Tk is the theoretically expected number of events in the kth bin given by

This is the same result as given by Baker and Cousins(NIM A221, 1984) for the multinomial but derived using the new theory.

kb

nnk

k kdatak

R cPscPL

1 )()|(

k

kk

data

cnncP

)(

kc

kb

nnk

k k

kR n

TL

1

)|(averagebin scPcnT kkk

Page 10: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 10

Comparison of derivation with Baker and Cousins

• Baker and Cousins justify the use of a likelihood ratio by the likelihood ratio theorem and employ a LR of theory to the true value.

• Then they say the maximum likelihood for the true value is when (True value)k = nk. This yields the same result, but our rationale is very different. We form a ratio between the theoretical likelihood and the new concept the data likelihood as derived from data.

• We now show that this quantity asymptotes to a 2 distribution for large n.

kb

nnk

k k

kBCR

TL

1 Value True

Page 11: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 11

To show that NLLR asymptotes to a 2 distribution

• Example of the Likelihood Ratio Theorem

b b

b

b

kb

b

nk

k

nk

kk

k

k

k

k

k

k

k

knk

kk

k

ke

nk

kkRe

nnk

k k

kR

nk

kkkkk

n

nnnn

nnLNLLR

nL

Tn

1 1

22

32

1

1

1

1

21

21NLLR ,n As

...31

21

1log)(log

1

0;

)2/exp()( bR nLE

Page 12: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 12

Maximum likelihood fits only shapes not normalizations

• No information on the theoretical expected number of events. We evaluat the likelihood ratio on the observed data events. Both the theoery likelihood and data likelihood integrate to unity. So no information on the normalization.

• Get around this by using the binomial distribution and demanding the observed number of events be in the first bin. Let N be the number of identical experiments in an ensemble. Then for the binomial, the likelihood ratio, using our theory,can be written

• We let N go to infinity in two well known limits.• Poisson—nt and n finite.

ensemble in the sexperiment ofnumber theis N observed events ofnumber lexpeimenta theisn

expected events ofnumber al theoretic theis where/1/1

t

nNt

nt

nNt

nt

R

nNnNn

nn

nNnN

nnL

ntnn

R nneL t

)(

Page 13: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 13

Binned Likelihood gof- Poisson Normalization gof

• Multiplying this LR with binned likelihood LR yields the formulae

• Same as the “multinomial” and “poissonian” results of Baker and Cousins.

• Gaussian Limit of the Binomial, n and nt also go to infinity as N goes to infinity. Yields

ionnormalizat and shapes;logNLLR

;

only shapes;log

'1

'

1

''

1

k

knk

kekkk

t

n

kk

ktk

k

knk

kek

TnnnT

nTnTnT

TnnNLLR

b

b

b

-pqNnpNpq

eLtnn

R

1 ;/ ;2

2)(

2

2

Page 14: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 14

To show that 2 distribution is an NLLR

• Let the contents of the kth bin be denoted by ck.

• Let the theoretical expectation for the kth bin be sk.

• Let the standard deviation of the kth bin be k.

• Then,

• People mistakenly conclude that 2 is the negative log of a likelihood.

• Correct expression is to note that

)2(log2

))|((log

2exp

21

2exp

21)|(

2

2

2

2

kek

kke

kk

kk

kkk

scP

scscP

2exp

)()|(

21

2exp

21)(

2

2

2

k

k

kkR

kk

kk

kk

cPscPL

cccP

Page 15: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 15

Unbinned Goodness of Fit• Apply same theory. We now need a way to estimate the

“data density” for unbinned data.• Steps- First, perform an unbinned likelihood fit.• Second-Evaluate the “data likelihood” by the

method of probability density estimators (PDE)- also known as Kernel Density Estimators (KDE).

• Reported on this in PHYSTAT03.• To summarize, the best PDE method is to transform to

hypercube co-ordinates, where P(c’|s) is flat. • The likelihood ratio LR is invariant and will not depend

on the co-ordinate system.• For each event ci i=1,n, define a boxcar function centered

on ci of width h so that the kernel

• Use periodical boundary conditions on the kernels so that

• Treats every point in hypercube like every other.

( )nP c

1( ') ;| ' |2

( ') 0;| ' |2

( ') ' 1

hG c ch

hG c c

G c dc

( ' ' ) ( ' ' 1); ' 1( ' ' ) ( ' ' 1); ' 0

i i

i i

G c c G c c cG c c G c c c

Page 16: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 16

Unbinned Likelihood gof

• Then the PDE for the data likelihood is given by

• Exponential + Gaussian- Data (crosses) and PDE histogram

1

1

1( ) ( ) ( )

( ) 1

( ) ( )

k ndata

kk

data

i ndata

n ii

P c PDE c G c cn

P c dc

P c P c

Page 17: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 17

Likelihood vs Likelihood Ratio• Negative log likelihoods, beside not being invariant are

broad. (Top Left)• Negative Log PDE likelihood are similar (Top right) and

contain information from data!• The two correlate (Bottom left)• The difference is the narrow GoF, negative log likelihood

ratio (Bottom right)

Page 18: A General Theory of Goodness of Fit in Likelihood fits

Sep 14, 2005 Rajendran Raja, PHYSTAT05, Oxford, England 18

PDE + ‘data’ in hypercube and time co-ordinates