A binary that a survey cannot resolve appears as a single, brighter source, and its inferred mass is biased high — so unresolved binaries distort the observed stellar mass function. This demo recovers the binary fraction from that distortion, and makes the central point: getting right requires the correct Moe & Di Stefano (2017) period–mass-ratio coupling Moe & Di Stefano, 2017, because the blended (close) binaries are a biased, high- subset that an independent- model gets wrong.
The forward model¶
Each binary has a primary (from a Maschberger IMF), a mass ratio () and a period ; the semimajor axis follows Kepler’s third law. A survey resolves wide pairs and blends close ones, (here ):
where is the Tout et al. (1996) ZAMS mass–luminosity relation
Tout et al., 1996 (provided in-package by progenax.stellar). The observed
mass function is a linear mixture in ,
with the single template (the IMF) and the binary template (per-binary expected catalogue stars after resolution + blending) precomputed from a large pool. is recovered by a per-bin Poisson MLE, with the Fisher variance from the (linear, ODE-free) information.
The controlled coupling test¶
The “independent” comparison uses the same pool with shuffled against — this preserves the and marginals exactly and changes only the – correlation. So any bias is attributable to the coupling alone. The truth is Moe-coupled; we fit with the (correct) Moe template and the (wrong) independent template.
Inputs and assumptions¶
The fit recovers one parameter, the binary fraction ; everything else is an assumed-known input. The recovered-vs-known split is the key onboarding lesson — the demo’s punchline (that the – coupling must be right) is a statement about one of those assumed inputs.
Table 1:Model inputs
Input | Meaning and role | Status (fiducial) |
|---|---|---|
Binary fraction — the science target, recovered from the Poisson mixture ( | recovered (truth 0.5) | |
Moe –– coupling | The joint orbital model ( | known / fixed (assumed correct) |
Minimum mass ratio in | known / fixed (0.1) | |
Resolution limit: pairs with semimajor axis blend, wider ones resolve (selects which binaries distort the MF). | known / fixed ( | |
Metallicity for the Tout ZAMS used to compute the blend mass . | known / fixed ( | |
IMF | Maschberger (, 0.08–): draws primaries , hence the single template and the blend masses. | known / fixed |
Systems in the mock cluster; sets the Poisson counts and the significance of the wrong-model systematic (). | known / fixed () | |
, | Template pool size (), mass-function bins (30 log bins), and PRNG seeds (templates / data / -shuffle). | numerical choices |
Result — freshly run, ALL PASS¶
Measured 2026-06-12 (, , AU, solar ; wall s; exit 0).
The mechanism. The blended (close-pair) subset is more equal-mass under Moe than under the decoupled model — median vs 0.479 — because Moe couples short periods to high . That is the whole effect.
model fitted | recovered | vs truth 0.500 |
|---|---|---|
Moe template (correct) | ✓ | |
independent template (wrong) | (≈5% low) |
Ignoring the – coupling biases low by ~5%. This is a systematic (a wrong-model error), so its fractional size is fixed while its significance grows as : only at , but at the survey scale here. At a real cluster survey it is unambiguous. Gate summary:
Check | Gate | Status |
|---|---|---|
mechanism: blended median (Moe > independent) | coupling present | PASS |
self-consistency (Moe template @ truth) | Poisson (2.76) | PASS |
recovery (Moe template) | (+0.22) | PASS |
bias (independent template) | (-3.6) | PASS |
Figure¶

Figure 1:Unresolved-binary mass function (scripts/demo_binary_mass_function.py, ALL
PASS). (a) The observed mass function (black) decomposed into singles (blue) and
the binary contribution (vermilion) — the blended pairs push a bump to higher
inferred mass. (b) The mechanism: the blended subset’s median is higher under
the Moe coupling (vermilion) than the -shuffled independent model (sky) at the
same marginals. (c) Recovered : the Moe template recovers the truth (dashed)
while the independent template is biased low.
Caveats¶
How to run¶
env -u VIRTUAL_ENV uv run --no-sync python scripts/demo_binary_mass_function.pyReferences¶
The binary –– coupling is Moe & Di Stefano (2017); the ZAMS mass–luminosity relation is Tout et al. (1996). The Moe and companion models are documented on the binary statistics theory pages.
- Moe, M., & Di Stefano, R. (2017). Mind your Ps and Qs: The interrelation between period (P) and mass-ratio (Q) distributions of binary stars. The Astrophysical Journal Supplement Series, 230, 15. 10.3847/1538-4365/aa6fb6
- Tout, C. A., Pols, O. R., Eggleton, P. P., & Han, Z. (1996). Zero-age main-sequence radii and luminosities as analytic functions of mass and metallicity. Monthly Notices of the Royal Astronomical Society, 281, 257. 10.1093/mnras/281.1.257