Differentiable inference: natal cloud parameters from cluster substructure¶
A young star cluster is a fossil of the turbulent cloud that made it. Supersonic turbulence sets the density power spectrum; self-gravity carves the dense, collapsing tail; newborn stars trace that gas. So the cluster’s spatial substructure encodes the natal parameters — Mach number, turbulent forcing, density-PDF tail slope, and power-spectrum slope (see Density PDFs and the freefall-density factor for what each controls). The inference problem inverts the arrow of causation: observed substructure → natal cloud physics. This is galaxy-clustering-style inference applied to star clusters, with as the pivot (turbulence → density spectrum → stellar clustering).
This chapter develops the method in two settings: the 3-D gas-map inference (where the density-PDF tail slope becomes recoverable) and the projected 2-D star-map inference (the differentiable successor to the heuristic /MST substructure metrics for ).
The obstacle, and the breakthrough¶
The forward model is stochastic and full of non-differentiable steps: a rank sort imposes the density marginal, categorical sampling places stars, and a minimum-spanning-tree computes the Cartwright & Whitworth (Cartwright & Whitworth (2004)) substructure metric. You cannot backpropagate through it, so gradient-based inference looks impossible. The standard escape — simulation-based inference with a neural network Bairagi & Wandelt, 2026 — buries the physics and is simulation-hungry.
The breakthrough is the cosmology playbook: do not differentiate the simulator — predict the summary statistic analytically as a smooth function of , and differentiate that. Cosmologists never backpropagate through an -body simulation; they predict the matter power spectrum and fit it. Two facts make this exact here, not merely convenient:
A Gaussian random field is fully specified by its 1-point and 2-point statistics. A field that is a monotone map of a Gaussian likewise has vanishing higher-order correlations Neyrinck et al., 2011Carron & Szapudi, 2013, so the 1-point PDF and 2-point function are sufficient statistics. If inference uses only those, the phase-randomness of the model is not a misspecification — we use precisely the statistics it represents faithfully. This is the most powerful and the most honest use of the model.
The copula separates value from arrangement. The density values are an analytic function of on a fixed quantile grid; only sets the spatial arrangement. So of any permutation-invariant observable flows cleanly, and enters analytically through the spectrum.
The realization simulator is retained, but demoted: it is the ground-truth oracle that validates the analytic predictions, and the source of mocks and covariances. The CW04 metric is a validation/demo diagnostic (“we reproduce fractal clusters”), never a fit observable.
The 2-point carrier: Gaussianization and the Mehler series¶
The 2-point observable is the log-density correlation , where . We use the log density, not the linear density, by necessity: the fat power-law tail makes diverge for — the canonical collapsing slopes — so linear-density 2-point statistics are formally ill-behaved, while has finite variance for any . The log-density is also the information-optimal variable: Gaussianizing the field restores information to the two-point function Neyrinck et al., 2009, and the log transform is the optimal local Gaussianizer for a spectrum Carron & Szapudi, 2013.
The field is a Gaussian with spectrum , mapped monotonically to the BM19 marginal. For any monotone transform , the classic Gaussianization result Coles & Jones, 1991Szapudi & Pan, 2004 gives the transformed correlation as a Mehler/Hermite series — this is the single 2-point machinery the whole inference (3-D and projected) reuses:
with the probabilists’ Hermite polynomials and the normalized Gaussian correlation, . The coefficients are 1-D integrals of the copula map, smooth in ; is the Fourier transform of , analytic in . So is differentiable in all four parameters — no sort, no realization. The series converges by , and the predicted matches the realization oracle to . The projected version (below) feeds the same series a line-of-sight-summed map.
The stellar observable: counts-in-cells¶
Star positions are sampled from the density field, so the natural stellar observable is counts-in-cells (CIC): partition the field into cubic cells and count stars per cell. The count distribution is a local-Poisson average of the density PDF Szapudi & Pan, 2004Carron & Szapudi, 2014, and the cell count variance is
where is the mean count and is the cell-averaged 2-point function at cell scale . The Poisson term is shot noise; the clustering term carries (the integrated 2-point), while the shape of the count distribution (its over-dispersion) carries . Counts-in-cells is tail-robust (finite ), unlike the angular pair correlation, and the cell scale regularizes the fat tail.
The α wall¶
The tail slope — the rarest, densest, collapsing gas — resisted inference for two compounding reasons.
Stars do not carry . Cell-averaging smooths over the density peaks and shot noise buries what remains. An apparent -signal in star counts turned out to be a sampling artifact (multinomial, with-replacement sampling over fine cells); a clean inhomogeneous-Poisson sampler drops it to negligible. is a gas-density observable — it needs a dust / extinction / column-density map, not stars.
The finite-field truncation. To realize the field, the rank copula maps cell ranks to densities via , then . The largest density an -cell field can produce is . For a power-law tail ,
The realized tail is therefore truncated. Fitting the full infinite-tail BM19 PDF to a truncated mock biases high — the missing far-tail mass makes the realized slope look steeper. The posterior peaks near against a truth of 2.5, and goes flat for , where the tail holds essentially no cells.
The fix: peaks-over-threshold¶
The fix is the peaks-over-threshold (POT) estimator from extreme-value statistics — the mathematics of flood and insurance risk. The key fact is that the exponential is memoryless: above the transition the BM19 tail is exactly , so the exceedances above any fixed threshold are again exponential with rate . Keep only the gas cells above and model those exceedances as a truncated exponential on , with and :
Four properties make this the right tool — each is an assertion in the test suite:
Exact, not asymptotic. The lognormal normalization cancels in the conditional, so is read off the exceedance slope independent of . This breaks the – degeneracy that crippled the full-PDF fit.
Shift-immune. A global density zero-point shift moves , , and together; the exceedance is unchanged. The -block needs no normalization.
Geometry-free. It is a pure 1-point marginal — it never touches the spatial-correlation grid, so it carries no cross-grid forward bias.
Truncation modeled, not ignored. The normalizer accounts for the finite-field cutoff, removing the high- bias at its source.
The Fisher forecast¶
Because the exceedances are a clean truncated exponential, the Fisher information per exceedance is analytic:
As , , recovering the textbook Hill-estimator result . At achievable grids –3, so the truncation correction inflates by –; the forecast uses the corrected form. This converts the “wall” into an honest survey-design forecast: to measure to a target precision, you need a specific number of independent tail elements .
Putting it together: HMC recovery and forecast¶
The joint likelihood sums independent blocks — counts-in-cells Equation for and the POT exceedance likelihood Equation for — within the valid region . The free parameters are sampled in an unconstrained reparametrization with the No-U-Turn Sampler Hoffman & Gelman, 2014 via blackjax BlackJAX Developers, 2024; is fixed because the data constrain only through .
On a 1603 gas map (injection–recovery, ):
AC16 — joint recovery on an injected mock
parameter | posterior | truth | deviation |
|---|---|---|---|
5.0 | |||
3.0 |
The posterior width (0.112) matches the truncation-corrected Fisher (0.113) to — the likelihood is calibrated, not merely covering — and confirms the degeneracy is broken. The forecast (AC17) validates Equation to against independent draws, with the expected scaling (empirical slope -0.56 vs ideal -0.5).
import jax
import jax.numpy as jnp
from gravoturb.realization.copula import rank_copula_field
from gravoturb.realization.gaussian_field import gaussian_random_field
from gravoturb.theory.density_pdf import sigma_s_squared, transition_density
from gravoturb.diagnostics.measure import measure_exceedances
from gravoturb.inference.likelihood import tail_exceedance_loglike
from gravoturb.inference.fisher import sigma_alpha
mach, b, alpha, beta = 5.0, 0.4, 2.5, 3.0
key = jax.random.PRNGKey(0)
# one gas-density realization (the "observed" dust/extinction map)
s = rank_copula_field(gaussian_random_field((128, 128, 128), beta, key), mach, b, alpha)
# threshold in the power-law regime; reduce to exceedances above s_thr
s_thr = float(transition_density(alpha, sigma_s_squared(mach, b))) + 0.75
counts, edges, s_max, n_tail = measure_exceedances(s, s_thr, n_bins=12)
# the POT tail log-likelihood is differentiable in alpha (= theta[2])
theta = jnp.array([mach, b, alpha, beta])
ll = tail_exceedance_loglike(jnp.asarray(counts), jnp.asarray(edges), theta, s_thr, s_max)
forecast = sigma_alpha(alpha, s_max - s_thr, n_tail) # truncation-corrected sigma(alpha)
print(f"N_tail = {n_tail}, sigma(alpha) forecast = {float(forecast):.3f}")In projection: a differentiable β estimator (the Q/MST successor)¶
Real data are 2-D sky positions, not a 3-D gas cube. The projected setting runs the same cosmology playbook on a star map and yields one number — the natal turbulence slope — as the rigorous, differentiable successor to the heuristic /MST substructure metrics. The generative chain is
a Gaussian field → log-density → density → projected (column) density → star counts . Every arrow after the first either destroys information about or breaks the statistical properties an estimator needs. The art is finding the summary whose mean is analytic in and whose likelihood is tractable.
Why the obvious estimator fails¶
The natural summary is the angular power spectrum (band-powers) of the count map. A band-power is quadratic in the field — an average of squared Fourier amplitudes. For a Gaussian field each is , so the band-power’s skewness is and falls as you go to smaller scales. The measured band-powers do the opposite: their skewness grows with and is so heavy-tailed that the sample estimate is dominated by the single largest realization. A statistic whose skew grows with at large is reflecting the field’s own non-Gaussianity: the BM19 power-law tail puts rare, dense clumps into the map, and those clumps dominate the small-scale power (a large connected trispectrum). A Gaussian likelihood on these raw band-powers is therefore structurally mis-specified, and no covariance or mean correction repairs a wrong distribution shape. The textbook analytic rescues (Hamimeche–Lewis-style transforms, a lognormal likelihood) assume Gaussian-field (Wishart) band-power statistics; because the offending non-Gaussianity is in the field, they under-correct exactly in the high- tail. The fix must be a better observable, not a cleverer likelihood.
The right observable: the log₊ map¶
The information about , and the Gaussianity, both live in the log-density. In -space the band-power slope tracks almost perfectly; the exponentiation is what compresses the slope and manufactures the heavy tail. So the observable should undo the exponentiation. The Neyrinck et al. (2009) “” transform does exactly that on a count map:
a count-safe logarithm ( the mean count). Measuring its band-powers, the per-bin skewness is driven to across all but the lowest — a bona fide Gaussian-likelihood target. Two properties make decisively better than rank-Gaussianization (the transform an earlier attempt used): it is deterministic and differentiable (a fixed function of , not a non-differentiable sort), and its forward-model transfer is -stable, so the -response can stay analytic rather than being a fitted, noisy surface — the precise failure mode that mis-calibrated the earlier estimator.
The analytic forward model and shot transfer¶
We predict the mean log₊ band-power as a smooth, differentiable function of and fit it (the same cosmology playbook — predict the statistic, never backpropagate the simulator). The clustering backbone is the analytic projected log-density 2-point: take the log-density Mehler series Equation, project it along the line of sight (a discrete Limber sum), and bin in . Call this ; it is exact for the field, reproducing the projected-log-density slope to better than 1 % across the whole prior.
At high stellar density the observable’s mean is times a -independent per-bin transfer calibrated once at a fiducial , ; because carries the -response and is constant, the slope information is never fitted. At low stellar density Poisson noise suppresses the -response by a -dependent amount, so the shot is modeled analytically instead of fitted. Conditioning on the gas field, two pixels’ counts are sums over disjoint independent Poisson cells, so the autocovariance of splits exactly into a clustering piece and a single zero-lag (white) piece:
with the Poisson smoothing of the log (at large counts it returns , slope ; at small counts it bends over — that bend is the shot suppression, in closed form) and the conditional variance (the familiar white shot floor). Since is a pointwise transform of , the same Mehler machinery Equation gives — just fed the new map. The single modelling approximation is the marginal of used to build : a line-of-sight sum of correlated lognormals is itself approximately lognormal Coles & Jones, 1991, matched to the analytic mean and variance of . Everything else is exact.
The payoff: is fully analytic and differentiable in at any stellar density — the shot’s -dependence comes from the physics, never from a fitted surface. With a fixed-fiducial Hartlap-corrected covariance and a logit-reparametrized NUTS sampler, it passes simulation-based calibration Talts et al., 2018: single-cluster β rank-uniformity at high density, with per cluster set by cosmic variance (it tightens only by stacking, not by adding stars). Where the projected-density marginal defeats a closed-form model (the lowest densities), a flow-based neural posterior Bairagi & Wandelt, 2026 on the same log₊ summary learns the marginal implicitly and calibrates; the two agree where they overlap and are reported together (analytic backbone + flow extension). The relevant validation scripts and SBC numbers are first-hand and re-runnable; see Gravoturbulent + PP20 validation for the current validation status and how to reproduce them.
Caveats and domain of validity¶
These define what the method does not claim.
Injection–recovery, not real data. AC16 draws the mock from the same BM19 model it fits. It validates the inference machinery (likelihood + sampler), not that real clouds carry this exact tail. The model is BM19 by assumption.
The correlation penalty (the dominant real-world limit). The forecast assumes independent tail elements. A real field’s tail cells are spatially clustered — the dense gas sits in coherent peaks — so the realized scatter is the i.i.d. bound, i.e. . A real map needs more tail resolution elements than the naive count, analogous to correlated-mode inflation in galaxy surveys.
requires a gas-density tracer with enough dynamic range to resolve the tail.
– degeneracy. The data constrain only through ; the 4-parameter Fisher is rank-3 singular. Fix (or constrain it independently) to recover .
2-D projection. Real data are 2-D sky positions. The Limber projection introduces cluster distance/depth as a nuisance; the projected PDF is narrower than the volumetric one. In pure 2-D the tail slope is depth-gated (line-of-sight averaging Gaussianizes the 1-point tail), while per cluster is cosmic-variance limited — improving as only by stacking clusters.
Phase-random model. Valid for 1pt+2pt inference, but do not invert higher-order / morphological statistics — real clouds have genuine filamentary phase coherence the GRF cannot produce. The 3-point function is reserved as a held-out null test and filament detector.
Relative over absolute. Absolute mapping needs validation against real gravo-turbulent simulations. Population trends and Fisher forecasts are far more defensible than absolute per-cluster Mach numbers.
Example science questions¶
Natal turbulence of clusters. Infer from observed substructure across thousands of LSST clusters: how supersonic was the gas that made each cluster?
The collapse state . From Herschel/JWST/extinction column-density maps, measure the density-PDF tail slope — the fraction of gas actively collapsing, tied to star-formation efficiency.
(environment). Does natal turbulence vary with galactocentric radius, surface density, metallicity, or cluster mass? A hierarchical Bayesian study over the cluster population.
Joint . Do turbulence morphology and the IMF share an environmental driver?
Substructure as a clock. With a differentiable -body engine, separate the initial from dynamical age in a single snapshot.
Survey design. The forecast answers “to measure to in this cloud, you need a gas map with independent tail elements” — a concrete depth and resolution.
Implementation, validation & references¶
In code: the inference layer is
src/experimental/gravoturb/inference/(likelihood.py,fisher.py,hmc.py,priors.py,projected_logp.py,covariance.py,flow_npe.py,sbc.py), with the field generator insrc/experimental/gravoturb/realization/and the 2-point machinery insrc/experimental/gravoturb/theory/log_correlations.py. This experimental subsystem is repo-only with no generated website API page; the module reference is the package source and itsVALIDATION_SUMMARY.md.Validated in: gravoturbulent PP20 (current validation status); the AC16/AC17 acceptance assertions cover the α recovery and the σ(α)-vs- forecast.
Primary sources: the density-PDF framework is Federrath & Klessen (2012) and Burkhart & Mocz (2019), the dense-gas SFR formalism Burkhart (2018); the fractal density field follows Lomax et al. (2018) with the density-spectrum slope from Kim & Ryu (2005); the Gaussianization/Mehler machinery is Coles & Jones (1991) and Szapudi & Pan (2004), with the information-theoretic basis in Neyrinck et al., 2009Neyrinck et al., 2011Carron & Szapudi, 2013Carron & Szapudi, 2014 and FFT estimators from Carron et al., 2014Szapudi et al., 2005; the substructure metric is Cartwright & Whitworth (2004). Inference uses the No-U-Turn Sampler Hoffman & Gelman, 2014 via blackjax BlackJAX Developers, 2024 on Bradbury et al., 2018; SBC follows Talts et al. (2018); the SBI alternative is Bairagi & Wandelt (2026). Full notes in the bibliography.
- Cartwright, A., & Whitworth, A. P. (2004). The statistical analysis of star clusters. Monthly Notices of the Royal Astronomical Society, 348, 589–598. 10.1111/j.1365-2966.2004.07360.x
- Bairagi, A., & Wandelt, B. D. (2026). PatchNet: A hierarchical approach for neural field-level inference from Quijote simulations. Journal of Cosmology and Astroparticle Physics, 2026(03), 028. 10.1088/1475-7516/2026/03/028
- Neyrinck, M. C., Szapudi, I., & Szalay, A. S. (2011). Rejuvenating Power Spectra. II. The Gaussianized Galaxy Density Field. The Astrophysical Journal, 731, 116. 10.1088/0004-637X/731/2/116
- Carron, J., & Szapudi, I. (2013). Optimal non-linear transformations for large-scale structure statistics. Monthly Notices of the Royal Astronomical Society, 434, 2961–2970. 10.1093/mnras/stt1215
- Neyrinck, M. C., Szapudi, I., & Szalay, A. S. (2009). Rejuvenating the Matter Power Spectrum: Restoring Information with a Logarithmic Density Mapping. The Astrophysical Journal Letters, 698, L90–L93. 10.1088/0004-637X/698/2/L90
- Coles, P., & Jones, B. (1991). A lognormal model for the cosmological mass distribution. Monthly Notices of the Royal Astronomical Society, 248, 1–13. 10.1093/mnras/248.1.1
- Szapudi, I., & Pan, J. (2004). On Recovering the Nonlinear Bias Function from Counts-in-Cells Measurements. The Astrophysical Journal, 602, 26–37. 10.1086/380920
- Carron, J., & Szapudi, I. (2014). Sufficient observables for large-scale structure in galaxy surveys. Monthly Notices of the Royal Astronomical Society Letters, 439, L11–L15. 10.1093/mnrasl/slt167
- Hoffman, M. D., & Gelman, A. (2014). The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15, 1593–1623.
- BlackJAX Developers. (2024). BlackJAX: A sampling library for JAX. https://github.com/blackjax-devs/blackjax
- Talts, S., Betancourt, M., Simpson, D., Vehtari, A., & Gelman, A. (2018). Validating Bayesian Inference Algorithms with Simulation-Based Calibration. https://arxiv.org/abs/1804.06788
- Federrath, C., & Klessen, R. S. (2012). The star formation rate of turbulent magnetized clouds. The Astrophysical Journal, 761, 156. 10.1088/0004-637X/761/2/156
- Burkhart, B., & Mocz, P. (2019). The self-gravitating gas fraction and the critical density for star formation. The Astrophysical Journal, 879, 129. 10.3847/1538-4357/ab25ed
- Burkhart, B. (2018). The Star Formation Rate in the Gravoturbulent Interstellar Medium. The Astrophysical Journal, 863, 118. 10.3847/1538-4357/aad002
- Lomax, O., Bates, M. L., & Whitworth, A. P. (2018). Modelling the structure of star clusters with fractional Brownian motion. Monthly Notices of the Royal Astronomical Society, 480, 371–380. 10.1093/mnras/sty1788