Population Reweighting
POSYDON allows you to reweight your populations after they have been evolved, based on the initial conditions of the binaries and single stars. This is a form of importance sampling: the weights are obtained from the ratio of the PDF of the target population to the PDF of the simulated population, evaluated at the initial conditions of each model.
The reweighting step is performed on a TransientPopulation object with the
get_model_weights method. The implementation expects the following initial
properties to be available in the population data:
S1_mass_i: initial primary massS2_mass_i: initial secondary massorbital_period_i: initial orbital periodstate_i: initial state, which is used to distinguish binaries from initially single stars
Supported initial-condition distributions
The reweighting implementation in posydon.popsyn.norm_pop currently supports
several distribution families. The table below summarizes the main options.
Initial condition |
Supported schemes |
Required parameters |
Notes |
|---|---|---|---|
Primary mass |
Any IMF class available in |
|
The scheme name is resolved dynamically from the IMF module. If it is not recognized, a flat distribution is used and a warning is emitted. |
Mass ratio |
|
For |
The flat mass-ratio distribution can be defined either from the allowed secondary-mass range or from explicit mass-ratio bounds. |
Orbital period |
|
For |
Periods are interpreted in days. Separation-based inputs are converted internally to periods using the orbital-separation relation. |
Binary fraction |
|
|
This is currently implemented as a constant binary fraction and is used to distinguish single-star and binary PDFs. |
How the weights are computed
The method evaluates the target PDF and the simulation PDF at the initial conditions of each system and computes
weights = (PDF_target / PDF_sim) * (mean_mass_sim / mean_mass_pop) * (1 / M_sim)
where M_sim is the total simulated mass, mean_mass_sim is the mean mass
of the simulated population, and mean_mass_pop is the mean mass of the
requested target population.
In practice, this means that the reweighted population is only meaningful when the target and simulation populations share the same support for the sampled initial-condition distributions. If the target distribution extends beyond the range covered by the simulation, you might miss systems!