The released IMF samplers — piecewise power-law (Salpeter (1955),
Kroupa (2001)), the Chabrier (2003) lognormal+power-law, and the
Maschberger (2013) smooth bridging form — plus the internal
TaperedPowerLaw and Schechter variants (used inside the package; not in the
public progenax.__all__) — sampled by exact inverse-CDF (no rejection). Test file:
tests/validation/test_imf_physics.py (see the test dashboard
for the live per-suite count); figures:
scripts/validate_imfs.py (5 figures, PASS/FAIL per panel, PNG + PDF). Theory at
Classical IMFs (Salpeter, Kroupa, Chabrier, Maschberger).
What is verified¶
Each row maps to assertions in test_imf_physics.py. Measured values are
regenerated by scripts/validate_imfs.py ( samples, seed 42; KS at
).
Property | Tolerance (as tested) | Measured | Anchor |
|---|---|---|---|
Salpeter slope recovered (sample MLE) | |||
Kroupa 3 segment slopes recovered | |||
Chabrier high-mass tail slope | |||
Maschberger asymptotic slope | |||
PDF coverage (hist vs analytic ) | median rel | Chabrier / Kroupa / Maschberger | |
CDF goodness-of-fit (KS) | Salpeter / Maschberger / Chabrier | ||
KS -value | consistent with exact sampling | ||
| rel (6 IMFs) | independent reference integral | |
Linear-grid failure mode (adversarial) | log grid linear grid | vs | steep low-mass spike |
Inference-layer gradient (AD vs FD) | rel err |
| |
Truncated power-law clipping | all samples in | no rejection (inverse CDF) |
|
Figures¶
Generated by scripts/validate_imfs.py (PASS/FAIL per panel; PNG + PDF vector).

Figure 1:Recovered slopes (headline). Sampling 105 stars and re-fitting the slope by bounded-power-law maximum likelihood recovers every published along the line: Salpeter 2.35, the three Kroupa segments , the Chabrier high-mass tail 2.3, and the Maschberger asymptotic 2.3. Error bars are bootstrap standard errors — wide for Maschberger because only stars exceed in the window. The four near-coincident points at the top right all sit at –2.35.

Figure 2:PDF shape coverage. Sampled histograms (points) overlay the analytic (solid) across the full mass range for (a) the Chabrier lognormal+power-law, (b) the Kroupa piecewise power law, and (c) the Maschberger smooth bridging form — median relative deviation in every case. The lognormal turnover, the segment breaks at 0.08 and , and the smooth peak are all reproduced.

Figure 3:CDF coverage and the KS test. Empirical CDFs (points) lie on the analytic (solid) for both the analytic-PPF samplers (Salpeter, Maschberger) and the Newton-PPF sampler (Chabrier). The Kolmogorov–Smirnov statistic is below the 0.05 critical value in all three cases () — the samples are statistically consistent with the exact distributions, including the iterative Chabrier inverse.

Figure 4:Mean-mass accuracy and the linear-grid failure mode (adversarial). (a) The
differentiable mean_mass() matches a 200k-point log-grid reference to
for all six IMFs — exact () for the closed-form
power laws. (b) Why the log grid matters: estimating for the steep
Salpeter spike on a linear grid stalls at error even at
points, while the log grid converges to 10-6. This is the documented reason the
implementation never uses a linear-grid trapezoid.

Figure 5:Inference-layer gradient validation. For the differentiable IMFParams
likelihood, autodiff (line) and central finite difference (circles) of
NLL agree to max rel err for (a) the
high-mass slope and (b) . The gradient’s zero crossing (star)
is the maximum-likelihood slope, recovering the input (2.32, 2.31 vs the
generating 2.30) — so the IMF can be fit by gradient descent / HMC.
Differentiability¶
All IMF sampling uses exact inverse-CDF with a fixed iteration count (analytic for
the power laws and Maschberger; a 30-step Newton solve for Chabrier), so gradients
flow through both the samples (reparameterization) and the structural parameters.
The progenax.imf.differentiable layer (log_prob_masses,
sample_masses_from_params, individual_mass_nll over IMFParams) is the
gradient-based inference target validated in Figure 5.
How to run¶
# physics tests (~8 s on CPU)
pytest tests/validation/test_imf_physics.py -q
# regenerate the five figures with PASS/FAIL tables
python scripts/validate_imfs.pyWhat this suite does not test¶
Binary contamination bias — the forward model + binary-aware likelihood are covered separately at Binary-aware IMF validation.
Environment dependence — the IGIMF /
BirthEnvironmentmapping is documented at Environment-dependent IMFs but is not part of this validation suite.
References¶
Salpeter (1955), Kroupa (2001), Chabrier (2003), Maschberger (2013). Per-paper notes in the bibliography; theory at Classical IMFs (Salpeter, Kroupa, Chabrier, Maschberger).
- Salpeter, E. E. (1955). The luminosity function and stellar evolution. The Astrophysical Journal, 121, 161–167. 10.1086/145971
- Kroupa, P. (2001). On the variation of the initial mass function. Monthly Notices of the Royal Astronomical Society, 322, 231–246. 10.1046/j.1365-8711.2001.04022.x
- Chabrier, G. (2003). Galactic stellar and substellar initial mass function. Publications of the Astronomical Society of the Pacific, 115, 763–795. 10.1086/376392
- Maschberger, T. (2013). On the function describing the stellar initial mass function. Monthly Notices of the Royal Astronomical Society, 429, 1725–1733. 10.1093/mnras/sts479