Skip to content

Commit

Permalink
bug fix to propagate normalized likelihood and make sure when samplin…
Browse files Browse the repository at this point in the history
…g with a variable part in the uncertainty (sigma_v_systematics) it automatically sets the normalization=True
  • Loading branch information
sibirrer committed Oct 31, 2023
1 parent 9642a12 commit d442686
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hierarc/Likelihood/cosmo_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, kwargs_likelihood_list, cosmology, kwargs_bounds, sne_likelih
alpha_lambda_sampling=False, beta_lambda_sampling=False,
lambda_ifu_sampling=False, lambda_ifu_distribution='NONE', sigma_v_systematics=False,
sne_apparent_m_sampling=False, sne_distribution='GAUSSIAN', z_apparent_m_anchor=0.1,
log_scatter=False,
log_scatter=False, normalized=False,
anisotropy_model='OM', anisotropy_distribution='NONE', custom_prior=None, interpolate_cosmo=True,
num_redshift_interp=100, cosmo_fixed=None):
"""
Expand Down Expand Up @@ -69,10 +69,14 @@ def __init__(self, kwargs_likelihood_list, cosmology, kwargs_bounds, sne_likelih
:param interpolate_cosmo: bool, if True, uses interpolated comoving distance in the calculation for speed-up
:param num_redshift_interp: int, number of redshift interpolation steps
:param cosmo_fixed: astropy.cosmology instance to be used and held fixed throughout the sampling
:param normalized: bool, if True, returns the normalized likelihood, if False, separates the constant prefactor
(in case of a Gaussian 1/(sigma sqrt(2 pi)) ) to compute the reduced chi2 statistics
"""
self._cosmology = cosmology
self._kwargs_lens_list = kwargs_likelihood_list
self._likelihoodLensSample = LensSampleLikelihood(kwargs_likelihood_list)
if sigma_v_systematics is True:
normalized = True
self._likelihoodLensSample = LensSampleLikelihood(kwargs_likelihood_list, normalized=normalized)
self.param = ParamManager(cosmology, ppn_sampling=ppn_sampling, lambda_mst_sampling=lambda_mst_sampling,
lambda_mst_distribution=lambda_mst_distribution,
lambda_ifu_sampling=lambda_ifu_sampling,
Expand Down

0 comments on commit d442686

Please sign in to comment.