pygwb.pe.TVSPowerLawModel

class pygwb.pe.TVSPowerLawModel(**kwargs)[source]

Bases: GWBModel

The Tensor-Vector-Scalar polarization (T,V,S) power-law model is defined as:

\[ \begin{align}\begin{aligned}\Omega(f) = \Omega _T + \Omega _V + \Omega _S\\\Omega _T = \Omega _{{\text{ref}},T} \left( \frac{f}{f_{\text{ref}}}\right)^{\alpha _T}\\\Omega _V = (\gamma _V/\gamma_T)~\Omega _{{\text{ref}},V} \left( \frac{f}{f_{\text{ref}}}\right)^{\alpha _V}\\\Omega _S = (\gamma_S/\gamma_T)~\Omega _{{\text{ref}},S} \left( \frac{f}{f_{\text{ref}}}\right)^{\alpha _S}\end{aligned}\end{align} \]

Examples

To illustrate how to construct a likelihood with this model, we start by importing the relevant packages:

>>> from pygwb.pe import TVSPowerLawModel
>>> from pygwb.baseline import Baseline
>>> import bilby.gw.detector as bilbydet
>>> import numpy as np

The model requires a list of baselines on which to run the parameter estimation. For the sake of the example, we consider the LIGO Hanford-Livingston baseline, and create a baseline object:

>>> H1 = bilbydet.get_empty_interferometer('H1')
>>> L1 = bilbydet.get_empty_interferometer('L1')
>>> HL = Baseline('H1L1', H1, L1)

The frequencies, point estimate spectrum and sigma spectrum of the baseline need to be set as well. For this example and for simplicity, we populate them with random numbers

>>> HL.frequencies = np.linspace(0,100,1000)
>>> HL.point_estimate_spectrum = np.random.rand(1000)
>>> HL.sigma_spectrum = np.random.rand(1000)

The baseline is then added to the other kwargs needed for the model to be instantiated:

>>> kwargs_pl_sv = {"baselines":[HL], "model_name":'PL_SV', "polarizations":['scalar', 'vector']}
>>> model_pl_sv = TVSPowerLawModel(**kwargs_pl_sv)
__init__(**kwargs)[source]
Parameters:
  • fref (float) – Reference frequency for defining the model (\(f_{\text{ref}}\))

  • omega_ref_pol (float) – Amplitude of signal at \(f_{\text{ref}}\) for polarization pol (\(\Omega_{\text{ref},\text{pol}}\))

  • alpha_pol (float) – Spectral index of the power law for polarization pol (\(\alpha_{\text{pol}}\))

  • frequencies (array_like) – Array of frequencies at which to evaluate the model.

See also

pygwb.pe.GWBModel

The parent class used for the implementation.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(**kwargs)

param fref:

Reference frequency for defining the model (\(f_{\text{ref}}\))

log_likelihood()

Function for evaluating log likelihood of detector network.

log_likelihood_IJ(baseline, freq_mask[, noise])

Function for evaluating log likelihood of IJ baseline pair.

log_likelihood_ratio()

Difference between log likelihood and noise log likelihood

model_function(bline)

Function for evaluating model.

noise_log_likelihood()

Function for evaluating noise log likelihood of detector network.

Attributes

marginalized_parameters

meta_data

parameters

Parameters to be inferred from the data.

log_likelihood()

Function for evaluating log likelihood of detector network.

log_likelihood_IJ(baseline, freq_mask, noise=False)

Function for evaluating log likelihood of IJ baseline pair.

Parameters:
  • baseline (pygwb.Baseline) – Baseline for which to run parameter estimation on.

  • noise (bool, optional) – Parameter to indicate whether the likelihood should be evaluated assuming the signal model, or assuming only noise is present in the data.

Returns:
logL_IJ: float

Log likelihood value for the IJ baseline pair.

log_likelihood_ratio()

Difference between log likelihood and noise log likelihood

Returns:
float
model_function(bline)[source]

Function for evaluating model.

noise_log_likelihood()

Function for evaluating noise log likelihood of detector network.

property parameters

Parameters to be inferred from the data. Should return a dictionary.