Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pdf1D_t Struct Reference

Detailed Description

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:

  • one x0 known with certainty: pdf(x) = delta(x-x0): ==> xTics = {x0}, probDens=NULL
  • uniform pdf over [xMin,xMax]: pdf(x) = const. ==> xTics = {xMin, xMax}, probDens=NULL

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

REAL8VectorxTics
 N+1-dim vector of ordered x 'tics', i.e. More...
 
REAL8VectorprobDens
 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...
 

Field Documentation

◆ xTics

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.

◆ probDens

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.

◆ isNormalized

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.

◆ sampling

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.