Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson,...

33
Bayesian Source Detection Farhan Feroz [email protected] Cavendish Astrophysics 0 0.5 1 1.5 2 2.5 3 0 1 2 3 4 5 6 4 6 8 10 12 log-L theta phi log-L

Transcript of Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson,...

Page 1: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Bayesian Source Detection

Farhan [email protected]

Cavendish Astrophysics

0 0.5

1 1.5

2 2.5

3 0

1

2

3

4

5

6

4

6

8

10

12

log-L

theta

phi

log-L

Page 2: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Source Detection Problems in Astrophysics

Signal + NoiseSNR ~ 0.5 – 1.0

How many sources?

Feroz & Hobson (2008, MNRAS, 384, 449)

2

Page 3: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Source Detection Problems in Astrophysics

Signal (8 sources)

How many sources?

Feroz & Hobson (2008, MNRAS, 384, 449)

3

Page 4: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Probabilistic Source/Object Detection

0 0.5

1 1.5

2 2.5

3 0

1

2

3

4

5

6

4

6

8

10

12

log-L

theta

phi

log-L

Textures in CMB

• Problems in Source Detection– Identification– Quantifying Detection– Characterization

Page 5: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

• Collect a set of N data points Di (i = 1, 2, …, N), denoted collectively as data vector D.

• Propose some model (or hypothesis) H for the data, depending on a set of Mparameter θi (i = 1, 2, …, N), denoted collectively as parameter vector θ.

• Bayes’ Theorem:

• Parameter Estimation: posterior α likelihood x prior

Bayesian Parameter Estimation

