pdf1d

class beast.fitting.pdf1d.pdf1d(gridvals, nbins, logspacing=False, minval=None, maxval=None, uniqvals=None)[source]

Bases: object

Create an object which can be used to efficiently generate a 1D pdf for an observed object

Parameters:
gridvalsndarray

1D float array with the values of the quantity for all the grid points

nbinsint

number of bins to use for the 1D pdf

logspacingbool, optional

whether to use logarithmic spacing for the bins

minval, maxvalfloat, optional

override the range for the bins. this can be useful to make sure that the pdfs for different runs have the same bins

uniqvalsndarray, optional

unique values for the full physics grid

Methods Summary

gen1d(gindxs, weights)

Compute the 1D posterior PDFs based on the nD probabilities

Methods Documentation

gen1d(gindxs, weights)[source]

Compute the 1D posterior PDFs based on the nD probabilities

Parameters:
gindxsndarray

1D int array with the indxs of the weights in the full model grid

weightsndarray

1D float array with the fit probabilities (likelihood*prior) at each grid point

Returns:
bin_valsndarray

1D float array giving the values at the bin centers

vals_1dndarray

1D float array giving the bin pPDF values