hierarc.Diagnostics package

Submodules

hierarc.Diagnostics.goodness_of_fit module

class hierarc.Diagnostics.goodness_of_fit.GoodnessOfFit(kwargs_likelihood_list)[source]

Bases: object

Class to manage goodness of fit diagnostics.

kin_fit(cosmo, kwargs_lens, kwargs_kin)[source]

Plots the prediction and the uncorrelated error bars on the individual lenses currently works for likelihood classes ‘TDKinGaussian’, ‘KinGaussian’.

Parameters:
  • cosmo – astropy.cosmology instance

  • kwargs_lens – lens model parameter keyword arguments

  • kwargs_kin – kinematics model keyword arguments

Returns:

list of name, measurement, measurement errors, model prediction, model prediction error

plot_ddt_fit(cosmo, kwargs_lens, kwargs_kin, color_measurement=None, color_prediction=None, redshift_trend=False)[source]

Plots the prediction and the uncorrelated error bars on the individual lenses currently works for likelihood classes ‘TDKinGaussian’, ‘KinGaussian’.

Parameters:
  • cosmo – astropy.cosmology instance

  • kwargs_lens – lens model parameter keyword arguments

  • kwargs_kin – kinematics model keyword arguments

  • color_measurement – color of measurement

  • color_prediction – color of model prediction

  • redshift_trend – boolean, if True, plots as a function of redshift

Returns:

fig, axes of matplotlib instance

plot_ifu_fit(ax, cosmo, kwargs_lens, kwargs_kin, lens_index, bin_edges, show_legend=True, color_measurement=None, color_prediction=None)[source]

Plot an individual IFU data goodness of fit.

Parameters:
  • ax – matplotlib axes instance

  • cosmo – astropy.cosmology instance

  • kwargs_lens – lens model parameter keyword arguments

  • kwargs_kin – kinematics model keyword arguments

  • lens_index – int, index in kwargs_lens to be plotted (needs to be of type ‘IFUKinCov’)

  • bin_edges (numpy array or float.) – radial bin edges in arc seconds. If number, then uniform bin_edges sampled from 0

  • show_legend – bool, to show legend

  • color_measurement – color of measurement

  • color_prediction – color of model prediction

Returns:

figure as axes instance

plot_kin_fit(cosmo, kwargs_lens, kwargs_kin, color_measurement=None, color_prediction=None)[source]

Plots the prediction and the uncorrelated error bars on the individual lenses currently works for likelihood classes ‘TDKinGaussian’, ‘KinGaussian’.

Parameters:
  • cosmo – astropy.cosmology instance

  • kwargs_lens – lens model parameter keyword arguments

  • kwargs_kin – kinematics model keyword arguments

  • color_measurement – color of measurement

  • color_prediction – color of model prediction

Returns:

fig, axes of matplotlib instance

reduced_chi2(cosmo, kwargs_lens, kwargs_kin)[source]

Reduced chi^2 of fit.

Module contents