analysis of statistical algorithms for the comparison of data … · 2007. 10. 31. · gof-tests...

20
GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases Analysis of Statistical Algorithms for the Comparison of Data Distributions in Physics Experiments Anton Lechner 1 , Andreas Pfeiffer 1 , Maria Grazia Pia 2 and Alberto Ribon 1 1 CERN, Geneva, Switzerland 2 INFN Genova, Genova, Italy 1st November 2007 Anton Lechner Analysis of Statistical Algorithms

Upload: others

Post on 13-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Analysis of Statistical Algorithms for theComparison of Data Distributions in Physics

Experiments

Anton Lechner1, Andreas Pfeiffer1, Maria Grazia Pia2 andAlberto Ribon1

1CERN, Geneva, Switzerland

2INFN Genova, Genova, Italy

1st November 2007

Anton Lechner Analysis of Statistical Algorithms

Page 2: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

1 GoF-Tests (and the Statistical Toolkit)

2 Pseudo-Experiments

3 Physical use casesProton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Anton Lechner Analysis of Statistical Algorithms

Page 3: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

1 GoF-Tests (and the Statistical Toolkit)

2 Pseudo-Experiments

3 Physical use casesProton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Anton Lechner Analysis of Statistical Algorithms

Page 4: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Statistical comparison of data

Simulation data vs calorimetric results, measured spectra vs theoretical functions,...⇒ Physics use cases involving the comparison of data sets are d iversified

How to compare?

Distribution A Distribution B

⇒ Goodness of Fit tests can be applied

0 0.5

1 1.5

2 2.5

3 3.5

4

0 0.1 0.2 0.3 0.4 0.5 0

0.5 1

1.5 2

2.5 3

3.5 4

0 0.1 0.2 0.3 0.4 0.5

Anton Lechner Analysis of Statistical Algorithms

Page 5: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Goodness of Fit (GoF) tests

Provide a measure for the compatibility of

1 a data sample with a theoretical distribution (one-sampleproblem )

2 two different data samples deriving from the same theoreticaldistribution (two-sample problem )

A variety of GoF-tests exists: χ2, Anderson Darling, Tiku,...

But, is a particular test

applicable to the considered physics use case?capable of identifying certain characteristics?

Relative power of several GoF tests was examined

Focus on specific issues in physics use casesFirst results available

Anton Lechner Analysis of Statistical Algorithms

Page 6: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Aims of the study

Evaluating the relative perfomance of tests for certain physicsscenarios

Fluctuations, outliers, background spectrum,... considered

Providing guidlines for practical applications

Theoretical results presented at NSS 2006, but not close tophysics use cases

Filling partly the gap of information in this domain

No extensive hints for physics use cases available yet inliteratureNovel approach

Anton Lechner Analysis of Statistical Algorithms

Page 7: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Power Tests: Tools

Analysis of statistical algorithms performed by employing the“Statistical Toolkit”

HEP Statistics Project: Statistical Toolkit

Open source software toolkit (C++) for statistical data analysis

Comparison of binned/unbinned data sets possible

Various Goodness-of-Fit (GoF) tests included

User layers for AIDA-compliant analysis systems and ROOT

Reference publication

G.A.P. Cirrone et al, A Goodness-of-Fit Statistical Toolkit,IEEE TNS, Vol 51, Issue 5, p 1056-63 (2004)B. Mascialino et al, New Developments of theGoodness-of-Fit Statistical Toolkit, IEEE TNS, Vol 53, Issue6, p 3834-41 (2006)

Anton Lechner Analysis of Statistical Algorithms

Page 8: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

GoF-Tests in the Statistical Toolkit

Comprehensive collection of GoF tests (see below)

Hardly any other tool offers a comparable spectrum of tests

Statistical Toolkit enables an extensive power study

Tests for binned data sets Tests for unbinned data setsAnderson-Darling (AD) Anderson-Darling (AD)Anderson-Darling approximated Anderson-Darling approximatedχ

2 -χ

2 (Incomplete Gamma function) -χ

2 (Gamma function) -Fisz-Cramer von Mises (CvM) Fisz-Cramer von Mises (CvM)- Girone- Goodman- Kolmogorov-Smirnov (KS)Tiku Tiku- Watson- Weighted Cramer von Mises- Weighted Kolmogorov-Smirnov

(AD or Buning weighting function)

Anton Lechner Analysis of Statistical Algorithms

Page 9: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

1 GoF-Tests (and the Statistical Toolkit)

2 Pseudo-Experiments

3 Physical use casesProton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Anton Lechner Analysis of Statistical Algorithms

Page 10: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Power estimation of GoF-tests: Method

Reference distribution

Experim. distribution

RandomSample

GoFtest

Pseudo-experiment:

A distribution israndomly drawn fromA) discrete distributionsby sampling accordingto the relative errorB) a function

Ensembles of Pseudo-experiments

Large number of pseudo-experiments ⇒

