Skip to content

Commit

Permalink
Improve conservative percentile calculation in live combining single …
Browse files Browse the repository at this point in the history
…significance fits (#5005)

* Just use percentile rather than mean in ML calculation for conservative fits

* Fix

* Use ALT

* Update bin/live/pycbc_live_combine_single_significance_fits

Co-authored-by: Thomas Dent <thomas.dent@usc.es>

---------

Co-authored-by: Thomas Dent <thomas.dent@usc.es>
  • Loading branch information
GarethCabournDavies and tdent authored Jan 17, 2025
1 parent 77c1a60 commit dd3f009
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/live/pycbc_live_combine_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,16 @@ for ifo in args.ifos:

invalphan = c[valid] / a[valid]
mean_alpha = c[valid].mean() / invalphan.mean()
cons_alpha = np.percentile(a[valid], 100 - args.conservative_percentile)
cons_alphas_out[ifo][counter] = cons_alpha
cons_count = np.percentile(
c[valid],
args.conservative_percentile
)
cons_invalphan = np.percentile(
invalphan,
args.conservative_percentile
)
# Conservative alpha estimate using percentile rather than mean
cons_alphas_out[ifo][counter] = cons_count / cons_invalphan
alphas_out[ifo][counter] = mean_alpha

# To get the count values, we need to convert to rates and back again
Expand Down

0 comments on commit dd3f009

Please sign in to comment.