pdf1d

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

Bases: object

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

Parameters:
gridvals : ndarray

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

nbins : int

number of bins to use for the 1D pdf

logspacing : bool, optional

whether to use logarithmic spacing for the bins

minval, maxval : float, optional

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

Methods Summary

gen1d(self, gindxs, weights) Compute the 1D posterior PDFs based on the nD probabilities

Methods Documentation

gen1d(self, gindxs, weights)[source]

Compute the 1D posterior PDFs based on the nD probabilities

Parameters:
gindxs : ndarray

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

weights : ndarray

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

Returns:
bin_vals : ndarray

1D float array giving the values at the bin centers

vals_1d : ndarray

1D float array giving the bin pPDF values