calc_likelihoods_2D

zdm.iteration.calc_likelihoods_2D(grid, survey, doplot=False, norm=True, psnr=True, printit=False, Pn=False, pNreps=True, ptauw=False, pwb=False, dolist=0, verbose=False, grid_type=0)[source]

Calculates 2D likelihoods using observed DM,z values

grid: the grid object calculated from survey

survey: survey object containing the observed z,DM values

doplot: will generate a plot of z,DM values

psnr:

True: calculate probability of observing each FRB at the observed SNR False: do not calculate this

Pn:

True: calculate probability of observing N FRBs False: do not calculate this

pNreps:

True: calculate probability that each repeater detects the given number of bursts False: do not calculate this

ptauw:

True: calculate probability of intrinsic width and scattering given total width False: do not calculate this

pwb:

True: calculate probability of specific width and beam values, and psnr | bw False: do not calculate this; simply sum psnr over all possible p(b,w)

dolist:

0: returns total log10 likelihood llsum only [float] 1: also returns a dict of individual statistical contributions to log-likelihood 2: also returns the above for every FRB individually Structure of llsum and longlist:

[“pzDM”][“pDM”] [“pN”] [“Nexpected”] (only for [“ptauw”]

[“pbar”] [“piw”] [“ptau”] [“w_indices”]

[“pbw”]

[“pb”] [“pw”] [“pbgw”] [“pwgb”] [“pbw”] [“psnr_gbw”] [“psnrbw”]

lllist: <Nfrbs> longlist [list of lists]:

Pn: float zDM: PzDM zDM extras: P(z) P(DM), P(DM|z), P(z|DM) ptauw: p(tau|wtot), p(wtot), p(snr|wtot) psnr: p_snr (over all beams/widths) pwb: p(snr|b,w,z,dm), p(snr,b,w|z,DM), p(b|zDM), p(w|zDM), p(b|w,zDM), p(w|b,zDM), p(wb|zDM)

else: returns nothing (actually quite useful behaviour!)

norm:

True: calculates p(z,DM | FRB detected) False: calculates p(detecting an FRB with z,DM). Meaningless unless

some sensible normalisation has already been applied to the grid.

grid_type:

0: normal zdm grid 1: assumes the grid passed is a repeat_grid.zdm_repeat_grid object and calculates likelihood for repeaters 2: assumes the grid passed is a repeat_grid.zdm_repeat_grid object and calculates likelihood for single bursts