pdf2d

class beast.fitting.pdf2d.pdf2d(gridvals_p1, gridvals_p2, nbins_p1, nbins_p2, logspacing_p1=False, logspacing_p2=False, minval_p1=None, maxval_p1=None, minval_p2=None, maxval_p2=None)[source]

Bases: object

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

Parameters:
gridvals_p1, gridvals_p2 : ndarray

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

nbins_p1, nbins_p2 : int

number of bins to use for the 1D pdf

logspacing_p1, logspacing_p2 : bool, optional

whether to use logarithmic spacing for the bins

minval_p1, maxval_p1, minval_p2, maxval_p2 : 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

gen2d(self, gindxs, weights) Compute the 2D posterior PDFs based on the nD probabilities

Methods Documentation

gen2d(self, gindxs, weights)[source]

Compute the 2D 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:
vals_2d : ndarray

2D float array giving the bin pPDF values