24#ifndef LALInferencePrior_h
25#define LALInferencePrior_h
27#include <lal/LALInference.h>
33 LALInferenceInspiralPriorNormalised,
47SWIGLAL(INPUT_SCALARS(
REAL8*, min,
max));
279 const char *name, gsl_matrix **cor,
287 const char *name, gsl_matrix **cor, gsl_matrix **invcor,
334 const double McMin,
const double McMax,
335 const double massRatioMin,
const double massRatioMax,
const char *massRatioName);
static REAL8 mean(REAL8 *array, int N)
LALInferenceVariableType
An enumerated type for denoting the type of a variable.
void LALInferenceRemoveCorrelatedPrior(LALInferenceVariables *priorArgs)
Remove the correlation coefficient matrix and index for a parameter from the priorArgs list.
UINT4 LALInferenceAnalyticCubeToPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model, double *Cube, void *context)
Analytic null prior converted from hypercube.
REAL8 LALInferenceGMMPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 value)
Calculate the log probability for the Gaussian Mixture Model prior.
UINT4 LALInferenceCubeToConstantCalibrationPrior(LALInferenceRunState *runState, LALInferenceVariables *params, INT4 *idx, double *Cube, void *context)
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.
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 applying all cuts in the mass plane implied b...
UINT4 LALInferenceCubeToPSDScaleParams(LALInferenceVariables *priorParams, LALInferenceVariables *params, INT4 *idx, double *Cube, void *context)
Utility CubeToPrior functions for psd-fit and both calibration models.
REAL8 LALInferenceInspiralPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
Return the logarithmic prior density of the variables specified, for the non-spinning/spinning inspir...
REAL8 LALInferenceFlatBoundedPrior(LALInferenceRunState *runState, LALInferenceVariables *params)
Prior that checks for minimum and maximum prior range specified in runState->priorArgs and returns 0....
int LALInferenceCheckMinMaxPrior(LALInferenceVariables *priorArgs, const char *name)
Check for types of standard prior.
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...
void LALInferenceAddGMMPrior(LALInferenceVariables *priorArgs, const char *name, REAL8Vector ***mus, gsl_matrix ***covs, REAL8Vector **weights, REAL8Vector **minrange, REAL8Vector **maxrange)
Add a Gaussian Mixture Model prior.
void LALInferenceDrawNameFromPrior(LALInferenceVariables *output, LALInferenceVariables *priorArgs, char *name, LALInferenceVariableType type, gsl_rng *rdm)
Draw an individual variable from its prior range.
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 spe...
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.
void LALInferenceInitCBCPrior(LALInferenceRunState *runState)
Initialize the prior based on command line arguments.
void LALInferenceRemoveFermiDiracPrior(LALInferenceVariables *priorArgs, const char *name)
Function to remove the r and sigma values for the Fermi-Dirac prior onto the priorArgs.
void LALInferenceRemoveMinMaxPrior(LALInferenceVariables *priorArgs, const char *name)
Function to remove the minimum and maximum values for the uniform prior onto the priorArgs.
REAL8 LALInferenceNullPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
Prior that is 1 everywhere.
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.
REAL8 LALInferenceSineGaussianPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
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)...
void LALInferenceAddLogUniformPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 *xmin, REAL8 *xmax, LALInferenceVariableType type)
Add a log-uniform prior.
void LALInferenceRemoveGaussianPrior(LALInferenceVariables *priorArgs, const char *name)
Function to remove the mu and sigma values for the Gaussian prior onto the priorArgs.
REAL8 LALInferenceLogUniformPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 value)
void LALInferenceCyclicReflectiveBound(LALInferenceVariables *parameter, LALInferenceVariables *priorArgs)
Apply cyclic and reflective boundaries to parameter to bring it back within the allowed prior ranges ...
void LALInferenceRotateInitialPhase(LALInferenceVariables *parameter)
Rotate initial phase if polarisation angle is cyclic around ranges.
int LALInferenceCheckCorrelatedPrior(LALInferenceVariables *priorArgs, const char *name)
Check for the existance of a correlation coefficient matrix and index for a parameter from the priorA...
void LALInferenceDrawFromPrior(LALInferenceVariables *output, LALInferenceVariables *priorArgs, gsl_rng *rdm)
Draw variables from the prior ranges.
void LALInferenceInitLIBPrior(LALInferenceRunState *runState)
Initialize the LIB prior based on command line arguments.
REAL8 LALInferenceFermiDiracPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 value)
Return the Fermi-Dirac distribution log prior.
int LALInferenceCheckGMMPrior(LALInferenceVariables *priorArgs, const char *name)
Check for a Gaussian Mixture Model prior.
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.
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.
int LALInferenceCheckGaussianPrior(LALInferenceVariables *priorArgs, const char *name)
Check for a Gaussian prior (with a mean and variance)
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.
int LALInferenceCheckFermiDiracPrior(LALInferenceVariables *priorArgs, const char *name)
Check for a Fermi-Dirac prior (with a r and sigma parameter)
int LALInferenceCheckLogUniformPrior(LALInferenceVariables *priorArgs, const char *name)
Check for a log-uniform prior (with xmin and xmax parameters)
UINT4 within_malmquist(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
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.
REAL8 LALInferenceInspiralSkyLocPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
Return the logarithmic prior density of the variables as specified for the sky localisation project (...
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...
REAL8 logGlitchAmplitudeDensity(REAL8 A, REAL8 Q, REAL8 f)
Return the log Prior for the glitch amplitude.
void LALInferenceRemoveGMMPrior(LALInferenceVariables *priorArgs, const char *name)
Remove a Gaussian Mixture Model prior.
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...
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 multivariat...
void LALInferenceRemoveLogUniformPrior(LALInferenceVariables *priorArgs, const char *name)
Function to remove the min and max values for the log-uniform prior from the priorArgs.
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.
void LALInferenceAddFermiDiracPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 *sigma, REAL8 *r, LALInferenceVariableType type)
Add a Fermi-Dirac prior.
REAL8 LALInferenceAnalyticNullPrior(LALInferenceRunState *runState, LALInferenceVariables *params, LALInferenceModel *model)
Prior that is 1 everywhere in component mass space.
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.
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.
Structure to constain a model and its parameters.
Structure containing inference run state This includes pointers to the function types required to run...
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...