utils.define_density_mass_grid

utils.define_density_mass_grid(density, num_levels=None)

Create a grid of density levels with a uniform number of points between each level.

Parameters:

density : numpy array[float] or list[float]

Values of a density estimate.

num_levels : int, optional

Number of density levels in the grid. This is essentially the vertical resolution of a level set tree built from the ‘density’ input.

Returns:

levels : numpy array

Grid of density levels that will define the iterations in level set tree construction.

Notes

  • The level set tree is constructed by filtering a similarity graph according to this grid. This function simply defines the density levels, but it does not do the actual tree construction.