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.statsdistributions corresponding to the prior each parameter. Will have length equal to the number of parameters inparam_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_jeffmethod.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_priormust be set toTrue. Default isNone.additional_prior (bool) – Wheter or not to evaluate any additional priors. If
True,prior_listmust not beNone. Default isFalse.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
Nonepredictions will not be convolved with the window function. Default isNone.Om_APandMmust also be passed.M (array) – Wide angle matrix. If
Nonewide angle effects will not be included. If notNone,Om_APandwindowmust also be passed. Default isNone.range_selection (array) – Array of boolean elements for imposing scale cuts. Only used if
windowandMare notNone. 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.