pygwb.pe.SmoothBrokenPowerLawModel
- class pygwb.pe.SmoothBrokenPowerLawModel(**kwargs)[source]
Bases:
GWBModel
The smooth broken power law is defined as:
\[\Omega(f) = \Omega_{\text{ref}}\left(\frac{f}{f_{\text{ref}}}\right) ^{\alpha_1} \left[1+\left(\frac{f}{f_{\text{ref}}}\right)^{\Delta}\right]^{\frac{\alpha_2-\alpha_1}{\Delta}}\]Examples
To illustrate how to construct a likelihood with this model, we start by importing the relevant packages:
>>> from pygwb.pe import SmoothBrokenPowerLawModel >>> 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_sbpl = {"baselines":[HL], "model_name":'SBPL'} >>> model_sbpl = SmoothBrokenPowerLawModel(**kwargs_sbpl)
- __init__(**kwargs)[source]
- Parameters:
omega_ref (
float
) – Amplitude of signal (\(\Omega_{\rm ref}\))Delta (
float
) – Smoothing variable for the smooth broken power law (\(\Delta\))alpha_1 (
float
) – Low-frequency spectral index of the smooth broken power law (\(\alpha_1\))alpha_2 (
float
) – High-frequency spectral index of the smooth broken power law (\(\alpha_2\))fbreak (
float
) – Break frequency for the smooth broken power law (\(f_{\text{ref}}\))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 omega_ref:
Amplitude of signal (\(\Omega_{\rm 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.