Download presentation

Presentation is loading. Please wait.

Published byMaxim Sanders Modified over 2 years ago

1
**Brief Explanation of MCMC implementation in lalsuite**

Hyung Won Lee, Inje University with Chunglee Kim(KHU&KISTI) and Jeongcho Kim(Inje) 6 Feb. 2015, KAGRA f2f meeting, Hongo Campus 11th KAGRA f2f Meeting, 4-7 February 2015

2
**11th KAGRA f2f Meeting, 4-7 February 2015**

Contents Motivation CBC gravitational wave sources Parameter Estimation with Bayesian Inference Implementation in lalsuite Suggestions for KAGALI Discussions 11th KAGRA f2f Meeting, 4-7 February 2015

3
**11th KAGRA f2f Meeting, 4-7 February 2015**

Motivation How does it work parameter estimation Understanding Bayesian inference/MCMC Which physical parameters How it was implemented in lalsuite How it could be implemented for KAGALI Get practical work out items 11th KAGRA f2f Meeting, 4-7 February 2015

4
**11th KAGRA f2f Meeting, 4-7 February 2015**

CBC GW sources Neutron star(NS) + Black hole(BH) binary Mass range : 1 𝑀 ⨀ ~ 𝑀 ⨀ Frequency range : 1𝐻𝑧 ~ 10𝑘𝐻𝑧 Waveform : Inspiral, Merger, Ringdown 11th KAGRA f2f Meeting, 4-7 February 2015

5
**CBC Inspiral GW Waveform**

11th KAGRA f2f Meeting, 4-7 February 2015

6
**11th KAGRA f2f Meeting, 4-7 February 2015**

Time Domain Template TaylorT1, 2, 3, 4 PadeT1 : P-approximation EOB : effective one body SpinTaylorT1, 2, 3, 4, 5 IMRPhenomA, B, C TaylorT2 can deal with CBC inspirals when there is a BH spin that is aligned to the orbital angular momentum. SpinTaylorT4 is one of the most comprehensive inspiral waveform model used by the LIGO-Virgo collaboration. This can deal with precessing CBC inspirals with two spins. 11th KAGRA f2f Meeting, 4-7 February 2015

7
**Frequency Domain Template**

TaylorF1 TaylorF2 : standard for detection pipeline, SPA approximation TaylorF2Amp : include higher harmonics due to amplitude corrections up to 2.5 pN PadeF1 BCV BCVSpin 11th KAGRA f2f Meeting, 4-7 February 2015

8
**11th KAGRA f2f Meeting, 4-7 February 2015**

TaylorF2Amp Waveform Arun et.al., PRD79, (2009) Amplitude corrections up to n=5 (2.5pN) 11th KAGRA f2f Meeting, 4-7 February 2015

9
**11th KAGRA f2f Meeting, 4-7 February 2015**

SPA phase factor + Phase corrections up to 3.5PN (standard in LAL) 11th KAGRA f2f Meeting, 4-7 February 2015

10
**SPA phase factor(Code)**

11th KAGRA f2f Meeting, 4-7 February 2015

11
**11th KAGRA f2f Meeting, 4-7 February 2015**

Physical Parameters Individual masses Luminosity distance Inclination angle Coalescence phase Coalescence time at geocenter Declination Right ascension Polarization Spins, quadrupole deformations 11th KAGRA f2f Meeting, 4-7 February 2015

12
**Parameter Estimation with Bayesian inference**

℘ 𝜃 𝑥 = ℘ 𝜃, 𝑥 ℘ 𝑥 = ℘(𝑥|𝜃)℘ 𝜃 ℘(𝑥|𝜃)℘ 𝜃 𝑑𝜃 ℘ 𝜃,𝑥 =℘ 𝑥 𝜃 ℘ 𝜃 =℘ 𝜃 𝑥 ℘ 𝑥 𝜃 : unobservable model parameters 𝑥 : observable data ℘ 𝜃,𝑥 : Joint probability observing data 𝑥 with model parameter 𝜃 ℘ 𝑥 𝜃 ∝𝐿𝑖𝑘𝑒𝑙𝑖ℎ𝑜𝑜𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 Metropolis-Hasting Algorithm, ~ samples 11th KAGRA f2f Meeting, 4-7 February 2015

