GWForge.fisher.matrix¶
Fisher matrix and doublet-DALI tensors for a detector network.
Expanding the Gaussian log-likelihood \(\log L = -\tfrac{1}{2}\langle d - h(\theta)\mid d - h(\theta)\rangle\) about the fiducial parameters with \(d = h_0\), and writing \(\Delta h = h_{,a}\Delta^a + \tfrac{1}{2}h_{,ab}\Delta^a\Delta^b + \ldots\),
with
The \(\tfrac{1}{2}\) and \(\tfrac{1}{8}\) come from the \(2\times \tfrac{1}{2}\) and \((\tfrac{1}{2})^2\) cross terms, reproducing eq. (15) of Sellentin, Quartin & Amendola. Truncating at \(F\) is the Fisher matrix of Vallisneri; keeping all three is doublet-DALI.
The quartic term is \(-\tfrac{1}{8}\lVert h_{,ab}\Delta^a\Delta^b\rVert^2\), which is negative-definite, so the doublet posterior is normalisable by construction.
Third-order DALI (“triplet”) is deliberately not implemented: there is no group
of terms beyond the three above that can be written with first and second
derivatives alone. See check_order().
Attributes¶
Classes¶
Network Fisher matrix, and DALI tensors when |
Functions¶
|
Validate the requested expansion order. |
|
Invert a Fisher matrix and report how much to trust the result. |
Module Contents¶
- GWForge.fisher.matrix.check_order(order)[source]¶
Validate the requested expansion order.
- Parameters:
order (int) –
1for the Fisher matrix,2for doublet-DALI.- Return type:
int
- Raises:
NotImplementedError – For
order = 3. Triplet-DALI needs genuine third derivatives of the waveform – the terms \(\langle h_{,a}\mid h_{,bcd}\rangle\), \(\langle h_{,ab}\mid h_{,cde}\rangle\) and \(\langle h_{,abc}\mid h_{,def}\rangle\) of Sellentin+ eq. (16). Grouping the expansion by highest derivative, the Fisher term plus \(G\) and \(H\) already exhausts everything expressible with first and second derivatives, so there is no consistent third order that avoids them.ValueError – For any other unsupported value.
- class GWForge.fisher.matrix.FisherMatrix(interferometers, waveform_generator, parameters, fisher_parameters=None, earth_rotation=True, finite_size=True, step_sizes=None, order=1, calibrate=True, target_change=TARGET_FRACTIONAL_CHANGE, estimate_noise=True)[source]¶
Network Fisher matrix, and DALI tensors when
order = 2.Every tensor is a sum over detectors of noise-weighted inner products, so the network result is the sum of the per-detector results (Vallisneri eq. 13). ET contributes as three separate interferometers, which is how
GWForge.ifo.detectors.Networkalready presents it.Examples
>>> fisher = FisherMatrix(ifos, waveform_generator, injection_parameters) >>> sigmas = numpy.sqrt(numpy.diag(fisher.covariance))
- Variables:
names (list of str) – Parameter names in matrix order.
matrix (numpy.ndarray) –
(n, n)network Fisher matrix.per_detector (dict) – Detector name to its own
(n, n)Fisher matrix.quartic (doublet,) – \(G_{abc}\) and \(H_{abcd}\);
Nonewhenorder < 2.optimal_snrs (dict) – Detector name to optimal SNR, plus
"network".
- names = ['chirp_mass', 'symmetric_mass_ratio', 'luminosity_distance', 'ra', 'dec', 'theta_jn', 'psi',...[source]¶
- with_gaussian_prior(prior_sigmas)[source]¶
Add Gaussian prior information to the Fisher matrix.
A Gaussian prior of width \(\sigma_a\) contributes \(1/\sigma_a^2\) to the diagonal – the only way a prior can enter a Fisher matrix, since a uniform prior carries no information in its interior.
- Parameters:
prior_sigmas (dict) – Parameter name to prior standard deviation. Names not in
namesare ignored.- Returns:
A new
(n, n)matrix;matrixis left untouched.- Return type:
numpy.ndarray
- GWForge.fisher.matrix.covariance(fisher, names=None, condition_number_warning=CONDITION_NUMBER_WARNING)[source]¶
Invert a Fisher matrix and report how much to trust the result.
Fisher matrices for a gravitational-wave network are badly scaled – a chirp-mass entry and a time entry differ by many orders of magnitude – so the matrix is normalised by its diagonal before inversion and un-normalised afterwards.
- Parameters:
fisher (numpy.ndarray) –
(n, n)symmetric positive-definite matrix.names (sequence of str or None) – Parameter names, used only to make the warnings readable.
condition_number_warning (float) – Warn above this condition number.
- Returns:
(covariance, diagnostics).diagnosticsholdscondition_numberandinversion_error, the latter beingmax|Sigma F - I|.- Return type:
tuple
- Raises:
numpy.linalg.LinAlgError – If the matrix is singular even after normalisation.