pygwb.pe.PVPowerLawModel
- class pygwb.pe.PVPowerLawModel(**kwargs)[source]
Bases:
GWBModel
The parity violation model can be defined as:
\[\Omega(f) = \left(1 + \Pi \frac{\gamma _V}{\gamma _I}\right) \Omega_{\text{ref}} \left( \frac{f}{f_{\text{ref}}} \right)^{\alpha}\]Examples
To illustrate how to construct a likelihood with this model, we start by importing the relevant packages:
>>> from pygwb.pe import PVPowerLawModel >>> 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_pv = {"baselines":[HL], "model_name":'PL_PV', 'fref': 25} >>> model_pl_pv = PVPowerLawModel(**kwargs_pl_pv)
- __init__(**kwargs)[source]
- Parameters:
fref (
float
) – Reference frequency for defining the model (\(f_{\text{ref}}\))omega_ref (
float
) – Amplitude of signal at \(f_{\text{ref}}\) (\(\Omega_{\text{ref}}\))alpha (
float
) – Spectral index of the power law (\(\alpha\))Pi (
float
) – Degree of parity violation (\(\Pi\))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}}\))
Function for evaluating log likelihood of detector network.
log_likelihood_IJ
(baseline, freq_mask[, noise])Function for evaluating log likelihood of IJ baseline pair.
Difference between log likelihood and noise log likelihood
model_function
(bline)Function for evaluating model.
Function for evaluating noise log likelihood of detector network.
Attributes
marginalized_parameters
meta_data
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.
- logL_IJ:
- log_likelihood_ratio()
Difference between log likelihood and noise log likelihood
- Returns:
- float
- 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.