hierarc.Sampling.Distributions package

Submodules

hierarc.Sampling.Distributions.anisotropy_distributions module

class hierarc.Sampling.Distributions.anisotropy_distributions.AnisotropyDistribution(anisotropy_model, anisotropy_sampling, distribution_function, kwargs_anisotropy_min, kwargs_anisotropy_max, parameterization='beta')[source]

Bases: object

Class to draw anisotropy parameters from hyperparameter distributions.

draw_anisotropy(a_ani=None, a_ani_sigma=0, beta_inf=None, beta_inf_sigma=0)[source]

Draw Gaussian distribution and re-sample if outside bounds.

Parameters:
  • a_ani – mean of the distribution

  • a_ani_sigma – std of the distribution

  • beta_inf – anisotropy at infinity (relevant for GOM model)

  • beta_inf_sigma – std of beta_inf distribution

Returns:

random draw from the distribution

hierarc.Sampling.Distributions.lens_distribution module

class hierarc.Sampling.Distributions.lens_distribution.LensDistribution(lambda_mst_distribution='NONE', gamma_in_sampling=False, gamma_in_distribution='NONE', log_m2l_sampling=False, log_m2l_distribution='NONE', alpha_lambda_sampling=False, beta_lambda_sampling=False, alpha_gamma_in_sampling=False, alpha_log_m2l_sampling=False, log_scatter=False, mst_ifu=False, lambda_scaling_property=0, lambda_scaling_property_beta=0, kwargs_min=None, kwargs_max=None, gamma_pl_index=None, gamma_pl_global_sampling=False, gamma_pl_global_dist='NONE')[source]

Bases: object

Class to draw lens parameters of individual lens from distributions.

draw_lens(lambda_mst=1, lambda_mst_sigma=0, gamma_ppn=1, lambda_ifu=1, lambda_ifu_sigma=0, alpha_lambda=0, beta_lambda=0, gamma_in=1, gamma_in_sigma=0, alpha_gamma_in=0, log_m2l=1, log_m2l_sigma=0, alpha_log_m2l=0, gamma_pl_list=None, gamma_pl_mean=2, gamma_pl_sigma=0)[source]

Draws a realization of a specific model from the hyperparameter distribution.

Parameters:
  • lambda_mst – MST transform

  • lambda_mst_sigma – spread in the distribution

  • gamma_ppn – Post-Newtonian parameter

  • lambda_ifu – secondary lambda_mst parameter for subset of lenses specified for

  • lambda_ifu_sigma – secondary lambda_mst_sigma parameter for subset of lenses specified for

  • alpha_lambda – float, linear slope of the lambda_int scaling relation with lens quantity self._lambda_scaling_property

  • beta_lambda – float, a second linear slope of the lambda_int scaling relation with lens quantity self._lambda_scaling_property_beta

  • gamma_in – inner slope of the NFW profile

  • gamma_in_sigma – spread in the distribution

  • alpha_gamma_in – float, linear slope of the gamma_in scaling relation with lens quantity self._lambda_scaling_property

  • log_m2l – log(mass-to-light ratio)

  • log_m2l_sigma – spread in the distribution

  • alpha_log_m2l – float, linear slope of the log(m2l) scaling relation with lens quantity self._lambda_scaling_property

  • gamma_pl_list (list or None) – power-law density slopes as lists (for multiple lenses)

  • gamma_pl_mean – mean of gamma_pl of the global distribution

  • gamma_pl_sigma – sigma of the gamma_pl global distribution

Returns:

draw from the distributions

hierarc.Sampling.Distributions.los_distributions module

class hierarc.Sampling.Distributions.los_distributions.GEV(xi, mean, sigma)[source]

Bases: object

Draw from General Extreme Value distribution.

draw(n=1)[source]

Draws from the PDF of the GEV distribution.

Parameters:

n (int) – number of draws from distribution

Returns:

draws according to the PDF of the distribution

class hierarc.Sampling.Distributions.los_distributions.LOSDistribution(global_los_distribution=False, los_distributions=None, individual_distribution=None, kwargs_individual=None)[source]

Bases: object

Line of sight distribution drawing.

draw_bool(kwargs_los)[source]

Whether single-valued or extended distribution (need to draw from)

Parameters:

kwargs_los – list of keyword arguments for line of sight distributions

Returns:

boolean, True with samples need to be drawn, else False

draw_los(kwargs_los, size=1)[source]

Draw from the distribution of line of sight convergence.

Parameters:
  • kwargs_los (list of dict) – line of sight parameters

  • size (int>0) – how many samples to be drawn

Returns:

external convergence draw

Module contents