Prior utilities

unified_utils.utils.make_prior_list(param_dict)

Function for constructing prior from the config file.

Parameters:

param_dict (dict) – Nested dictionary for parameters of model.

Returns:

prior_list (list) – List of scipy.stats distributions corresponding to the prior each parameter. Will have length equal to the number of parameters in param_dict.

unified_utils.utils.evaluate_prior(theta, prior_list)

Evaluate the log prior given a set of parameters and list of prior distributions for each parameter.

Parameters:
  • theta (array) – Parameter sets for which the prior should be evaluated. Should have shape (nsamp, nparam).

  • prior_list (list) – List of prior distribtuions for each parameter. Each element should be a class with .logpdf() method.

Returns:

lp (array) – Array with shape (nsamp,) containing the prior evaluation for each sample.

unified_utils.utils.jeff_counter_sys(theta, engine, kobs, cinv, fixed_vals, ng, km, jeff_names, prior_list=None, Om_AP=None, window=None, M=None, range_selection=None, additional_prior=False, gaussian_prior=None)

Funtion for evaluating Jeffreys prior.

Parameters:
  • theta (array) – Samples for which the prior should be evaluated. Should have shape (n_samples, n_params).

  • engine (class) – Prediction engine. Should have derivs_for_jeff method.

  • kobs (array) – Array of k-bins of the data being used.

  • cinv (array) – Inverse covaraince matrix being used.

  • fixed_vals (dict) – Dictionary containing any fixed values.

  • ng (float) – Number density of data being used.

  • km (float) – km value.

  • jeff_names (list) – List if names of parameters that have a Jeffreys prior.

  • prior_list (list) – Additional priors to be evaluated. If passed additional_prior must be set to True. Default is None.

  • additional_prior (bool) – Wheter or not to evaluate any additional priors. If True, prior_list must not be None. Default is False.

  • Om_AP (float) – The fiducial value of Om. Default is None. If a value is passed AP will be included in prediction.

  • window (array) – Window function matrix. If None predictions will not be convolved with the window function. Default is None. Om_AP and M must also be passed.

  • M (array) – Wide angle matrix. If None wide angle effects will not be included. If not None, Om_AP and window must also be passed. Default is None.

  • range_selection (array) – Array of boolean elements for imposing scale cuts. Only used if window and M are not None. Default is ``None.

  • gaussian_prior (array) – Gaussian prior to be inlcuded on the Fisher matrix when evaluating the Jefrreys prior.

Returns:

lp (array) – Array with shape (nsamp,) containing the prior evaluation for each sample.