figaro.credible_regions module

figaro.credible_regions.ConfidenceArea(log_skymap, ra_grid, dec_grid, log_measure=None, adLevels=[0.5, 0.9])[source]

Compute the credible area(s) for a 2D probability distribution

Parameters:
  • log_skymap (np.ndarray) – probability density for each pixel

  • ra_grid (np.ndarray) – right ascension values used to build the grid

  • dec_grid (np.ndarray) – declination values used to build the grid

  • adLevels (iterable) – credible level(s)

Returns:

credible area(s) iterable: indices of pixels within credible area(s) np.ndarray: height(s) corresponding to credible area(s)

Return type:

np.ndarray

figaro.credible_regions.ConfidenceVolume(log_volume_map, ra_grid, dec_grid, distance_grid, log_measure=None, adLevels=[0.5, 0.9])[source]

Compute the credible volume(s) for a 3D probability distribution

Parameters:
  • log_volume_map (np.ndarray) – probability density for each pixel

  • ra_grid (np.ndarray) – right ascension values used to build the grid

  • dec_grid (np.ndarray) – declination values used to build the grid

  • distance_grid (np.ndarray) – luminosity distance values used to build the grid

  • adLevels (iterable) – credible level(s)

Returns:

credible volume(s) iterable: indices of pixels within credible volume(s) np.ndarray: height(s) corresponding to credible volume(s)

Return type:

np.ndarray

figaro.credible_regions.FindHeightForLevel(inLogArr, adLevels, logdd)[source]

Given a probability array, computes the heights corresponding to some given credible levels.

Parameters:
  • inLogArr (np.ndarray) – probability array

  • adLevels (iterable) – credible levels

  • logdd (double) – variables log differential (∑ log(dx_i))

Returns:

heights corresponding to adLevels

Return type:

np.ndarray

figaro.credible_regions.FindHeights(args)[source]

Find height correspinding to a certain credible level given a sorted array of probabilities and the corresponding cumulative

Parameters:

args (tuple) – tuple containing the sorted array, the cumulative array and a double corresponding to the credible level

Returns:

height corresponding to the credible level

Return type:

double

figaro.credible_regions.FindLevelForHeight(inLogArr, logvalue, logdd)[source]

Given a probability array, computes the credible levels corresponding to a given height.

Parameters:
  • inLogArr (np.ndarray) – log probability array

  • logvalue (double) – height

  • logdd (double) – variables log differential (∑ log(dx_i))

Returns:

credible level corresponding to logvalue

Return type:

np.ndarray

figaro.credible_regions.FindNearest_Grid(grid, value)[source]

Find the closest grid point to value.

Parameters:
  • grid (np.ndarray) – grid points (N_pts, N_dim), as with figaro.utils.recursive_grid

  • value (iterable) – value to locate

Returns:

grid index

Return type:

np.ndarray

figaro.credible_regions.FindNearest_Volume(ra, dec, dist, value)[source]

Find the pixel that contains the triplet (ra’, dec’, D’) stored in value.

Parameters:
  • ra (np.ndarray) – right ascension values used to build the grid

  • dec (np.ndarray) – declination values used to build the grid

  • dist (np.ndarray) – luminosity distance values used to build the grid

  • value (iterable) – triplet to locate (ra’, dec’, D’)

Returns:

grid indices of pixel

Return type:

np.ndarray