Draft: 1D CDFs and Low-discrepancy sampling
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
withinSamplingDistribution
to checknum_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 inbase.SamplingDistribution._icdf
-
note,
-
matter
-
note,
FixedEoSSamplingDistribution
does not support_cdf
or_icdf
-
note,
-
spin
-
note,
IsotropicUniformMagnitudeChiEffGivenAsymmetricMassRatio
andIsotropicUniformMagnitudeChiEffGivenComponentMass
rely on numeric integration to build an interpolator as implemented by default inbase.SamplingDistribution
-
note,
-
orientation
-
time
-
-
update tests to check cdf calculation -
icdf
is the inverse ofcdf
-
add a test to make sure calls to cdf
are compatible withprob
by comparingcdf
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 withjax
(for the most part) and everything works undernumpy
-
-
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?)
- declare a new event generator called
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