Z)(π)(L)(P

)H|(P)|(P),|(P),|(P θθθ

DθθDDθ

HHH

Likelihood Prior

Evidence

Posterior

)(π)(Lα)(P θθθ

Page 6: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

• Consider two models H0 and H1

• Bayesian Evidence Z = P(D|H) = plays the central role in Bayesian Model Selection.

• Bayesian Evidence rewards model preditiveness.– Sets more stringent conditions for the inclusion of new parameters

Bayesian Model Selection

)(P)(P

ZZ

)(P)|(P)(P)|(P

)|(P)|(P

0

1

0

1

00

11

0

1

HH

HHHH

HHR

DD

DD

)(P)(P)|(P)|(P

)H|(P)|(P),|(P),|(P

DDD

DθθDDθ HHHHHH

θθθ d)(π)(L

Bayes Factor

Prior Odds

Page 7: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

1. Sample N ‘live’ points uniformly inside the initial prior space (X0 = 1) and calculate their likelihoods

2. Find the point with the lowest Li and remove it from the list of ‘live’ points

3. Increment the evidence as Z = Z + Li ( Xi-1 - Xi+1 ) / 2

4. Reduce the prior volume Xi / Xi-1 = ti where P(t) = N tN-1

5. Replace the rejected point with a new point sampled from with constraint L > Li

6. If then stop else goto 3 ZXL i max

)(

Nested Sampling: Algorithm

Page 8: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Nested Sampling: Demonstration

Egg-Box Posterior

Page 9: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Nested Sampling: Demonstration

Egg-Box Posterior

Page 10: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Multi-modal Nested Sampling (MultiNest)

• Introduced by Feroz & Hobson (2008, MNRAS, 384, 449, arXiv:0704.3704), refined by Feroz, Hobson & Bridges (2009, MNRAS, 398, 1601, arXiv:0809.3437)

Ellipsoidal Rejection Sampling

Multi-Modal DistributionUni-Modal Distribution

Page 11: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Probabilistic Models for Source Detection

Page 12: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

• Bayesian Purist Gold Standard: detect and characterize all sources in the data simultaneously ⇒ infer full parameter set θ = {Ns, p1, p2, …, pNs, q} where Ns = number of sourcespi = parameters associated with ith sourceq = parameters common to all the sources

• Allows straight-forward inclusion of prior information on number of sources, Ns.

• Complication– Length of parameter vector, θ, is variable– Requires reversible-jump MCMC (see Green, 1995, Biometrika, V. 82)– Counting degeneracy when assigning source parameters in each sample to

sources in image ⇒ at least Ns! modes

• Practical Concern: If prior on Ns remains non-zero at large Ns

– Parameter space to be explored becomes very large– Slow mixing, can be very inefficient

Bayesian Source Detection: Variable Source Number Model

Page 13: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Bayesian Source Detection: Variable Source Number Model

• 8 Gaussian sources, with variable scale and amplitude, in Gaussian noise• Analysis done with BayeSys (http://www.inference.phy.cam.ac.uk/bayesys/)

– Runtime: 17 hours CPU time

Hobson & McLachlan, 2002, astro-ph/0204457

Page 14: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Bayesian Source Detection: Fixed Source Number Model

• Poor man’s approach to Bayesian gold standard

• Consider series of models HNs, each with fixed Ns, where Ns

goes from say 0 to Nmax

– Length of parameter space is fixed for each model– Can use standard MCMC or nested sampling

• Determine preferred number of source using Bayesian model selection

Page 15: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Exoplanet Detection – HIP 5158Feroz, Balan & Hobson, 2011, arXiv:1105.1150

15

Page 16: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Bayesian Source Detection: Single Source Model

• Special case of fixed source number model, simply set Ns = 1

• Not restricted to detecting just one source in the data– Trade-off high dimensionality with multi-modality– Posterior will have numerous modes– Each corresponding to a either real or spurious source

• Fast and reliable method when sources (effects) are non-overlapping

• Use local evidences for distinguishing between real and spurious sources

Page 17: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

•• H0 = “there is no source with its centre lying in the region S”• H1 = “there is one source with its centre lying in the region S”

• For sources distributed according to Poisson distribution

RRpTP

1

s

LdXLS

Z 0001

0

1

0

1 ,)Pr()Pr(

LZR

HH s

s

Quantifying Source Detection: Single Source Model

)Pr()Pr(

)Pr()|DPr()Pr()|DPr(

)D|Pr()D|Pr(

00

11

00

11

0

1

HZHZ

HHHH

HHR

Page 18: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

MultiNest• 7 out of 8 objects identified

– missed 1 object because 2 objects are very close• runtime = 2 min on a normal desktop

Thermodynamic Integration• Solution possible only through iterative sampling (see McLachlan & Hobson, 2002)• runtime > 16 hours on a normal desktop

How Many Sources? Bayesian SolutionFeroz & Hobson, 2008, MNRAS, 384, 449, arXiv:0704.3704

Page 19: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Gravitational Lensing

19

Page 20: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

• 0.5 x 0.5 degree2, 100 gal per arcmin2 & σ = 0.3

• Concordance ΛCDM Cosmology with cluster mass & redshifts drawn from Press-Schechter mass function

• pth = 0.5

True Mass Map MaxEnt2 Reconstruction

Applications: Clusters in Weak Lensing

MultiNest Reconstruction

Feroz, Marshall & Hobson, 2008, arXiv:0810.0781

Page 21: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Clusters in Sunyaev-Zel’dovich (SZ)

• Distortion of CMB by hot intra-cluster electrons through inverse Compton scattering

21

Page 22: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Clusters in Sunyaev Zel’dovich (SZ)

background + 3 radio sources background + 3 radio sources+ galaxy cluster

galaxy cluster

Galaxy cluster (and radio sources) in interferometric SZ data

Feroz et al., 2009, arXiv:0811.1199

2 de

gree

2 degree

Page 23: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Clusters in Sunyaev Zel’dovich (SZ)

Bayesian Model ComparisonR = P(cluster | data)/P(no cluster | data)

background + 3 radio sources background + 3 radio sources+ galaxy cluster

galaxy cluster

R = 0.35 R ~ 1033

Galaxy cluster (and radio sources) in interferometric SZ data

Feroz et al., 2009, arXiv:0811.1199

2 de

gree

2 degree

Page 24: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Clusters in SZ – Parameter Constraints

−20 0 20 40

−20 0 20

500 1000

0.5 1 1.5

1 2 3

x 1014

0 10 20T/keV

y 0/arc

sec

−20 0 20 40

−200

20

r core

/h−

1 kpc

−20 0 20 40

500

1000

β

−20 0 20 40

0.5

1

1.5

Mga

s/h−

2 MS

un

−20 0 20 40

1

2

3x 10

14

x0/arcsec

T/k

eV

−20 0 20 400

10

20

−20 0 20

500

1000

−20 0 20

0.5

1

1.5

−20 0 20

1

2

3x 10

14

y0/arcsec

−20 0 200

10

20

500 1000

0.5

1

1.5

500 1000

1

2

3x 10

14

rcore

/h−1kpc500 1000

0

10

20

0.5 1 1.5

1

2

3x 10

14

β0.5 1 1.5

0

10

20

Mgas

/h−2MSun

1 2 3

x 1014

0

10

20

Feroz et al., 2009, arXiv:0811.1199

Page 25: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

First AMI Blind Cluster: AMI-CL J0300+2613arXiv:1012.4441, 1305.6655

25

Page 26: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Planck SZ Challenge II – Results with MultiNest

• 50 x 106 pixels, ~ 1000 recovered clusters, ~ 3 CPU hours

Page 27: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Bayesian Source Detection: Iterative Approach

• Can be used when single-source model is not valid– Overlapping/correlated (in terms of data) sources

• Fit n-source model and determine the distribution of residual data–

• Analyse residual data and compare between:– H0 = “there is no additional source, residual

data is due to noise only”– H1 = “there is an additional source present”

• If H1 is preferred then fit for n+1 sources and repeat the procedure

• Example: Extra-solar planet detection– See Feroz, Balan & Hobson, 2011, arXiv:1012.5129

Page 28: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Exoplanet Detection

pN

pppppipji efKVjtv

1, )sin()sin(),(

where

Vj = systematic velocity with reference to jth observatoryKp = velocity semi-amplitude of the pth planetωp = longitude of periastron of the pth planetfi,p, = true anomaly of the pth planetep = orbital eccentricity of the pth planetep = orbital period of the pth planetep = fraction of an orbit of the pth planet, prior to the start of data taking at which

periastron occurred

Page 29: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Exoplanet Detection – HD 10180Feroz, Balan & Hobson, 2011, arXiv:1012.5129

Page 30: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Applications: Exoplanet Detection – GJ 667C

• Claims of up to 7 planets, with 3 super-Earths inside the habitable zone (arXiv:1306.6074)

• Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more than 3 planets (arXiv:1307.6984)

Feroz & Hobson, 2013, arXiv:1307.6984

Log-evidence values for residual data (after detection of Np planets) favouring 1-planet model over 0-planet model. DCCF and DTERRA are the radial velocity data-sets obtained using CCF and TERRA data reduction methods respectively.

Top panel shows the observed radial velocity data. Bottom panel shows the mean fitted radial velocity curve overlaid on the observed data.

Page 31: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

• H0 = “there is no source with its centre lying in the region S”• H1 = “there is one source with its centre lying in the region S”

• Expected number of sources

• Expected number of true positives

• Expected number of false positives

• Expected completeness

• Expected purity

)1/( RRpTP

)Pr()Pr(

)Pr()|DPr()Pr()|DPr(

)D|Pr()D|Pr(

00

11

00

11

0

1

HZHZ

HHHH

HHR

Purity, Completeness & Threshold Probability

N

iiTPtot pN

1,

ˆ

N

ppiiTPTP

thiTP

pN,,1

N

ppiiTPFP

thiTP

pN,,1

, )1(ˆ

totTP NN ˆ/ˆˆ

)ˆˆ/(ˆˆ FPTPTP NNN

Page 32: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Purity, Completeness & Threshold Probability

Probabilistic classification of type-Ia Supernovae using Neural Network

Karpenka, Feroz & Hobson, 2012, arXiv:1208.1264

Page 33: Cavendish Astrophysics - WordPress.com · 2014. 7. 15. · • Bayesian analysis by Feroz & Hobson, with correlated ‘red’ noise and iterative approach found evidence for no more

Conclusions

• Bayesian statistics provide rigorous approach to astrophysical source detection– Use Bayesian model selection to distinguish real sources from spurious ones

• Efficient and robust source detection can be done using nested sampling– MultiNest allows sampling from multimodal/degenerate posteriors– local and global evidences and parameter constraints– typically ~ 100 times more efficient than standard MCMC

• Probabilistic source detection removes arbitrariness in choice of detection criterion

– allows calculation of expected purity and completeness

• MultiNest publicly available– with SuperBayeS for SUSY phenomenology (www.superbayes.org)– as a standalone inference engine (www.mrao.cam.ac.uk/software/multinest)