13
**Parameter Estimation with Bayesian inference**

MCMC Samples PTMCMCOutput.00 PTMCMCOutput.nn Post Process cbcByesPostProc.py 11th KAGRA f2f Meeting, 4-7 February 2015

14
**11th KAGRA f2f Meeting, 4-7 February 2015**

Overlap Calculation Template Data 𝜌=4ℜ 0 +∞ ℎ (𝑓) 𝑠 ∗ (𝑓) 𝑆 𝑛 (𝑓) 𝑑𝑓 𝑆𝑁𝑅 2 =4 0 +∞ ℎ (𝑓) 2 𝑆 𝑛 (𝑓) 𝑑𝑓 Network SNR 𝑆𝑁𝑅 2 = 𝑖=1 𝑁 𝑆𝑁𝑅 𝑖 2 One-sided power spectral density of noise 11th KAGRA f2f Meeting, 4-7 February 2015

15
**Likelihood Calculation**

ℒ(𝑠|𝜃)∝exp −2 0 ∞ 𝑠 𝑓 − ℎ (𝜃,𝑓) 2 𝑆 𝑛 (𝑓) 𝑑𝑓 11th KAGRA f2f Meeting, 4-7 February 2015

16
**11th KAGRA f2f Meeting, 4-7 February 2015**

Various Overlaps Unnormalized 𝜌=4ℜ 0 +∞ ℎ 1 (𝑓) ℎ 2 ∗ (𝑓) 𝑆 𝑛 (𝑓) 𝑑𝑓 Normalized 𝜌 𝑘 =4ℜ 0 +∞ ℎ 𝑘 (𝑓) ℎ 𝑘 ∗ (𝑓) 𝑆 𝑛 (𝑓) 𝑑𝑓 𝜌 𝑁 = 𝜌 𝜌 1 𝜌 2 11th KAGRA f2f Meeting, 4-7 February 2015

17
**11th KAGRA f2f Meeting, 4-7 February 2015**

MCMC Process Accept next state with probability 𝑟= ℘(𝑥| 𝜃 2 ) 1/𝑇 ℘ 𝜃 ℘(𝑥| 𝜃 1 ) 1/𝑇 ℘ 𝜃 1 Metropolis-Hasting smapling 11th KAGRA f2f Meeting, 4-7 February 2015

18
**11th KAGRA f2f Meeting, 4-7 February 2015**

Parallel Tempering Use few chains with different temperature Use likelihood ℒ 𝑠 𝜃 1 𝑇 , 𝑇>1 Improve convergence Improve mixing The higher temperature, the smoother distribution 𝑇>1 11th KAGRA f2f Meeting, 4-7 February 2015

19
**Implementation in lalsuite**

LAL MCMC Pipeline Directory structure of lalsuite Basic entities of LALSuite LAL applications Likelihood, proposal and prior functions Simulation related functions and waveforms Post Processing python script 11th KAGRA f2f Meeting, 4-7 February 2015

20
**11th KAGRA f2f Meeting, 4-7 February 2015**

LAL MCMC Pipeline Start Initialization MPI synchronize PT MCMC Clearance End 11th KAGRA f2f Meeting, 4-7 February 2015

21
**LALInferenceRunState**

ProcessParamsTable *commandLine; /** A ProcessParamsTable with command line arguments */ LALInferenceInitModelFunction initModel; /** A function that returns a new set of variables for the model */ LALInferenceAlgorithm algorithm; /** The algorithm function */ LALInferenceEvolveOneStepFunction evolve; /** The algorithm's single iteration function */ LALInferencePriorFunction prior; /** The prior for the parameters */ LALInferenceCubeToPriorFunction CubeToPrior; /** MultiNest prior for the parameters */ LALInferenceLikelihoodFunction likelihood; /** The likelihood function */ LALInferenceProposalFunction proposal; /** The proposal function */ LALInferenceLogFunction logsample; /** Log sample, i.e. to disk */ LALInferenceTemplateFunction templt; /** The template generation function */ … more 11th KAGRA f2f Meeting, 4-7 February 2015

