redback.multimessenger.create_joint_prior

redback.multimessenger.create_joint_prior(individual_priors: Dict[str, bilby.core.prior.PriorDict], shared_params: List[str], shared_param_priors: Dict[str, bilby.core.prior.Prior] | None = None) bilby.core.prior.PriorDict[source]

Create a joint prior dictionary from individual messenger priors.

This utility function helps construct a prior dictionary for joint multi-messenger analysis by combining individual priors and handling shared parameters.

Parameters:
  • individual_priors (dict) – Dictionary mapping messenger names to their PriorDict objects

  • shared_params (list of str) – List of parameter names that are shared across messengers

  • shared_param_priors (dict, optional) – Dictionary of prior objects for shared parameters. If not provided, the prior from the first messenger will be used.

Returns:

Combined prior dictionary for joint analysis

Return type:

bilby.core.prior.PriorDict

Examples

>>> optical_priors = bilby.core.prior.PriorDict({
...     'viewing_angle': bilby.core.prior.Uniform(0, np.pi/2),
...     'kappa': bilby.core.prior.Uniform(0.1, 10)
... })
>>> xray_priors = bilby.core.prior.PriorDict({
...     'viewing_angle': bilby.core.prior.Uniform(0, np.pi/2),
...     'log_n0': bilby.core.prior.Uniform(-5, 2)
... })
>>> joint_priors = create_joint_prior(
...     {'optical': optical_priors, 'xray': xray_priors},
...     shared_params=['viewing_angle']
... )