Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInferenceLikelihood.h
Go to the documentation of this file.
1/*
2 *
3 * LALInferenceLikelihood.c: Likelihood functions for LALInference codes
4 * LALInferenceLikelihood.h: header file
5 *
6 * Copyright (C) 2009 Ilya Mandel, Vivien Raymond, Christian Roever, Marc van der Sluys and John Veitch
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with with program; see the file COPYING. If not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * MA 02110-1301 USA
23 */
24#ifndef LALInferenceLikelihood_h
25#define LALInferenceLikelihood_h
26
27#include <lal/LALInference.h>
28
29
30#ifdef SWIG // SWIG interface directives
31SWIGLAL(
32 FUNCTION_POINTER(
34 LALInferenceNoiseOnlyLogLikelihood,
36 LALInferenceFreqDomainLogLikelihood,
44 )
45);
46#endif
47
48
49extern const char *LALInferenceAnalyticNamesCBC[15];
50
51extern const REAL8 LALInferenceAnalyticMeansCBC[15];
52
53/* Scaling used for the CBC analytic likelihood parameters */
54extern const REAL8 scaling[15];
55
56/* Covariance matrix for use in analytic likelihoods */
57extern const REAL8 CM[15][15];
58
59
60/**
61 * \defgroup LALInferenceLikelihood_h Header LALInferenceLikelihood.h
62 * \ingroup lalinference_general
63 *
64 * \brief Header file for likelihood functions used by LALInference codes
65 *
66 * LALInferenceLikelihood contains all the necessary routines to compute the likelihood
67 * from a template (computed with LALInferenceTemplate) and the data (initialised with LALInferenceReadData).
68 *
69 * Likelihood functions follow the basic naming convention: LALInference<type_of>LogLikelihood()
70 *
71 * Takes as input:
72 * - a pointer to a LALInferenceVariable structure containing the parameters to compute the likelihood for,
73 * - a pointer to a LALInferenceIFOData structure containing the linked list of interferometer data,
74 * - a pointer to the LALInferenceModel model structure, containing the template function and model.
75 *
76 * Outputs as a REAL8 the natural logarithm value of the likelihood, as defined by:
77 *
78 * \f[
79 * Likelihood(\vec{x}|\vec{\lambda},M)=\exp(-\tfrac{1}{2}<\vec{x}-\vec{h_M}(\vec{\lambda})|\vec{x}-\vec{h_M}(\vec{\lambda})>)
80 * \f]
81 *
82 * where: \f$<x|y>=4Re\left ( \int \frac{\tilde{x}\,\tilde{y}^*}{S_f}\, df \right )\f$
83 *
84 * Note that the likelihood is reported unnormalised.
85 *
86 */
87/** @{ */
88
89/***********************************************************//**
90 * (log-) likelihood function.
91 * Returns the non-normalised logarithmic likelihood.
92 *
93 * Required (`currentParams') parameters are:
94 * - "rightascension" (REAL8, radian, 0 <= RA <= 2pi)
95 * - "declination" (REAL8, radian, -pi/2 <= dec <=pi/2)
96 * - "polarisation" (REAL8, radian, 0 <= psi <= ?)
97 * - "distance" (REAL8, Mpc, >0)
98 * - "time" (REAL8, GPS sec.)
99 ***************************************************************/
101
102/**
103 * For testing purposes (for instance sampling the prior),
104 * likelihood that returns 0.0 = log(1) every
105 * time. Activated with the --zeroLogLike command flag.
106 */
108
109
110/**
111 * Computes the <x|y> overlap in the Fourier domain.
112 */
114 COMPLEX16Vector * freqData1, COMPLEX16Vector * freqData2);
115/**
116 * Computes the complex <x|y> overlap
117 */
119 COMPLEX16Vector * freqData1,
120 COMPLEX16Vector * freqData2);
121
122/**
123 * Identical to LALInferenceFreqDomainNullLogLikelihood, but returns the likelihood of a null template.
124 * Used for normalising.
125 */
127
128/***********************************************************//**
129 * Student-t (log-) likelihood function
130 * as described in Roever/Meyer/Christensen (2011):
131 * "Modelling coloured residual noise
132 * in gravitational-wave signal processing."
133 * Classical and Quantum Gravity, 28(1):015010.
134 * http://dx.doi.org/10.1088/0264-9381/28/1/015010
135 * http://arxiv.org/abs/0804.3853
136 * Returns the non-normalised logarithmic likelihood.
137 *
138 * Required (`currentParams') parameters are:
139 * - "rightascension" (REAL8, radian, 0 <= RA <= 2pi)
140 * - "declination" (REAL8, radian, -pi/2 <= dec <=pi/2)
141 * - "polarisation" (REAL8, radian, 0 <= psi <= ?)
142 * - "distance" (REAL8, Mpc, > 0)
143 * - "time" (REAL8, GPS sec.)
144 *
145 * This function is essentially the same as the
146 * "UndecomposedFreqDomainLogLikelihood()" function.
147 * The additional parameter to be supplied is the (REAL8)
148 * degrees-of-freedom parameter (nu) for each Ifo.
149 * The additional "df" argument gives the corresponding
150 * d.f. parameter for each element of the "*data" list.
151 * The names of "df" must match the "->name" slot of
152 * the elements of "data".
153 *
154 * (TODO: allow for d.f. parameter to vary with frequency,
155 * i.e., to be a set of vectors corresponding to
156 * frequencies)
157 ***************************************************************/
159
160/**
161 * An analytic likeilhood that is a correlated Gaussian in 15
162 * dimensions.
163 */
165
166/**
167 * An analytic likeilhood that is two correlated Gaussians in 15
168 * dimensions.
169 */
171
172/**
173 * 15-D Rosenbrock log(L) function (see Eq (3) of
174 * http://en.wikipedia.org/wiki/Rosenbrock_function .
175 */
177
179
181
182/** Compute delta-log-likelihood for given distance min, max and OptimalSNR and d_inner_h when evaluated at 1Mpc
183 * cosmology: 0 = Euclidean distance prior , 1 = uniform in comoving volume
184 margphi: 0 = use gaussian likelihood, 1 = phase-marginalised bessel likelihood */
185double LALInferenceMarginalDistanceLogLikelihood(double dist_min, double dist_max, double OptimalSNR, double d_inner_h, int cosmology, int margphi);
186
187
188/**
189 * Returns the log-likelihood marginalised over the time dimension
190 * from the prior min to the prior max. See
191 * https://dcc.ligo.org/LIGO-T1400460 for the details.
192 */
194
195/**
196 * Initialisation function which reads runState->commaneLine and sets up the
197 * likelihood function accordingly. Can choose between Gaussian, Student-t, marginalised
198 * phase likelihoods
199 */
201
202/** Get the intrinsic parameters from currentParams */
204
205/** fast SineGaussian likelihood for LIB */
208 LALInferenceModel *model);
209
210/** Calculate the SNR across the network */
212/** @} */
213
214#endif
const REAL8 LALInferenceAnalyticMeansCBC[15]
const REAL8 CM[15][15]
const REAL8 scaling[15]
const char * LALInferenceAnalyticNamesCBC[15]
LALInferenceVariables currentParams
double complex COMPLEX16
double REAL8
REAL8 LALInferenceBimodalCorrelatedAnalyticLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
An analytic likeilhood that is two correlated Gaussians in 15 dimensions.
REAL8 LALInferenceCorrelatedAnalyticLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
An analytic likeilhood that is a correlated Gaussian in 15 dimensions.
REAL8 LALInferenceMarginalisedTimePhaseLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
void LALInferenceInitLikelihood(LALInferenceRunState *runState)
Initialisation function which reads runState->commaneLine and sets up the likelihood function accordi...
REAL8 LALInferenceNullLogLikelihood(LALInferenceIFOData *data)
Identical to LALInferenceFreqDomainNullLogLikelihood, but returns the likelihood of a null template.
double LALInferenceMarginalDistanceLogLikelihood(double dist_min, double dist_max, double OptimalSNR, double d_inner_h, int cosmology, int margphi)
Compute delta-log-likelihood for given distance min, max and OptimalSNR and d_inner_h when evaluated ...
REAL8 LALInferenceFreqDomainStudentTLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
Student-t (log-) likelihood function as described in Roever/Meyer/Christensen (2011): "Modelling colo...
COMPLEX16 LALInferenceComputeFrequencyDomainComplexOverlap(LALInferenceIFOData *dataPtr, COMPLEX16Vector *freqData1, COMPLEX16Vector *freqData2)
Computes the complex <x|y> overlap.
REAL8 LALInferenceFastSineGaussianLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
fast SineGaussian likelihood for LIB
REAL8 LALInferenceMarginalisedTimeLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
Returns the log-likelihood marginalised over the time dimension from the prior min to the prior max.
REAL8 LALInferenceComputeFrequencyDomainOverlap(LALInferenceIFOData *data, COMPLEX16Vector *freqData1, COMPLEX16Vector *freqData2)
Computes the <x|y> overlap in the Fourier domain.
REAL8 LALInferenceZeroLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
For testing purposes (for instance sampling the prior), likelihood that returns 0....
REAL8 LALInferenceUndecomposedFreqDomainLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
(log-) likelihood function.
void LALInferenceNetworkSNR(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
Calculate the SNR across the network.
REAL8 LALInferenceMarginalisedPhaseLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
REAL8 LALInferenceRosenbrockLogLikelihood(LALInferenceVariables *currentParams, LALInferenceIFOData *data, LALInferenceModel *model)
15-D Rosenbrock log(L) function (see Eq (3) of http://en.wikipedia.org/wiki/Rosenbrock_function .
LALInferenceVariables LALInferenceGetInstrinsicParams(LALInferenceVariables *currentParams)
Get the intrinsic parameters from currentParams.
Structure to contain IFO data.
Definition: LALInference.h:625
Structure to constain a model and its parameters.
Definition: LALInference.h:436
Structure containing inference run state This includes pointers to the function types required to run...
Definition: LALInference.h:592
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
Definition: LALInference.h:170