22
**LAL MCMC pipeline in a glance**

MCMC main main (start) parseCommandLine Options Initialize Rusnstate initializeMCMC addVariables InitializeCBC Initialize likelihood Initialize MCMC state MPI_Barrier wait synchronization runState ->alogorithm main MCMC routine PTMCMCAlgorithm Deinitialize Clean resources end 11th KAGRA f2f Meeting, 4-7 February 2015

23
**PTMCMCAlgorithm No Yes Receive runComplete state from root process**

(start) PTMCMCAlgorithm MPI setup, runComplete = 0 Ladder setup for parallel tempering Ladder[i] = Min ( 𝑀𝑎𝑥 𝑀𝑖𝑛 ) 𝑖 𝑛𝐶ℎ𝑎𝑖𝑛−1 Set temperature for this chain if(MPI_rank == 0) output Anealing related setup Debug related setup Receive runComplete state from root process If(MPI_rank≠0) non-blocking receive MPI_Barrier No !runComplete Yes Ladder update if need Calculate ACL(autocorrelation length) If( i>Neff) runComplete=1 Anealing post-anealing runState ->evolve OneStep MCMC routine PTMCMCOneStep Save for every Nskip step If(i>Niter) runComplete=1 If(MPI_rank==0 && runComplete==1) send run complete value to all other parallel process MPI_Barrier XLALFree() resource free end 11th KAGRA f2f Meeting, 4-7 February 2015

24
**LALInferenceCyclicProposal**

PTMCMCOneStep (start) PTMCMCOneStep MPI setup runState ->proposal LALInferenceCyclicProposal Compute prior & likelihood determine acceptance probability Accept end LALInferenceCyclicProposal LALInferenceCyclicProposal (start) LALInferenceProposalFunction *cycle = NULL Must have cycle array and cycle array length in propArgs (cycle[i])(runState, proposedParams) Call proposal end 11th KAGRA f2f Meeting, 4-7 February 2015

25
**LALInferenceUndecomposed FreqDomainLogLikelihood()**

Mcmc main PTMCMCAlgorithm() PTMCMCOneStep() LALInferenceUndecomposed FreqDomainLogLikelihood() LALInferenceTemplate XLALSimInspiralChooseWaveform() XLALSimInspiralChooseFD WaveformFromCache() XLALSimInspiralChooseFDWaveform() XLALSimInspiralTaylorF2Amp() Call TaylorF2Amp in MCMC 11th KAGRA f2f Meeting, 4-7 February 2015

26
**LAL parameter estimation(PE) pipeline**

1. waveform library [LALSimulation] 2. PE library [LALInference & LALapps] 3. basic libraries are scattered, but most basic ones are in [LAL] 11th KAGRA f2f Meeting, 4-7 February 2015

27
**waveform library [LALSimulation]**

LALSimulation/src/ .. LALSimInspiral.h -> protocol definitions XLALSimInspiralF2AmpPlus() -> ℎ + XLALSimInspiralF2AmpCross() -> ℎ × LALSimInspiral.c -> XLALSimInspiralChooseFDWaveform() call a waveform model XLALSimInspiralF2AmpPlus() XLALSimInspiralF2AmpCross() LALSimInspiralTaylorF2Amp.c -> example of a FD waveform LALSimInspiralWaveformCache.c -> XLALSimInspiralChooseFDWaveformFromCache() call XLALSimInspitalChooseFDWaveform() 11th KAGRA f2f Meeting, 4-7 February 2015

28
**PE library [LALInference]**

