29 #ifndef _PROBABILITY_DENSITY_H
30 #define _PROBABILITY_DENSITY_H
41 #include <gsl/gsl_rng.h>
42 #include <gsl/gsl_randist.h>
45 #include <lal/LALDatatypes.h>
pdf1D_t * XLALCreateUniformPDF1D(REAL8 xMin, REAL8 xMax)
Creator function for a uniform 1D pdf over [xMin, xMax].
int XLALOutputPDF1D_to_fp(FILE *fp, const pdf1D_t *pdf, const char *name)
Function to write a pdf1D to given filepointer fp.
pdf1D_t * XLALCreateDiscretePDF1D(REAL8 xMin, REAL8 xMax, UINT4 numBins)
Creator function for a generic discrete 1D pdf over [xMin, xMax], discretized into numBins bins.
int XLALNormalizePDF1D(pdf1D_t *pdf)
Method to normalize the given pdf1D.
REAL8 XLALFindModeOfPDF1D(const pdf1D_t *pdf)
Find the 'mode' of the probabilty distribution, ie.
pdf1D_t * XLALCreateSingularPDF1D(REAL8 x0)
Creator function for a 'singular' 1D pdf, containing a single value with certainty,...
void XLALDestroyPDF1D(pdf1D_t *pdf)
Destructor function for 1-D pdf.
REAL8 XLALDrawFromPDF1D(pdf1D_t *pdf, const gsl_rng *rng)
Function to generate random samples drawn from the given pdf(x) NOTE: if the 'sampling' field is NULL...
int XLALCheckValidPDF1D(const pdf1D_t *pdf)
Checks internal consistency of pdf1D object.
Encode a pdf(x) as a discretized function probDens[i] = pdf( x[i] ) with user-specified bins xBin[i].
gsl_ran_discrete_t * sampling
internal: buffer preprocessed sampling distribution for drawing samples using gsl_ran_discrete()
BOOLEAN isNormalized
true if the prob is normalized, ie 1 = int P(x) dx ~ sum_i probDens[i] xBin[i]
REAL8Vector * probDens
N-dim vector of binned probability densities probDens[i] = prob( x in [ x[i],x[i+i] )/xBin[i]
REAL8Vector * xTics
N+1-dim vector of ordered x 'tics', i.e.