Collection of commonly used Prior functions and utilities.
Prototypes | |
void | LALInferenceInitCBCPrior (LALInferenceRunState *runState) |
Initialize the prior based on command line arguments. More... | |
void | LALInferenceInitLIBPrior (LALInferenceRunState *runState) |
Initialize the LIB prior based on command line arguments. More... | |
REAL8 | logGlitchAmplitudeDensity (REAL8 A, REAL8 Q, REAL8 f) |
Return the log Prior for the glitch amplitude. More... | |
REAL8 | LALInferenceInspiralPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
Return the logarithmic prior density of the variables specified, for the non-spinning/spinning inspiral signal case. More... | |
UINT4 | LALInferenceInspiralCubeToPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model, double *Cube, void *context) |
Convert the hypercube parameter to physical parameters, for the non-spinning/spinning inspiral signal case. More... | |
void | LALInferenceCyclicReflectiveBound (LALInferenceVariables *parameter, LALInferenceVariables *priorArgs) |
Apply cyclic and reflective boundaries to parameter to bring it back within the allowed prior ranges that are specified in priorArgs . More... | |
void | LALInferenceRotateInitialPhase (LALInferenceVariables *parameter) |
Rotate initial phase if polarisation angle is cyclic around ranges. More... | |
REAL8 | LALInferenceInspiralSkyLocPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
Return the logarithmic prior density of the variables as specified for the sky localisation project (see: https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/SkyLocComparison#priors ), for the non-spinning/spinning inspiral signal case. More... | |
UINT4 | LALInferenceInspiralSkyLocCubeToPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model, double *Cube, void *context) |
Convert the hypercube parameter to physical parameters, for the prior density of the variables as specified for the sky localisation project (see: https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/SkyLocComparison#priors ), for the non-spinning/spinning inspiral signal case. More... | |
void | LALInferenceAddMinMaxPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *min, REAL8 *max, LALInferenceVariableType type) |
Function to add the minimum and maximum values for the uniform prior onto the priorArgs . More... | |
void | LALInferenceGetMinMaxPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *min, REAL8 *max) |
Get the minimum and maximum values of the uniform prior from the priorArgs list, given a name. More... | |
void | LALInferenceRemoveMinMaxPrior (LALInferenceVariables *priorArgs, const char *name) |
Function to remove the minimum and maximum values for the uniform prior onto the priorArgs . More... | |
void | LALInferenceAddGaussianPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *mu, REAL8 *sigma, LALInferenceVariableType type) |
Function to add the mu and sigma values for the Gaussian prior onto the priorArgs . More... | |
void | LALInferenceGetGaussianPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *mu, REAL8 *sigma) |
Get the mu and sigma values of the Gaussian prior from the priorArgs list, given a name. More... | |
void | LALInferenceRemoveGaussianPrior (LALInferenceVariables *priorArgs, const char *name) |
Function to remove the mu and sigma values for the Gaussian prior onto the priorArgs . More... | |
void | LALInferenceAddGMMPrior (LALInferenceVariables *priorArgs, const char *name, REAL8Vector ***mus, gsl_matrix ***covs, REAL8Vector **weights, REAL8Vector **minrange, REAL8Vector **maxrange) |
Add a Gaussian Mixture Model prior. More... | |
int | LALInferenceCheckGMMPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for a Gaussian Mixture Model prior. More... | |
void | LALInferenceRemoveGMMPrior (LALInferenceVariables *priorArgs, const char *name) |
Remove a Gaussian Mixture Model prior. More... | |
void | LALInferenceGetGMMPrior (LALInferenceVariables *priorArgs, const char *name, REAL8Vector ***mus, REAL8Vector ***sigmas, gsl_matrix ***cors, gsl_matrix ***invcors, REAL8Vector **weights, REAL8Vector **minrange, REAL8Vector **maxrange, REAL8Vector **dets, UINT4 *idx, CHAR **fullname) |
Get the parameters defining a Gaussian Mixture Model prior. More... | |
void | LALInferenceAddLogUniformPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *xmin, REAL8 *xmax, LALInferenceVariableType type) |
Add a log-uniform prior. More... | |
void | LALInferenceGetLogUniformPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *xmin, REAL8 *xmax) |
Get the xmin and xmax values of the log-uniform prior from the priorArgs list, given a name. More... | |
void | LALInferenceRemoveLogUniformPrior (LALInferenceVariables *priorArgs, const char *name) |
Function to remove the min and max values for the log-uniform prior from the priorArgs . More... | |
void | LALInferenceAddFermiDiracPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *sigma, REAL8 *r, LALInferenceVariableType type) |
Add a Fermi-Dirac prior. More... | |
void | LALInferenceGetFermiDiracPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 *sigma, REAL8 *r) |
Get the r and sigma values of the Fermi-Dirac prior from the priorArgs list, given a name. More... | |
void | LALInferenceRemoveFermiDiracPrior (LALInferenceVariables *priorArgs, const char *name) |
Function to remove the r and sigma values for the Fermi-Dirac prior onto the priorArgs . More... | |
int | LALInferenceCheckMinMaxPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for types of standard prior. More... | |
int | LALInferenceCheckGaussianPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for a Gaussian prior (with a mean and variance) More... | |
int | LALInferenceCheckLogUniformPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for a log-uniform prior (with xmin and xmax parameters) More... | |
int | LALInferenceCheckFermiDiracPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for a Fermi-Dirac prior (with a r and sigma parameter) More... | |
void | LALInferenceAddCorrelatedPrior (LALInferenceVariables *priorArgs, const char *name, gsl_matrix **cor, REAL8 *mu, REAL8 *sigma, UINT4 *idx) |
Function to add a correlation matrix and parameter index for a prior defined as part of a multivariate Gaussian distribution onto the priorArgs . More... | |
void | LALInferenceGetCorrelatedPrior (LALInferenceVariables *priorArgs, const char *name, gsl_matrix **cor, gsl_matrix **invcor, REAL8 *mu, REAL8 *sigma, UINT4 *idx) |
Get the correlation coefficient matrix and index for a parameter from the priorArgs list. More... | |
void | LALInferenceRemoveCorrelatedPrior (LALInferenceVariables *priorArgs) |
Remove the correlation coefficient matrix and index for a parameter from the priorArgs list. More... | |
int | LALInferenceCheckCorrelatedPrior (LALInferenceVariables *priorArgs, const char *name) |
Check for the existance of a correlation coefficient matrix and index for a parameter from the priorArgs list. More... | |
void | LALInferenceDrawFromPrior (LALInferenceVariables *output, LALInferenceVariables *priorArgs, gsl_rng *rdm) |
Draw variables from the prior ranges. More... | |
void | LALInferenceDrawNameFromPrior (LALInferenceVariables *output, LALInferenceVariables *priorArgs, char *name, LALInferenceVariableType type, gsl_rng *rdm) |
Draw an individual variable from its prior range. More... | |
UINT4 | within_malmquist (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
REAL8 | LALInferenceAnalyticNullPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
Prior that is 1 everywhere in component mass space. More... | |
UINT4 | LALInferenceAnalyticCubeToPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model, double *Cube, void *context) |
Analytic null prior converted from hypercube. More... | |
REAL8 | LALInferenceNullPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
Prior that is 1 everywhere. More... | |
REAL8 | LALInferenceComputePriorMassNorm (const double MMin, const double MMax, const double MTotMax, const double McMin, const double McMax, const double massRatioMin, const double massRatioMax, const char *massRatioName) |
Computes the numerical normalization of the mass prior \(p(\mathcal{M}) \sim \mathcal{M}^{-11/6}\) applying all cuts in the mass plane implied by the various component, total, and chirp mass limits, and the mass ratio limits. More... | |
REAL8 | LALInferenceFlatBoundedPrior (LALInferenceRunState *runState, LALInferenceVariables *params) |
Prior that checks for minimum and maximum prior range specified in runState->priorArgs and returns 0.0 if sample lies inside the boundaries, -DBL_MAX otherwise. More... | |
UINT4 | LALInferenceCubeToPSDScaleParams (LALInferenceVariables *priorParams, LALInferenceVariables *params, INT4 *idx, double *Cube, void *context) |
Utility CubeToPrior functions for psd-fit and both calibration models. More... | |
UINT4 | LALInferenceCubeToConstantCalibrationPrior (LALInferenceRunState *runState, LALInferenceVariables *params, INT4 *idx, double *Cube, void *context) |
REAL8 | LALInferenceCubeToFlatPrior (double r, double x1, double x2) |
Prior that converts from a Cube parameter in [0,1] to the flat prior bounded by x1 and x2. More... | |
REAL8 | LALInferenceCubeToLogFlatPrior (double r, double x1, double x2) |
Prior that converts from a Cube parameter in [0,1] to the flat in log prior bounded by x1 and x2. More... | |
REAL8 | LALInferenceCubeToPowerPrior (double p, double r, double x1, double x2) |
Prior that converts from a Cube parameter in [0,1] to the power prior bounded by x1 and x2 with power p. More... | |
REAL8 | LALInferenceCubeToGaussianPrior (double r, double mean, double sigma) |
Prior that converts from a Cube parameter in [0,1] to the Gaussian prior with given mean and standard deviation. More... | |
REAL8 | LALInferenceCubeToSinPrior (double r, double x1, double x2) |
Prior that converts from a Cube parameter in [0,1] to the sine prior with given min (x1) and max (x2) values. More... | |
REAL8 | LALInferenceSineGaussianPrior (LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model) |
REAL8 | LALInferenceFermiDiracPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 value) |
Return the Fermi-Dirac distribution log prior. More... | |
REAL8 | LALInferenceGMMPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 value) |
Calculate the log probability for the Gaussian Mixture Model prior. More... | |
REAL8 | LALInferenceLogUniformPrior (LALInferenceVariables *priorArgs, const char *name, REAL8 value) |
void LALInferenceInitCBCPrior | ( | LALInferenceRunState * | runState | ) |
Initialize the prior based on command line arguments.
Definition at line 52 of file LALInferencePrior.c.
void LALInferenceInitLIBPrior | ( | LALInferenceRunState * | runState | ) |
Initialize the LIB prior based on command line arguments.
Definition at line 177 of file LALInferencePrior.c.
Return the log Prior for the glitch amplitude.
Definition at line 305 of file LALInferencePrior.c.
REAL8 LALInferenceInspiralPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Return the logarithmic prior density of the variables specified, for the non-spinning/spinning inspiral signal case.
Definition at line 442 of file LALInferencePrior.c.
UINT4 LALInferenceInspiralCubeToPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model, | ||
double * | Cube, | ||
void * | context | ||
) |
Convert the hypercube parameter to physical parameters, for the non-spinning/spinning inspiral signal case.
Definition at line 707 of file LALInferencePrior.c.
void LALInferenceCyclicReflectiveBound | ( | LALInferenceVariables * | parameter, |
LALInferenceVariables * | priorArgs | ||
) |
Apply cyclic and reflective boundaries to parameter
to bring it back within the allowed prior ranges that are specified in priorArgs
.
LALInferenceCyclicReflectiveBound() should not be called after any multi-parameter update step in a jump proposal, as this violates detailed balance.
parameter | [in] Pointer to an array of parameters |
priorArgs | [in] Pointer to an array of prior ranges |
Definition at line 1113 of file LALInferencePrior.c.
void LALInferenceRotateInitialPhase | ( | LALInferenceVariables * | parameter | ) |
Rotate initial phase if polarisation angle is cyclic around ranges.
If the polarisation angle parameter \(\psi\) is cyclic about its upper and lower ranges of \(-\pi/4\) to \(\pi/4\) then the transformation for crossing a boundary requires the initial phase parameter \(\phi_0\) to be rotated through \(\pi\) radians. The function assumes the value of \(\psi\) has been rescaled to be between 0 and \(2\pi\) - this is a requirement of the covariance matrix routine LALInferenceNScalcCVM
function.
This is particularly relevant for pulsar analyses.
parameter | [in] Pointer to an array of parameters |
Definition at line 1204 of file LALInferencePrior.c.
REAL8 LALInferenceInspiralSkyLocPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Return the logarithmic prior density of the variables as specified for the sky localisation project (see: https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/SkyLocComparison#priors ), for the non-spinning/spinning inspiral signal case.
UINT4 LALInferenceInspiralSkyLocCubeToPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model, | ||
double * | Cube, | ||
void * | context | ||
) |
Convert the hypercube parameter to physical parameters, for the prior density of the variables as specified for the sky localisation project (see: https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/SkyLocComparison#priors ), for the non-spinning/spinning inspiral signal case.
void LALInferenceAddMinMaxPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | min, | ||
REAL8 * | max, | ||
LALInferenceVariableType | type | ||
) |
Function to add the minimum and maximum values for the uniform prior onto the priorArgs
.
Definition at line 1934 of file LALInferencePrior.c.
void LALInferenceGetMinMaxPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | min, | ||
REAL8 * | max | ||
) |
Get the minimum and maximum values of the uniform prior from the priorArgs
list, given a name.
Definition at line 1974 of file LALInferencePrior.c.
void LALInferenceRemoveMinMaxPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Function to remove the minimum and maximum values for the uniform prior onto the priorArgs
.
Definition at line 1950 of file LALInferencePrior.c.
void LALInferenceAddGaussianPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | mu, | ||
REAL8 * | sigma, | ||
LALInferenceVariableType | type | ||
) |
Function to add the mu and sigma values for the Gaussian prior onto the priorArgs
.
Definition at line 2003 of file LALInferencePrior.c.
void LALInferenceGetGaussianPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | mu, | ||
REAL8 * | sigma | ||
) |
Get the mu and sigma values of the Gaussian prior from the priorArgs
list, given a name.
Definition at line 2032 of file LALInferencePrior.c.
void LALInferenceRemoveGaussianPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Function to remove the mu and sigma values for the Gaussian prior onto the priorArgs
.
Definition at line 2018 of file LALInferencePrior.c.
void LALInferenceAddGMMPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8Vector *** | mus, | ||
gsl_matrix *** | covs, | ||
REAL8Vector ** | weights, | ||
REAL8Vector ** | minrange, | ||
REAL8Vector ** | maxrange | ||
) |
Add a Gaussian Mixture Model prior.
Add a Gaussian Mixture Model prior defined by a number of multi-variate Gaussian modes, each with a specified set of means, standard deviations, covariance matrices and weights (where weights are the relative probabilities for each mode). The minumum and maximum allowed prior range for each parameter should also be supplied, although if the array pointers are NULL these ranges will default to +/-infinity.
The name
input should be a colon separated list of all the parameters in the multivariate GMM, e.g. "H0:COSIOTA". The number of parameters in this list will be checked against the number of means supplied for each mode, and the shape of the covariances for each mode to make sure that they are consistent. If just one parameter is supplied (e.g. "H0") then this will just be a one-dimensional GMM.
Internally the function will convert the covariance matrices into correlation matrices and inverse correlation matrices for use later (provided they are positive-definite). This will avoid dynamic range/numerical precision issue with using covariances of parameters spanning a large range of values. The standard deviations of each parameter will also be extracted from the covariance matrices and stored, along with the determinants of the covariance matrices.
Definition at line 2203 of file LALInferencePrior.c.
int LALInferenceCheckGMMPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for a Gaussian Mixture Model prior.
Check if the single parameter given by name
has a Gaussian Mixture model prior. If the parameter was within a multivariate GMM prior then it will be found.
Definition at line 2424 of file LALInferencePrior.c.
void LALInferenceRemoveGMMPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Remove a Gaussian Mixture Model prior.
Definition at line 2485 of file LALInferencePrior.c.
void LALInferenceGetGMMPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8Vector *** | mus, | ||
REAL8Vector *** | sigmas, | ||
gsl_matrix *** | cors, | ||
gsl_matrix *** | invcors, | ||
REAL8Vector ** | weights, | ||
REAL8Vector ** | minrange, | ||
REAL8Vector ** | maxrange, | ||
REAL8Vector ** | dets, | ||
UINT4 * | idx, | ||
CHAR ** | fullname | ||
) |
Get the parameters defining a Gaussian Mixture Model prior.
For a single parameter given by name
it will check if that parameter has a GMM prior (even if it is within a multivariate GMM prior). Arrays of the following values for each GMM mode will be returned: means of each parameter; standard deviations of each parameter; a correlation matrix; and inverse correlation matrix; the weight (relative probability) of the mode; and, the determinant of the covariance matrix. The minimum and maximum ranges for each parameter are returned. The position (index) of the parameter name
within a multivariate GMM will is returned. Finally, the combined name of the prior (i.e. including all parameters) is returned.
Definition at line 2341 of file LALInferencePrior.c.
void LALInferenceAddLogUniformPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | xmin, | ||
REAL8 * | xmax, | ||
LALInferenceVariableType | type | ||
) |
Add a log-uniform prior.
Add a prior uniform in the log, i.e. PDF(x)~1/x
\[p(h|h_{\rm min}, h_{\rm max}, I) = \frac{1/h}{\log{(h_{\rm max}/h_{\rm min})}},\]
where \(h_{\rm min}\) and \(h_{\rm max}\) limit the domain of the PDF. The function has no support outside this range.
This function adds xmin
and xmax
values for the Fermi-Dirac prior to the priorArgs
.
Definition at line 2626 of file LALInferencePrior.c.
void LALInferenceGetLogUniformPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | xmin, | ||
REAL8 * | xmax | ||
) |
Get the xmin and xmax values of the log-uniform prior from the priorArgs
list, given a name.
Definition at line 2663 of file LALInferencePrior.c.
void LALInferenceRemoveLogUniformPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Function to remove the min and max values for the log-uniform prior from the priorArgs
.
Definition at line 2648 of file LALInferencePrior.c.
void LALInferenceAddFermiDiracPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | sigma, | ||
REAL8 * | r, | ||
LALInferenceVariableType | type | ||
) |
Add a Fermi-Dirac prior.
Add a prior defined by the Fermi-Dirac PDF
\[p(h|\sigma, r, I) = \frac{1}{\sigma\log{\left(1+e^{r} \right)}}\left(e^{((h/\sigma) - r)} + 1\right)^{-1},\]
where \(r = \mu/\sigma\) to give a more familiar form of the function.
This function adds sigma
and r
values for the Fermi-Dirac prior onto the priorArgs
.
Definition at line 2561 of file LALInferencePrior.c.
void LALInferenceGetFermiDiracPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 * | sigma, | ||
REAL8 * | r | ||
) |
Get the r and sigma values of the Fermi-Dirac prior from the priorArgs
list, given a name.
Definition at line 2589 of file LALInferencePrior.c.
void LALInferenceRemoveFermiDiracPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Function to remove the r and sigma values for the Fermi-Dirac prior onto the priorArgs
.
Definition at line 2576 of file LALInferencePrior.c.
int LALInferenceCheckMinMaxPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for types of standard prior.
Check for a uniform prior (with minimum and maximum)
Definition at line 1963 of file LALInferencePrior.c.
int LALInferenceCheckGaussianPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for a Gaussian prior (with a mean and variance)
Definition at line 1993 of file LALInferencePrior.c.
int LALInferenceCheckLogUniformPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for a log-uniform prior (with xmin and xmax parameters)
Definition at line 2612 of file LALInferencePrior.c.
int LALInferenceCheckFermiDiracPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for a Fermi-Dirac prior (with a r and sigma parameter)
Definition at line 2551 of file LALInferencePrior.c.
void LALInferenceAddCorrelatedPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
gsl_matrix ** | cor, | ||
REAL8 * | mu, | ||
REAL8 * | sigma, | ||
UINT4 * | idx | ||
) |
Function to add a correlation matrix and parameter index for a prior defined as part of a multivariate Gaussian distribution onto the priorArgs
.
The correlation coefficient matrix must be a gsl_matrix and the index for the given parameter in the matrix must be supplied. The mean and standard deviation the named parameter must also be supplied.
Definition at line 2054 of file LALInferencePrior.c.
void LALInferenceGetCorrelatedPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
gsl_matrix ** | cor, | ||
gsl_matrix ** | invcor, | ||
REAL8 * | mu, | ||
REAL8 * | sigma, | ||
UINT4 * | idx | ||
) |
Get the correlation coefficient matrix and index for a parameter from the priorArgs
list.
Definition at line 2106 of file LALInferencePrior.c.
void LALInferenceRemoveCorrelatedPrior | ( | LALInferenceVariables * | priorArgs | ) |
Remove the correlation coefficient matrix and index for a parameter from the priorArgs
list.
Definition at line 2146 of file LALInferencePrior.c.
int LALInferenceCheckCorrelatedPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name | ||
) |
Check for the existance of a correlation coefficient matrix and index for a parameter from the priorArgs
list.
Definition at line 2176 of file LALInferencePrior.c.
void LALInferenceDrawFromPrior | ( | LALInferenceVariables * | output, |
LALInferenceVariables * | priorArgs, | ||
gsl_rng * | rdm | ||
) |
Draw variables from the prior ranges.
Definition at line 2690 of file LALInferencePrior.c.
void LALInferenceDrawNameFromPrior | ( | LALInferenceVariables * | output, |
LALInferenceVariables * | priorArgs, | ||
char * | name, | ||
LALInferenceVariableType | type, | ||
gsl_rng * | rdm | ||
) |
Draw an individual variable from its prior range.
Definition at line 2736 of file LALInferencePrior.c.
UINT4 within_malmquist | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Definition at line 2950 of file LALInferencePrior.c.
REAL8 LALInferenceAnalyticNullPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Prior that is 1 everywhere in component mass space.
UINT4 LALInferenceAnalyticCubeToPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model, | ||
double * | Cube, | ||
void * | context | ||
) |
Analytic null prior converted from hypercube.
REAL8 LALInferenceNullPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Prior that is 1 everywhere.
REAL8 LALInferenceComputePriorMassNorm | ( | const double | MMin, |
const double | MMax, | ||
const double | MTotMax, | ||
const double | McMin, | ||
const double | McMax, | ||
const double | massRatioMin, | ||
const double | massRatioMax, | ||
const char * | massRatioName | ||
) |
Computes the numerical normalization of the mass prior \(p(\mathcal{M}) \sim \mathcal{M}^{-11/6}\) applying all cuts in the mass plane implied by the various component, total, and chirp mass limits, and the mass ratio limits.
Returns the integral of \(\mathcal{M}^{-11/6}\) over the allowed ranges in mass.
Definition at line 1880 of file LALInferencePrior.c.
REAL8 LALInferenceFlatBoundedPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params | ||
) |
Prior that checks for minimum and maximum prior range specified in runState->priorArgs and returns 0.0 if sample lies inside the boundaries, -DBL_MAX otherwise.
Can be used with MinMaxPrior functions. Ignores variables which are not REAL8 or do not have min and max values set.
Definition at line 3218 of file LALInferencePrior.c.
UINT4 LALInferenceCubeToPSDScaleParams | ( | LALInferenceVariables * | priorParams, |
LALInferenceVariables * | params, | ||
INT4 * | idx, | ||
double * | Cube, | ||
void * | context | ||
) |
Utility CubeToPrior functions for psd-fit and both calibration models.
UINT4 LALInferenceCubeToConstantCalibrationPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
INT4 * | idx, | ||
double * | Cube, | ||
void * | context | ||
) |
REAL8 LALInferenceCubeToFlatPrior | ( | double | r, |
double | x1, | ||
double | x2 | ||
) |
Prior that converts from a Cube parameter in [0,1] to the flat prior bounded by x1 and x2.
Definition at line 3330 of file LALInferencePrior.c.
REAL8 LALInferenceCubeToLogFlatPrior | ( | double | r, |
double | x1, | ||
double | x2 | ||
) |
Prior that converts from a Cube parameter in [0,1] to the flat in log prior bounded by x1 and x2.
Definition at line 3339 of file LALInferencePrior.c.
REAL8 LALInferenceCubeToPowerPrior | ( | double | p, |
double | r, | ||
double | x1, | ||
double | x2 | ||
) |
Prior that converts from a Cube parameter in [0,1] to the power prior bounded by x1 and x2 with power p.
Definition at line 3351 of file LALInferencePrior.c.
REAL8 LALInferenceCubeToGaussianPrior | ( | double | r, |
double | mean, | ||
double | sigma | ||
) |
Prior that converts from a Cube parameter in [0,1] to the Gaussian prior with given mean and standard deviation.
Definition at line 3361 of file LALInferencePrior.c.
REAL8 LALInferenceCubeToSinPrior | ( | double | r, |
double | x1, | ||
double | x2 | ||
) |
Prior that converts from a Cube parameter in [0,1] to the sine prior with given min (x1) and max (x2) values.
Definition at line 3370 of file LALInferencePrior.c.
REAL8 LALInferenceSineGaussianPrior | ( | LALInferenceRunState * | runState, |
LALInferenceVariables * | params, | ||
LALInferenceModel * | model | ||
) |
Definition at line 3295 of file LALInferencePrior.c.
REAL8 LALInferenceFermiDiracPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 | value | ||
) |
Return the Fermi-Dirac distribution log prior.
The function returns the log of the prior for a Fermi-Dirac distribution
\[p(h|\sigma, r, I) = \frac{1}{\sigma\log{\left(1+e^{r} \right)}}\left(e^{((h/\sigma) - r)} + 1\right)^{-1},\]
where \(r = \mu/\sigma\) to give a more familiar form of the function. Given how it is used the function does not actually compute the normalisation factor in the prior.
Definition at line 3384 of file LALInferencePrior.c.
REAL8 LALInferenceGMMPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 | value | ||
) |
Calculate the log probability for the Gaussian Mixture Model prior.
Definition at line 3399 of file LALInferencePrior.c.
REAL8 LALInferenceLogUniformPrior | ( | LALInferenceVariables * | priorArgs, |
const char * | name, | ||
REAL8 | value | ||
) |
Definition at line 3504 of file LALInferencePrior.c.