GoF-tests characterised by their distribution of p-values

# Pseudo-exp. with p-value < ( 1 - CL)# Pseudo-exp.Power =

CL = Confidence Level(here: CL = 0.9)

Anton Lechner Analysis of Statistical Algorithms

Page 11: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

1 GoF-Tests (and the Statistical Toolkit)

2 Pseudo-Experiments

3 Physical use casesProton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Anton Lechner Analysis of Statistical Algorithms

Page 12: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Proton Bragg peak: Scale-location problem

Proton Bragg peak:Scale-location problem

Are the GoF-Tests sensitive toshifts of the peak position?

Are the GoF-Tests sensitive tovariations in the peak height?

(only binned tests presented)

0

20

40

60

80

100

120

0 20 40 60 80 100 120 140 160

En

erg

y D

ep

osit

ion

in

wate

r [a

.u.]

Bin number

Reference

Pseudoexperiment A

Pseudoexperiment B

Anton Lechner Analysis of Statistical Algorithms

Page 13: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Performance of tests for small relative shiftsand deviations in the peak height:

AD, CvM and Tiku: fast rejection ofhypothesis that both distributionsderive from the same parent distr.

AD shows the most sensitive response

χ2 reacts much slowlier than the other tests

0.1/0

0.05

0.0 0 0.2 0.4 0.6 0.8 1

p-value

χ2, fpeak = 1

No

rmalized

Dis

trib

uti

on

0/0.1

0.05

Cramer von Mises, fpeak = 1

No

rmalized

Dis

trib

uti

on

0/0.1

0.05

Anderson Darling, fpeak = 1

No

rmalized

Dis

trib

uti

on

0.1

0.05

0/0.1

Tiku, fpeak = 1

No

rmalized

Dis

trib

uti

on

Shift: 1 bin 2 bins 3 bins 4 bins 5 bins

0

0.2

0.4

0.6

0.8

1

432

Bin shift

fpeak = Scaling factor of peak height

Fra

cti

on

of

p-v

alu

es <

(1 -

CL

)

No

rmalized

Dis

trib

uti

on

fpeak=1.05

5/2435/2

Bin shift

fpeak = Scaling factor of peak height

Fra

cti

on

of

p-v

alu

es <

(1 -

CL

)

No

rmalized

Dis

trib

uti

on

fpeak=1.0

543

Bin shift

fpeak = Scaling factor of peak height

Fra

cti

on

of

p-v

alu

es <

(1 -

CL

)

No

rmalized

Dis

trib

uti

on

fpeak=0.95

GoF-Test AD CvM Tiku

Anton Lechner Analysis of Statistical Algorithms

Page 14: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Real physics application

Geant4 validation process

Simulation of protonenergy deposition in water

Various physics modelsinvestigated

Results compared toexperimental data

Performance of physic modelsevaluated w.r.t. the agreementwith the experiment⇒ GoF tests applied

Findings of power study areof great importance how tointerpret the results

0

0.02

0.04

0.06

0.08

0.1

5 10 15 20 25 30

En

erg

y D

ep

os

itio

n [

a.u

.]

Depth [mm]

Sim.: Electromagn. processes +

elastic scattering +

inel. hadronic processes

Experiment

Geant4

Anton Lechner Analysis of Statistical Algorithms

Page 15: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Fluorescence data: Fluctuations and outliers

Case 1: FluctuationsAre the GoF-Tests sensitive tofluctuations?

Are the curves considered asbeing from the same parentdistribution in case of largefluctuations?

Case 2: OutliersAssuming small fluctuations in thedata sample, are outliers recognized?

0

200

400

600

800

1000

0 10 20 30 40 50 60 70 80

Tra

nsit

ion

En

erg

y K

-L2 [

10

1keV

]

Z

Reference

Pseudoexperiment (Rel. Err: 4%)

Pseudoexperiment (Rel. Err: 8%)

0

200

400

600

800

1000

0 10 20 30 40 50 60 70 80

Tra

nsit

ion

En

erg

y K

-L2 [

10

1keV

]

Z

Reference

Pseudoexperiment (with outliers)

Anton Lechner Analysis of Statistical Algorithms

Page 16: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Case 1: FluctuationsPerformance of tests for relativeerrors from 3% to 10% in data sample:

GoF-Tests for unbinned distributionsNOT sensitive to fluctuations:p-values mostly close to 1 (not shown)

Binned comparison: Similar behaviour ofAD, CvM and Tiku (see plots)

0

0.2

0.4

0.6

0.8

1

3 4 5 6 7 8 9 10

Fra

cti

on

of

p-v

alu

es <

(1 -

CL

)

Fluctuations: Relative Error in data sample [%]

GoF-Test (Binned Distributions)

χ2

Anderson Darling

Cramer Von Mises

Tiku

6.4e-05

0.00032

0.0016

0.008

0.04

0 0.2 0.4 0.6 0.8 1

