The goal of this is to compute:
.. math::
P(\\vec{\\rho}, \\vec{t}, \\vec{\phi} | \\vec{O}, \\vec{D_H}, s)
Instead of evaluating the above probability we will parameterize it by
pulling out an overall term that scales as the network SNR to the negative
fourth power.
.. math::
P(\\vec{\\rho}, \\vec{t}, \\vec{\phi} | \\vec{O}, \\vec{D_H}, s)
\\approx
P(\\vec{\\rho_{\mathrm{1\,Mpc}}}, \\vec{t}, \\vec{\phi} | \\vec{O}, \\vec{D_H}, s) \\times |\\vec{\\rho}|^{-4}
We reduce the dimensionality by computing things relative to the first
instrument in alphabetical order and use effective distance instead of SNR,
e.g.,
.. math::
P(\\vec{D_{\mathrm{eff}}} / D_{\mathrm{eff}\,0}, \\vec{t} - t_0, \\vec{\phi} - \phi_0 | \\vec{O}, s)
\\times
|\\vec{\\rho}|^{-4}
\equiv
P(\\vec\lambda|\\vec{O}, s)
\\times
|\\vec{\\rho}|^{-4}
where now the absolute geocenter end time or coalescence phase does not
matter since our new variables are relative to the first instrument in
alphabetical order (denoted with 0 subscript). Since the first component of
each of the new vectors is one by construction we don't track it and have
reduced the dimensionality by three.
We won't necessarily evalute exactly this distribution, but something
that should be proportional to it. In order to evaluate this distribution. We
assert that physical signals have a uniform distribution in earth based
coordinates, :math:`\mathrm{RA}, \cos(\mathrm{DEC}), \cos(\iota), \psi`. We
lay down a uniform densly sampled grid in these coordinates and assert that any
signal should ``exactly" land on one of the grid points. We transform that
regularly spaced grid into a grid of (irregularly spaced) points in
:math:`\\vec{\lambda}`, which we denote as :math:`\\vec{\lambda_{\mathrm{m}i}}`
for the *i*\ th model lambda vector. We consider that the **only** mechanism
to push a signal away from one of these exact *i*\ th grid points is Gaussian
noise. Furthermore we assume the probability distribution is of the form:
.. math::
P(\\vec{\lambda} | \\vec{O}, \\vec{\lambda_{mi}})
=
\\frac{1}{\sqrt{(2\pi)^k |\pmb{\Sigma}|}}
\exp{ \left[ -\\frac{1}{2} \\vec{\Delta\lambda}^T \, \pmb{\Sigma}^{-1} \, \\vec{\Delta\lambda} \\right] }
where :math:`\\vec{\Delta\lambda_i} = \\vec{\lambda} -
\\vec{\lambda_{\mathrm{m}i}}` and :math:`\pmb{\Sigma}` is diagonal.
For simplicity here forward we will set :math:`\pmb{\Sigma} = 1` and will drop the normalization, i.e.,
.. math::
P(\\vec{\lambda} | \\vec{O}, \\vec{\lambda_{mi}})
\propto
\exp{ \left[ -\\frac{1}{2} \\vec{\Delta\lambda_i}^2 \\right] }
Then we assert that:
.. math::
P(\\vec\lambda|\\vec{O}, \\vec{D_H}, s) \propto \sum_i P(\\vec{\lambda} | \\vec{O}, \\vec{\lambda_{mi}}) \, p(\\vec{\lambda_{mi}})
Where by construction :math:`p(\\vec{\lambda_{mi}})` doesn't depend on
*i* since they were chosen uniform in prior signal probabality. Computing this
probability on the fly is tough since the grid might have millions of points.
Therefore we make another simplifying assumption that the noise only adds a
contribution which is orthogonal to the hypersurface defined by the signal. In
other words, we assume that noise cannot push a signal from one grid point
towards another along the signal manifold. In this case we can simplify the
marginalization step with a precomputation since
.. math::
\sum_i P(\\vec{\lambda} |\\vec{O}, \\vec{\lambda_{mi}}) \\approx P(\\vec{\lambda} |\\vec{O}, \\vec{\lambda_{m0}}) \\times \sum_{i > 0} \exp{ \left[ -\\frac{1}{2} \\vec{\Delta x_i}^2 \\right] }
Where :math:`\\vec{\lambda_{m0}}` is the **nearest neighbor** to the
measured :math:`\\vec{\lambda}`. The :math:`\\vec{\Delta x_i}^2` term is the
distance squared for the *i*\ th grid point and the nearest neighbor point 0.
This entire sum can be precomputed and stored.
The geometric interpretation is shown in the following figure:
.. image:: ../images/TimePhaseSNR01.png
:width: 400px
In order for this endeavor to be successful, we still need a fast way
to find the nearest neighbor. We use scipy KDTree to accomplish this.
Definition at line 1082 of file inspiral_extrinsics.py.
| def stats.inspiral_extrinsics.TimePhaseSNR.__init__ |
( |
|
self, |
|
|
|
instruments = ("H1", "L1", |
|
|
|
V1, |
|
|
|
K1, |
|
|
|
transtt = None, |
|
|
|
transtp = None, |
|
|
|
transpt = None, |
|
|
|
transpp = None, |
|
|
|
transdd = None, |
|
|
|
norm = None, |
|
|
|
tree_data = None, |
|
|
|
margsky = None, |
|
|
|
verbose = False, |
|
|
|
margstart = 0, |
|
|
|
margstop = None, |
|
|
|
SNR = None, |
|
|
|
psd_fname = None |
|
) |
| |
Initialize a new class from scratch via explicit computation
of the tree data and marginalized probability distributions or by providing
these. **NOTE** generally speaking a user will not initialize
one of these from scratch, but instead will read the data from disk using the
from_hdf() method below.
transtt, transtp, transpt, transpp, transdd are required. They
can be produced by running gstlal_inspiral_compute_dtdphideff_cov_matrix. An
example is here
gstlal_inspiral_compute_dtdphideff_cov_matrix --psd-xml share/O3/2019-05-09-H1L1V1psd_new.xml.gz --H-snr 5 --L-snr 7.0 --V-snr 2.25
transtt = {frozenset(['V1', 'H1']): 1721.2939671945821, frozenset(['H1', 'L1']): 4264.931381497161, frozenset(['V1', 'L1']): 1768.5971596859304}
transtp = {frozenset(['V1', 'H1']): -1.620591401760186, frozenset(['H1', 'L1']): -3.07346071253937, frozenset(['V1', 'L1']): -1.7020167980031902}
transpt = {frozenset(['V1', 'H1']): 0.0, frozenset(['H1', 'L1']): 0.0, frozenset(['V1', 'L1']): 0.0}
transpp = {frozenset(['V1', 'H1']): 1.2422379329336048, frozenset(['H1', 'L1']): 2.6540061786001834, frozenset(['V1', 'L1']): 1.2984050700516363}
transdd = {frozenset(['V1', 'H1']): 2.0518233866439894, frozenset(['H1', 'L1']): 4.068667356033675, frozenset(['V1', 'L1']): 2.1420642628918447}
norm is required. An example is:
norm = {('H1', 'V1'):332.96168414700816, ('H1', 'L1', 'V1'):7.729877009864116, ('L1', 'V1'):313.34679951193306, ('L1',):0.0358423687136922, ('H1', 'L1'):409.06489455239137, ('H1',):0.0358423687136922, ('V1',):0.0358423687136922}
typically a user would make a new inspiral_dt_dphi_pdf.h5 file
which contains all of these by running:
gstlal_inspiral_create_dt_dphi_snr_ratio_pdfs_dag
Definition at line 1188 of file inspiral_extrinsics.py.
| def stats.inspiral_extrinsics.TimePhaseSNR.dtdphideffpoints |
( |
|
self, |
|
|
|
time, |
|
|
|
phase, |
|
|
|
deff, |
|
|
|
slices |
|
) |
| |
Given a dictionary of time, phase and deff, which could be
lists of values, pack the delta t delta phi and eff distance
ratios transformed by the covariance matrix according to
the rules provided by slices.
>>> TimePhaseSNR.dtdphideffpoints({"H1":0, "L1":-.001, "V1":.001}, {"H1":0, "L1":0, "V1":1}, {"H1":1, "L1":3, "V1":4}, TimePhaseSNR.slices)
array([[ 1. , 0. , -5. , -1. , -2.54647899,
-5. , -2. , -2.54647899, -5. ]], dtype=float32)
**NOTE** You must have the same ifos in slices as in the time,
phase, deff dictionaries. The result of self.slices gives slices for all the
instruments stored in self.responses
Definition at line 1461 of file inspiral_extrinsics.py.
| def stats.inspiral_extrinsics.TimePhaseSNR.instrument_combos |
( |
|
cls, |
|
|
|
instruments, |
|
|
|
min_instruments = 2 |
|
) |
| |
Given a list of instrument produce all the possible combinations of min_instruents or greater, e.g.,
>>> TimePhaseSNR.instrument_combos(("H1","V1","L1"), min_instruments = 3)
(('H1', 'L1', 'V1'),)
>>> TimePhaseSNR.instrument_combos(("H1","V1","L1"), min_instruments = 2)
(('H1', 'L1'), ('H1', 'L1', 'V1'), ('H1', 'V1'), ('L1', 'V1'))
>>> TimePhaseSNR.instrument_combos(("H1","V1","L1"), min_instruments = 1)
(('H1',), ('H1', 'L1'), ('H1', 'L1', 'V1'), ('H1', 'V1'), ('L1',), ('L1', 'V1'), ('V1',))
**NOTE**: these combos are always returned in alphabetical order
Definition at line 1421 of file inspiral_extrinsics.py.