gwpopulation_pipe.common_format.resample_events_per_population_sample

resample_events_per_population_sample(posterior, samples, model, n_draws)[source]

Resample the input posteriors with a fiducial prior to the population informed distribution. This returns a single sample for each event for each passed hyperparameter sample.

See, e.g., section IIIC of Moore and Gerosa for a description of the method.

Parameters:
posterior: pd.DataFrame

Hyper-parameter samples to use for the reweighting.

samples: dict

Posterior samples with the fiducial prior.

model: bilby.hyper.model.Model

Object that implements a prob method that will calculate the population probability.

n_draws: int

The number of samples to draw. This should generally be the number of events. This will return one sample per input event.

Returns:
observed_dataset: dict

The observed dataset of the events with the population informed prior.