No

rmalized

Dis

trib

uti

on

p-value

Cramer von Mises GoF Test

Fluctuations (Rel. Error) 4% 6% 8% 10%

6.4e-05

0.00032

0.0016

0.008

0.04

0.2

1

0 0.2 0.4 0.6 0.8 1

No

rmalized

Dis

trib

uti

on

p-value

Chi2 GoF Test

Fluctuations (Rel. Error) 4% 6% 8% 10%

χ2 most sensitive test

at larger fluctuations!

Anton Lechner Analysis of Statistical Algorithms

Page 17: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Case 2: Outliers Performance of tests for increasing numbersand errors of outliers:

Unbinned comparison: Again no sensitivityBinned tests: AD, CvM, Tiku similar (only AD shown)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

25.020.0

15.010.0

5.0

25

20

15

10

0

0.2

0.4

0.6

0.8

1

f ou

tlie

rs =

Fra

cti

on

of

sa

mp

le p

oin

ts w

hic

h a

re o

utl

iers

Eo

utl

iers

= R

ela

tiv

e e

rro

r o

f o

utl

iers

Anderson Darling

foutliers

Eoutliers

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

25.020.0

15.010.0

5.0

25

20

15

10

0

0.2

0.4

0.6

0.8

1

f ou

tlie

rs =

Fra

cti

on

of

sa

mp

le p

oin

ts w

hic

h a

re o

utl

iers

Eo

utl

iers

= R

ela

tiv

e e

rro

r o

f o

utl

iers

Anderson Darling χ2

foutliers

Eoutliers

0

0.2

0.4

0.6

0.8

1

0 0.05 0.1 0.15 0.2 0.25

Fra

cti

on

of

p-v

alu

es

< (

1 -

CL

)

foutliers

f ou

tlie

rs =

Fra

cti

on

of

sa

mp

le p

oin

ts w

hic

h a

re o

utl

iers

Eo

utl

iers

= R

ela

tiv

e e

rro

r o

f o

utl

iers

Anderson Darling χ2

Rel. error of outliers 10%

25%

0

0.2

0.4

0.6

0.8

1

0 0.05 0.1 0.15 0.2 0.25

Fra

cti

on

of

p-v

alu

es

< (

1 -

CL

)

foutliers

f ou

tlie

rs =

Fra

cti

on

of

sa

mp

le p

oin

ts w

hic

h a

re o

utl

iers

Eo

utl

iers

= R

ela

tiv

e e

rro

r o

f o

utl

iers

Anderson Darling χ2

Rel. error of outliers 10%

25%

AD most sensitive testfor smaller outliers

χ2 most sensit. test

for larger outliers

Anton Lechner Analysis of Statistical Algorithms

Page 18: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Signal over exponential background

Gaussian signal on top of anexponentially decreasingbackground spectrum

Are the GoF-tests capable ofidentifying the differences inthe parent distributions?

How is the sensitivity regardingvarying sizes and sigmas ofthe signal?

(only unbinned tests presented) 0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

y

x

Reference

Pseudoexperiment A

Pseudoexperiment B

Anton Lechner Analysis of Statistical Algorithms

Page 19: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Performance of tests for increasing sizeand sigma of the Gaussian signal:

All considered tests recognize thesignal, but with varying sensitivity

KS and Watson show the most sensitivebehaviour(Watson hardly used in physics analysis!)

AD responses slowlier than all other tests 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.40.3

0.20.1

0.4

0.3

0.2

0.1

0

0.2

0.4

0.6

0.8

1 Anderson Darling

Size factor

Sigma

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.40.3

0.20.1

0.4

0.3

0.2

0.1

0

0.2

0.4

0.6

0.8

1

Anderson Darling

Watson

Size factor

Sigma 0

20

40

60

80

100

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4

Fra

cti

on

of

p-v

alu

es

< 0

.1

Sigma

Anderson Darling

Watson Size factor = 0.2

GoF-tests Anderson Darling

Kolmog. Smirnov

Tiku

Watson

Cramer Von Mises

Anton Lechner Analysis of Statistical Algorithms

Page 20: Analysis of Statistical Algorithms for the Comparison of Data … · 2007. 10. 31. · GoF-Tests (and the Statistical Toolkit) Pseudo-Experiments Physical use cases 1 GoF-Tests (and

GoF-Tests (and the Statistical Toolkit)Pseudo-Experiments

Physical use cases

Proton Bragg peak: Scale-location problemFluorescence data: Fluctuations and outliersSignal over exponential background

Summary

A power study of GoF tests was performed

Examines a range of GoF tests (Statistical Toolkit)

Concentrates on practical aspects

Reveals varying sensitivity of GoF tests for differentscenarios

Gives hints for usage in physics analysis

Due to lack of time, only few results shown ⇒

Publication with more extensive analysis in preparation

Not much available yet in literature

Anton Lechner Analysis of Statistical Algorithms