Encode a pdf(x) as a discretized function probDens[i] = pdf( x[i] ) with user-specified bins xBin[i].
Probability-density function object type.
We store the actual probability *density values, such that prob(x in xBin[i]) = probDens[i] * xBin[i].
NOTE: Allows for some special encodings for simplicity and efficiency:
NOTE2: the optional field 'sampling' is used to buffer gsl-precomputed internals to allow using gsl_ran_discrete() to efficiently draw samples from that distribution (cost ~ O(1)). This field is only for internal use, and will be created automatically by XLALDrawFromPDF1D() if it's not initialized yet.
This could be made into an opaque type, such that only methods defined in ProbabilityDensity.c can operate on the internals of such objects. Everyone would only be able to pass them around. This requires lots more methods though to be useful, so for now this move is postponed.
Definition at line 65 of file ProbabilityDensity.h.
Data Fields | |
REAL8Vector * | xTics |
N+1-dim vector of ordered x 'tics', i.e. More... | |
REAL8Vector * | probDens |
N-dim vector of binned probability densities probDens[i] = prob( x in [ x[i],x[i+i] )/xBin[i] More... | |
BOOLEAN | isNormalized |
true if the prob is normalized, ie 1 = int P(x) dx ~ sum_i probDens[i] xBin[i] More... | |
gsl_ran_discrete_t * | sampling |
internal: buffer preprocessed sampling distribution for drawing samples using gsl_ran_discrete() More... | |
REAL8Vector* pdf1D_t::xTics |
N+1-dim vector of ordered x 'tics', i.e.
bin-boundaries {x[0], x[1], x[2], ... x[N]}
Definition at line 66 of file ProbabilityDensity.h.
REAL8Vector* pdf1D_t::probDens |
N-dim vector of binned probability densities probDens[i] = prob( x in [ x[i],x[i+i] )/xBin[i]
Definition at line 67 of file ProbabilityDensity.h.
BOOLEAN pdf1D_t::isNormalized |
true if the prob is normalized, ie 1 = int P(x) dx ~ sum_i probDens[i] xBin[i]
Definition at line 68 of file ProbabilityDensity.h.
gsl_ran_discrete_t* pdf1D_t::sampling |
internal: buffer preprocessed sampling distribution for drawing samples using gsl_ran_discrete()
Definition at line 69 of file ProbabilityDensity.h.