LALInference/src/.. LALInference.h LALInferenceReadData.c LALInferecneTemplate.c LALInference.h -> collections of structures typedef tagLALInferenceRunState signal/parameters { ∙∙∙ -> Structure to contain inference run state } LALInferenceRunState; typedef struct tagLALInferenceIFOData data for detector including sensitivity ∙∙∙ -> Structure to contain IFOdata } LALInferenceIFOData; 11th KAGRA f2f Meeting, 4-7 February 2015

29
**PE library [LALInference]**

LALInference/src/.. LALInference.h LALInferenceReadData.c LALInferecneTemplate.c reads injection parameters from an xml file reads PSD for each detector reads data for each detector generate noise for each detector LALInferenceIFOData *LALInferenceReadData(ProcessParamsTable *commandLine) -> Read in the data and store it in a LALInferenceIFOData structure 11th KAGRA f2f Meeting, 4-7 February 2015

30
**PE library [LALInference]**

LALInference/src/.. LALInference.h LALInferenceReadData.c LALInferecneTemplate.c - Jump around parameter space 𝜆 𝑗 generate template signal LALInferenceTemplate.c -> template calls to LAL template functions LALInferenceTemplateXLALSimInspiralChooseWaveform() Wrapper for LALSimulation waveforms : XLALSimInspiralChooseFDWaveform() XLALSimInspiralChooseTDWaveform() - Parameters of non-spinning waveform in LALInferencePrior.c 11th KAGRA f2f Meeting, 4-7 February 2015

31
**PE library [LALInference]**

LALInference/src/.. LALInference.h LALInferenceLikelihood.c LALInferecneTemplate.c LALInferenceLikelihood.c -> Bayesian Followup likelihood function LALInferenceUndeomposedFreqDomainLogLikelihood() Required (`currentParams') parameters are: "rightascension" (REAL8, radian, 0 <= RA <= 2pi) "declination" (REAL8, radian, -pi/2 <= dec <=pi/2) "polarisation” (REAL8, radian, 0 <= psi <= pi) "time" (REAL8, GPS sec.) 11th KAGRA f2f Meeting, 4-7 February 2015

32
**11th KAGRA f2f Meeting, 4-7 February 2015**

PE library [LALapps] LALapps/src/inspiral/posterior/.. LALInferenceMCMC.c LALInferenceMCMCSampler.c LALInferenceMCMC.c -> Bayesian Followup function testing site main() 1. Set up structures for MCMC 2. Choose the likelihood function -> ex) student-T , Undecomposed. 3. Call MCMC algorithm -> sampling posterior function 11th KAGRA f2f Meeting, 4-7 February 2015

33
**11th KAGRA f2f Meeting, 4-7 February 2015**

PE library [LALapps] LALapps/src/inspiral/posterior/.. LALInferenceMCMC.c LALInferenceMCMCSampler.c LALInferenceMCMCSampler.c -> Bayesian Followup, MCMC algorithm PTMCMCAlgorithm() PTMCMCOneStep() -> Metropolis-Hasting algorithm implemented 11th KAGRA f2f Meeting, 4-7 February 2015

34
**basic functions, libraries**

lal/FrequencySeries.h -> dataStructure lal/LALDatatypes.h ->Primitive datatypes Aggregate datatypes Store arbitrarily large sets or collections of primitive datatypes. aggregate datatypes are defines Structured datatypes : embed primitive and aggregate datatypes inside structures that define their physical meaning. lal/LALConstants.h -> physical constants, Pi, h, G, etc. 11th KAGRA f2f Meeting, 4-7 February 2015

35
**Suggestions for KAGALI**

Directory structure by functionality MCMC chain generation Waveform generation Input output functions Notes to consider Waveform function call parameter Post process language Python Haskell C and gnuplot 11th KAGRA f2f Meeting, 4-7 February 2015

36
**11th KAGRA f2f Meeting, 4-7 February 2015**

Discussions Bayesian Parameter Estimation Optimal library structure How to post process? All from scratch? Collaboration meeting from 9 to 11 February at Inje University 11th KAGRA f2f Meeting, 4-7 February 2015

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google