gravelamps.joint_model_selection

Strong Lensing Model Selection.

gravelamps.joint_model_selection.get_likelihood(metadata: dict, defaults: dict, interferometers: list[InterferometerList], generators: list[WaveformGenerator]) Likelihood

Get and initialise the likelihood class based on the given information from the JSON.

Parameters:
metadata: dict

Event specific settings.

defaults: dict

Defaults for all events.

interferometers: list[InterferometerList]

Interferometric data for all images in the event.

generators: list[WaveformGenerator]

Model specific waveform generators.

Returns:
Likelihood

Class that can generate the likelihood for the data to result from various parameters.

gravelamps.joint_model_selection.get_model_result(config: dict, metadata: dict, joint_result: JointResult, model_settings: dict, signal_interferometers: list[InterferometerList]) dict

Gets the model specific result including the samples and the evidences.

Parameters:
config: dict

Global settings.

metadata: dict

Event specific settings.

joint_result: JointResult

Results from model agnostic sampler.

model_settings: dict

Model specific settings.

signal_interferometers: list[InterferometerList]

Interferometric data for all images in the event.

Returns:
model_resultdict

Contains keys samples which is a dictionary containing keys of each parameter and the sampled values, and evidences which contains the evaluated evidence for each sample.

gravelamps.joint_model_selection.get_model_samples_and_interpolator(model_settings: dict, joint_result: JointResult) tuple[dict, Callable]

Produces the model specific samples from the model agnostic input and the specified settings as well as the posterior probability interpolator.

Parameters:
model_settings: dict

Model specific settings.

joint_result: JointResult

Results from model agnostic sampler.

Returns:
samples: dict

Contains keys corresponding to the model parameters with values containing the posterior samples.

interpolator: Callable

For given values of the lens model parameters returns the posterior probability.

gravelamps.joint_model_selection.main()

For a given multi-image result file and specified models, constructs model specific posteriors and calculates the evidence, concluding with a model selection.

gravelamps.joint_model_selection.make_result(metadata: dict, defaults: dict) JointResult

Create a JointResult object based on the given information from the JSON

Parameters:
metadata: dict

Event specific settings

defaults: dict

Defaults for all events

Returns:
pipeline_result: JointResult

Result implementation for pipeline.