gravelamps.evidence.reweighting

Includes the reweighting calculations used for gravelamps_joint_model_selection.

gravelamps.evidence.reweighting.compute_evidences(samples: dict, posterior_interpolator: Callable, priors: PriorDict, likelihood: Likelihood) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Computes the updated sample evidences when reweighting from the model agnostic joint parameter estimation to model specific.

Parameters:
samples: dict

Contains parameter values for lens and source.

posterior_interpolator: Callable

Computes the posterior value for joint samples of the model specific parameters.

priors: PriorDict

Priors on both the source and lens parameters.

likelihood: Likelihood

Computes the likelihood for the signals generated with the parameters.

model_settings: dict

Model specific settings.

Returns:
ArrayLike

Evidence values for each sample.

gravelamps.evidence.reweighting.demagnify_samples(samples: dict, model_settings: dict) dict

Removes the magnification effects from the luminosity distance samples.

Parameters:
samples: dict

Parameter samples.

model_settings: dict

Model specific settings.

Returns:
smaples: dict

Updated parameter samples.

Raises:
KeyError

If there are no magnification settings.