Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf ·...

28
ML estesa Se n non è fisso, ma piuttosto una variabile di Poisson, con media ν. Il risultato dell’esperimento è allora: n, x 1 , ..., x n . La funzione likelihood (estesa) è: Se dalla teoria ν = ν(θ), allora la log-likelihood è dove C representa i termini che non dipendono da θ.

Transcript of Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf ·...

Page 1: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

ML estesaSe n non è fisso, ma piuttosto una variabile di Poisson, con media ν.

Il risultato dell’esperimento è allora: n, x1, ..., xn.

La funzione likelihood (estesa) è:

Se dalla teoria ν = ν(θ), allora la log-likelihood è

dove C representa i termini che non dipendono da θ.

Page 2: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

ML estesa (2)

ML estesa usa più informazione → errori minori per

Esempio: numero aspettato di eventi

Se ν non dipende da θ, la ML estesa dà:

Page 3: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Esempio di ML estesaDue tipi di eventi (segnale e fondo) ognuno con una pdf per x: fs(x) e fb(x).Poniamo frazione segnale = θ, numero totale di eventi aspettato = ν, totale osservato = n.

Page 4: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Esempio di ML estesa (2)

Massimizzando la likelihood per µs and µb:

Esempio Monte Carlo con esponenziale e Gaussiana:

Gli errori riflettono sia le fluttuazioni del totale sia della proporzione di segnale/fondo

Page 5: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Esempio di ML estesa: una stima non-fisicaUna fluttuazione dei dati nella regione del picco può portare a meno eventi di quanti aspettati con il solo fondo

La stima per µs in questo caso è negativa (non-fisica).

Page 6: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Esempio di ML estesa: una stima non-fisicaL’estimatore è unbiased e la stima deve comunque essere riportata perchè la media di un numero grande di stime converge al valore vero

Se si ripete l’esperimento MC molte volte si vede che stime non-fisiche sono possibili

Page 7: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

ML with binned dataOften put data into a histogram:

Hypothesis is where

If we model the data as multinomial (ntot constant),

then the log-likelihood function is:

Page 8: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

ML example with binned dataPrevious example with exponential, now put data into histogram:

Limit of zero bin width → usual unbinned ML.If ni treated as Poisson, we get extended log-likelihood:

Page 9: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Relazione tra ML e estimatori BayesianiNella statistica Bayesiana, sia θ che x sono variabili aleatorie:

Metodo Bayesiano:

Probabilità soggettiva per l’ipotesi (θ);

probabilità a priori prima dell’esperimento π(θ);si usa il teorema di Bayes per correggere la probabilità con i dati:

pdf a posteriori (pdf condizionale per θ dato x)

Page 10: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

ML ed estimatori Bayesiani (2)Bayesiani puri: p(θ | x) contiene tutte le nostre conoscenze su θ.

Bayesiani pragmatici: p(θ | x) può essere complicata,

→ riassumiamo usando un estimatore

la moda di p(θ | x) , (oppure la media)

Che cosa usiamo per π(θ)? È soggettivo!π(θ) = constante representa l’ ‘ignoranza a priori’, e in quel caso

Ma... se usiamo un parametro diverso, λ = 1/θ,e πθ(θ) è costante, allora πλ(λ) non lo è!

‘Completa ignoranza a priori’ non è ben definita!

Page 11: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Metodo dei minimi quadratiMisuriamo N valori, y1, ..., yN, independenti con distribuzione Gaussiana tale che

Siano noti i valori delle variabili x1, ..., xN e le varianze

La likelihood è

Vogliamo stimare θ, cioè fare un fit della curva ai punti

Page 12: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Metodo dei minimi quadrati (2)La log-likelihood diventa

Massimizzare la likelihood è equivalente a minimizzare

Il minimo è l’estimatore “least squares” (LS)

Spesso si minimizza il χ2 in modo numerico (MINUIT).

Page 13: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

LS with correlated measurementsIf the yi follow a multivariate Gaussian, covariance matrix V,

Then maximizing the likelihood is equivalent to minimizing

Page 14: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Example of least squares fit

Fit a polynomial of order p:

Page 15: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Varianza dell’estimatore LSCome per ML, nel caso di LS abbiamo

e quindi

ovvero con il metodo grafico coincide con prendere il valore per cui

1.0

Page 16: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Two-parameter LS fit

Page 17: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Goodness-of-fit con LSIl valore del χ2 al minimo è una misura dell’accordo dati-ipotesi

È una statistica di goodness-of-fit per verificarela forma funzionale ipotizzata λ(x; θ)N.B.: da non confondere con l’errore statistico sul fit!

Se l’ipotesi è corretta la statistica t = χ2min segue la pdf del χ2

con nd = numero di punti - numero di parametri del fit

Page 18: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Goodness-of-fit with least squares (2)The chi-square pdf has an expectation value equal to the number of degrees of freedom, so if χ2min ≈ nd the fit is ‘good’.

More generally, find the p-value:

E.g. for the previous example with 1st order polynomial (line),

whereas for the 0th order polynomial (horizontal line),

This is the probability of obtaining a χ2min as high as the onewe got, or higher, if the hypothesis is correct.

Page 19: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Goodness-of-fit vs. statistical errors

Page 20: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Goodness-of-fit vs. stat. errors (2)

Page 21: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

LS con istogrammi

Page 22: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

LS con istogrammi (2)

Page 23: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

LS con istogrammi — normalizzazione

Page 24: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

LS normalization example

Page 25: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Using LS to combine measurements

Page 26: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Combining correlated measurements with LS

Page 27: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Example: averaging two correlated measurements

Page 28: Title of slide - hep.fi.infn.ithep.fi.infn.it/ciulli/Site/Analisi_Dati_files/statistics5.pdf · Limit of zero bin width → usual unbinned ML. If n i treated as Poisson, we get extended

Negative weights in LS average