Base class for parameter distribution densities for use in log likelihood ratio ranking statistics.
Generally several instances of (subclasses of) this will be grouped together to construct a log likelihood ratio class for use as a ranking statistic in a trigger-based search. For example, as a minimum one would expect one instance for the numerator and another for the denominator, but additional ones might be included in a practical ranking statistic implementation, for example a third might be used for storing a histogram of the candidates observed in a search.
Typically, the ranking statistic implementation will provide a function to transform a candidate to the arguments to use with the .__call__() implementation, and so in this way a LnLRDensity object is generally only meaningful in the context of the ranking statistic class for which it has been constructed.
Definition at line 2320 of file snglcoinc.py.
Inherits object.
Inherited by lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Public Member Functions | |
| def | __call__ (self, *args, **kwargs) |
| Evaluate. More... | |
| def | __iadd__ (self, other) |
| Marginalize the two densities. More... | |
| def | increment (self, *args, **kwargs) |
| Increment the counts defining this density at the given parameters. More... | |
| def | copy (self) |
| Return a duplicate copy of this object. More... | |
| def | finish (self) |
| Ensure all internal densities are normalized, and initialize interpolator objects as needed for smooth evaluation. More... | |
| def | samples (self) |
| Generator returning a sequence of parameter values drawn from the distribution density. More... | |
| def | to_xml (self, name) |
| Serialize to an XML fragment and return the root element of the resulting XML tree. More... | |
| def | get_xml_root (cls, xml, name) |
| Sub-classes can use this in their overrides of the .from_xml() method to find the root element of the XML serialization. More... | |
| def | from_xml (cls, xml, name) |
| In the XML document tree rooted at xml, search for the serialized LnLRDensity object named name, and deserialize it. More... | |
| def lalburst.snglcoinc.LnLRDensity.__call__ | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
Evaluate.
Return the natural logarithm of the density evaluated at the given parameters.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2325 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.__iadd__ | ( | self, | |
| other | |||
| ) |
Marginalize the two densities.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2331 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.increment | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
Increment the counts defining this density at the given parameters.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2338 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.copy | ( | self | ) |
Return a duplicate copy of this object.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2344 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.finish | ( | self | ) |
Ensure all internal densities are normalized, and initialize interpolator objects as needed for smooth evaluation.
Must be invoked before .__call__() will yield sensible results.
NOTE: for some implementations this operation will irreversibly alter the contents of the counts array, for example often this operation will involve the convolution of the counts with a density estimation kernel. If it is necessary to preserve a pristine copy of the counts data, use the .copy() method to obtain a copy of the data, first, and then .finish() the copy.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2361 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.samples | ( | self | ) |
Generator returning a sequence of parameter values drawn from the distribution density.
Some subclasses might choose not to implement this, and those that do might choose to use an MCMC-style sample generator and so the samples should not be assumed to be statistically independent.
Definition at line 2372 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.to_xml | ( | self, | |
| name | |||
| ) |
Serialize to an XML fragment and return the root element of the resulting XML tree.
Subclasses must chain to this method, then customize the return value as needed.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2382 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.get_xml_root | ( | cls, | |
| xml, | |||
| name | |||
| ) |
Sub-classes can use this in their overrides of the .from_xml() method to find the root element of the XML serialization.
Definition at line 2391 of file snglcoinc.py.
| def lalburst.snglcoinc.LnLRDensity.from_xml | ( | cls, | |
| xml, | |||
| name | |||
| ) |
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.
Reimplemented in lalburst.burca_tailor.LnLRDensity, and lalburst.stringutils.LnLRDensity.
Definition at line 2405 of file snglcoinc.py.