Likelihoods#

Classes defining likelihood functions for use in continuous wave searches. These likelihood function should be subclasses of the bilby.core.likelihood.Likelihood class.

class TargetedPulsarLikelihood(data, priors, likelihood='studentst', roq=False, numba=False, **kwargs)#

Bases: Likelihood

A likelihood, based on the bilby.core.likelihood.Likelihood, for use in source parameter estimation for continuous wave signals, with particular focus on emission from known pulsars. As a default, this class will assume a Student’s t-likelihood function, as defined in Equation 12 of [1]. This likelihood function assumes that the noise process in each dataset can be broken down into multiple chunks of zero mean stationary Gaussian noise, each with unknown, and independent, values of the standard deviation (see bayesian_blocks() and Appendix B of [1]). The Gaussian likelihood for each chunk is analytically marginalised over the standard deviation, using a Jeffreys prior, and the product of the likelihoods for each gives the overall likelihood function. A Gaussian likelihood function can also be used (Equation 13 of [1]), if estimates of the noise standard deviation for each chunk are available.

Parameters:
  • data (str, HeterodynedData, MultiHeterodynedData) – A HeterodynedData or MultiHeterodynedData object containing all required data.

  • priors (bilby.core.prior.PriorDict) – A bilby.core.prior.PriorDict containing the parameters that are to be sampled. This is required to be set before this class is initialised.

  • likelihood (str) – A string setting which likelihood function to use. This can either be “studentst” (the default), or “gaussian”.

  • roq (bool) – Set to True if wanting to use reduced order quadrature for generating the likelihood. Defaults to False.

  • numba (bool) – Boolean to set whether to use the numba JIT compiled version of the likelihood function.

Empty likelihood class to be subclassed by other likelihoods

Parameters:

parameters (dict) – A dictionary of the parameter names and associated values

dot_products()#

Calculate the (noise-weighted) dot products of the data and the antenna pattern functions (see Appendix C of [1]). E.g., for the data this is the real value

\[(d/\sigma) \cdot (d^*/\sigma) = \sum_i \frac{d_id_i^*}{\sigma_i^2} \equiv \sum_i \frac{\Re{(d)}^2 + \Im{(d)}^2}{\sigma_i^2}.\]

For the antenna patterns, for example \(F_+\) and \(F_{\times}\), we would have

\[ \begin{align}\begin{aligned}(F_+/\sigma) \cdot (F_+/\sigma) = \sum_i \frac{{F_+}_i^2}{\sigma_i^2},\\(F_\times/\sigma) \cdot (F_\times/\sigma) = \sum_i \frac{{F_\times}_i^2}{\sigma_i^2},\\(F_+/\sigma) \cdot (F_{\times}/\sigma) = \sum_i \frac{{F_+}_i{F_\times}_i}{\sigma_i^2},\\(d/\sigma) \cdot (F_+/\sigma) = \sum_i \frac{d_i{F_+}_i}{\sigma_i^2},\\(d/\sigma) \cdot (F_\times/\sigma) = \sum_i \frac{d_i{F_\times}_i}{\sigma_i^2},\end{aligned}\end{align} \]

For non-GR signals, also involving the vector and scalar modes, there are similar products.

property likelihood#

The the string containing the ‘type’ of likelihood function to use: ‘studentst’ or ‘gaussian’.

log_likelihood()#

The log-likelihood function.

noise_log_likelihood()#

The log-likelihood for the data being consistent with the noise model, i.e., when the signal is zero. See Equations 14 and 15 of [1].

Returns:

The noise-only log-likelihood

Return type:

float

property roq#

A boolean defining whether to use ROQ for likelihood calculations.

Likelihood references#