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\),

\[\log L = -\tfrac{1}{2} F_{ab}\Delta^a\Delta^b - \tfrac{1}{2} G_{abc}\Delta^a\Delta^b\Delta^c - \tfrac{1}{8} H_{abcd}\Delta^a\Delta^b\Delta^c\Delta^d + \ldots\]

with

\[F_{ab} = \langle h_{,a}\mid h_{,b}\rangle, \quad G_{abc} = \langle h_{,ab}\mid h_{,c}\rangle, \quad H_{abcd} = \langle h_{,ab}\mid h_{,cd}\rangle .\]

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

FisherMatrix

Network Fisher matrix, and DALI tensors when order = 2.

Functions

check_order(order)

Validate the requested expansion order.

covariance(fisher[, names, condition_number_warning])

Invert a Fisher matrix and report how much to trust the result.

Module Contents

GWForge.fisher.matrix.SUPPORTED_ORDERS = (1, 2)[source]
GWForge.fisher.matrix.CONDITION_NUMBER_WARNING = 1000000000000000.0[source]
GWForge.fisher.matrix.check_order(order)[source]

Validate the requested expansion order.

Parameters:

order (int) – 1 for the Fisher matrix, 2 for 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.Network already 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}\); None when order < 2.

  • optimal_snrs (dict) – Detector name to optimal SNR, plus "network".

order = 1[source]
parameters[source]
derivatives[source]
names = ['chirp_mass', 'symmetric_mass_ratio', 'luminosity_distance', 'ra', 'dec', 'theta_jn', 'psi',...[source]
property covariance[source]

Inverse Fisher matrix, the linearised-signal covariance.

property sigmas[source]

One-sigma marginalised uncertainties, as a name to value dict.

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 names are ignored.

Returns:

A new (n, n) matrix; matrix is 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). diagnostics holds condition_number and inversion_error, the latter being max|Sigma F - I|.

Return type:

tuple

Raises:

numpy.linalg.LinAlgError – If the matrix is singular even after normalisation.