stats.inspiral_lr module¶
- class stats.inspiral_lr.DatalessLnNoiseDensity(*args, **kwargs)[source]¶
Bases:
LnNoiseDensity
Stripped-down version of LnNoiseDensity for use in estimating ranking statistics when no data has been collected from an instrument with which to define the ranking statistic.
Used, for example, to implement low-significance candidate culls, etc.
Assumes all available instruments are on and have the same horizon distance, and assess candidates based only on SNR and chi^2 distributions.
- DEFAULT_FILENAME = '/usr/share/gstlal/inspiral_datalesslndensity.xml.gz'¶
- class LIGOLWContentHandler(document, start_handlers={})[source]¶
Bases:
LIGOLWContentHandler
- startArray(parent, attrs)¶
- startParam(parent, attrs)¶
- startStream(parent, attrs, __orig_startStream=<function LIGOLWContentHandler.startStream>)¶
- classmethod from_xml(xml, name)[source]¶
In the XML document tree rooted at xml, search for the serialized LnLRDensity object named name, and deserialize it. The return value is the deserialized LnLRDensity object.
- increment(*args, **kwargs)[source]¶
Increment the counts defining this density at the given parameters.
- random_params()[source]¶
Generator that yields an endless sequence of randomly generated candidate parameters. NOTE: the parameters will be within the domain of the repsective binnings but are not drawn from the PDF stored in those binnings — this is not an MCMC style sampler. Each value in the sequence is a three-element tuple. The first two elements of each tuple provide the *args and **kwargs values for calls to this PDF or the numerator PDF or the ranking statistic object. The final is the natural logarithm (up to an arbitrary constant) of the PDF from which the parameters have been drawn evaluated at the point described by the *args and **kwargs.
See also:
random_sim_params()
The sequence is suitable for input to the .ln_lr_samples() log likelihood ratio generator.
- class stats.inspiral_lr.DatalessLnSignalDensity(*args, **kwargs)[source]¶
Bases:
LnSignalDensity
Stripped-down version of LnSignalDensity for use in estimating ranking statistics when no data has been collected from an instrument with which to define the ranking statistic.
Used, for example, to implement low-significance candidate culls, etc.
Assumes all available instruments are on and have the same horizon distance, and assess candidates based only on SNR and chi^2 distributions.
- classmethod from_xml(xml, name)[source]¶
In the XML document tree rooted at xml, search for the serialized LnLRDensity object named name, and deserialize it. The return value is the deserialized LnLRDensity object.
- class stats.inspiral_lr.LnNoiseDensity(*args, **kwargs)[source]¶
Bases:
LnLRDensity
- candidate_count_model()[source]¶
Compute and return a prediction for the total number of noise candidates expected for each instrument combination.
- classmethod from_xml(xml, name, convert=False)[source]¶
In the XML document tree rooted at xml, search for the serialized LnLRDensity object named name, and deserialize it. The return value is the deserialized LnLRDensity object.
- random_params()[source]¶
Generator that yields an endless sequence of randomly generated candidate parameters. NOTE: the parameters will be within the domain of the repsective binnings but are not drawn from the PDF stored in those binnings — this is not an MCMC style sampler. Each value in the sequence is a three-element tuple. The first two elements of each tuple provide the *args and **kwargs values for calls to this PDF or the numerator PDF or the ranking statistic object. The final is the natural logarithm (up to an arbitrary constant) of the PDF from which the parameters have been drawn evaluated at the point described by the *args and **kwargs.
See also:
random_sim_params()
The sequence is suitable for input to the .ln_lr_samples() log likelihood ratio generator.
- property segmentlists¶
- class stats.inspiral_lr.LnSignalDensity(*args, **kwargs)[source]¶
Bases:
LnLRDensity
- add_signal_model_analytic(lambda_sum, lambdasq_sum, lambda_etasq_sum, lambdasq_etasq_sum, mismatch_range=(0.001, 0.3), verbose=False)[source]¶
- candidate_count_model(rate=1000.0)[source]¶
Compute and return a prediction for the total number of above-threshold signal candidates expected. The rate parameter sets the nominal signal rate in units of Gpc^-3 a^-1.
- classmethod from_xml(xml, name, convert=False)[source]¶
In the XML document tree rooted at xml, search for the serialized LnLRDensity object named name, and deserialize it. The return value is the deserialized LnLRDensity object.
- increment(*args, **kwargs)[source]¶
Increment the counts defining this density at the given parameters.
- local_mean_horizon_distance(segs, template_id=None)[source]¶
Compute the volume-weighted mean horizon distance for each of the detectors within its respective time interval. segs is a dictionary mapping instrument–>GPS segment. If template_id is None then the calculation is for the canonical template for this template bank bin, otherwise it is for the given template.
- random_sim_params(sim, template_id=None, snr_efficiency=1.0, f_low=15.0)[source]¶
Generator that yields an endless sequence of randomly generated parameter dictionaries drawn from the distribution of parameters expected for the given injection, which is an instance of a SimInspiral table row object (see ligo.lw.lsctables.SimInspiral for more information). Each value in the sequence is a tuple, the first element of which is the random parameter dictionary and the second is 0.
See also:
LnNoiseDensity.random_params()
The parameters do not necessarily represent valid candidates, for example the number of detectors reporting a trigger might be less than the .min_instruments parameter configured for the ranking statistic. It is the job of the calling code to check the parameters for validity before using them to compute ranking statistic values. This is done to allow the calling code to measure the frequency with which the injection is expected to be undetectable. Otherwise, the sequence is suitable for input to the .ln_lr_samples() log likelihood ratio generator.
Bugs:
The second element in each tuple in the sequence is merely a placeholder, not the natural logarithm of the PDF from which the sample has been drawn, as in the case of random_params(). Therefore, when used in combination with .ln_lr_samples(), the two probability densities computed and returned by that generator along with each log likelihood ratio value will simply be the probability densities of the signal and noise populations at that point in parameter space. They cannot be used to form an importance weighted sampler of the log likelihood ratios.
- class stats.inspiral_lr.OnlineFrankensteinLnNoiseDensity(*args, **kwargs)[source]¶
Bases:
LnNoiseDensity
Version of LnNoiseDensity with trigger rate data spliced in from another instance. Used to solve a chicken-or-egg problem and assign ranking statistic values in an aonline anlysis. NOTE: the trigger rate data is not copied from the donor, instances of this class hold a reference to the donor’s data, so as it is modified those modifications are immediately reflected here.
- class stats.inspiral_lr.OnlineFrankensteinLnSignalDensity(*args, **kwargs)[source]¶
Bases:
LnSignalDensity
Version of LnSignalDensity with horizon distance history spliced in from another instance. Used to solve a chicken-or-egg problem and assign ranking statistic values in an aonline anlysis. NOTE: the horizon history is not copied from the donor, instances of this class hold a reference to the donor’s data, so as it is modified those modifications are immediately reflected here.