Skip to content

Draft: 1D CDFs and Low-discrepancy sampling

Reed Essick requested to merge 1d-cdf into master

This patch implements CDFs for all 1D distributions and adds support for low-discrepancy sampling via scipy.stats.qmc. Fixes #24.

To Do:

  • implement .cdf, .icdf within SamplingDistribution to check num_variates
  • implement ._cdf, ._icdf within all 1D distributions
    • base
    • eccentricity
    • location
    • mass
      • note, ButterworthNotchNPiecePowerLawMass1._icdf relies on numeric integration to build an interpolator as implemented in base.SamplingDistribution._icdf
    • matter
      • note, FixedEoSSamplingDistribution does not support _cdf or _icdf
    • spin
      • note, IsotropicUniformMagnitudeChiEffGivenAsymmetricMassRatio and IsotropicUniformMagnitudeChiEffGivenComponentMass rely on numeric integration to build an interpolator as implemented by default in base.SamplingDistribution
    • orientation
    • time
  • update tests to check cdf calculation
    • icdf is the inverse of cdf
    • add a test to make sure calls to cdf are compatible with prob by comparing cdf to _trapz_cdf
  • run all tests and make sure they pass
    • numpy
    • there are some issues with consistency in jax, but these seem to be down to the underlying numerical libraries acting oddly. I'm not going to worry about this now, as everything seems to be consistent with jax (for the most part) and everything works under numpy
  • add support for low-discrepancy sampling within EventGenerator
    • sample from ND unit cube and use icdf to transform to physical variables
    • automatically determine dimensionality from self.distributions
    • automatically check that all distributions are 1D (and have .icdf implemented)
    • make sure we support the ability to continue sampling from where we left off (do not repeat the sequence)
    • make sure we can select the type of EventGenerator when parsing from a config file
      • declare a new event generator called LowDiscrepancyEventGenerator
      • either select type of event generator via kwarg or read from config file ([general] section?)

Note, we should also do the following:

  • change the way EventGenerators store distributions, transformations, and conditionals so that we can apply them in any order (have a "tasks" attribute that stores the order in which these are performed)
  • change the observed SNR transformation into a distribution
    • provide draw probabilties, cdf, icdf, etc
    • make sure low-discrepancy sampling can talk to this
    • maybe make derived quantities (like network observed SNR) a transformation that must be applied after the distribution of individual IFO observed SNRs
  • test the impact of "mixed sampling" which uses low-discrepancy sequences for some parts of the integral but regular MC sampling for other parts
    • do we still get a performance boost from low-discrepancy sequences, or are we hosed because we have some regular MC sampling in there
Edited by Reed Essick

Merge request reports