Every other demo in this series recovers structure from the velocity channel
. This one recovers a King King, 1966 cluster’s concentration
from the observable a photometric survey actually delivers — the radial star
counts — and nothing else. It is the methods showcase for the Poisson
number-density channel (binned_number_density / poisson_loglike /
poisson_fisher_information).
The physics being recovered¶
A King lowered-isothermal model is fixed by two structural parameters:
— the dimensionless central potential (concentration). It sets the shape of the number-density profile in units of the core radius and the truncation ratio, summarized by the King concentration .
— the core radius, the physical scale at which the profile breaks.
So binned counts constrain both: the profile shape pins , the physical break radius pins . The forward model is Engine A — a single King-limit LIMEPY component Gieles & Zocchi, 2015 (): the coupled Poisson ODE gives , and the King volume density is the closed form
(limepy_density_hat), differentiable in through psi_grid. Beyond
the potential and the density is exactly zero — the hard
truncation that pins the outer profile, and the regime where the Poisson model
(honest counting errors on low-occupancy bins) matters most.
The likelihood¶
The expected counts are , with the
fraction of the model’s enclosed number in radial bin (the number-weighted
integral of over the bin). The data are the frozen counts;
gradients flow through the model only. The per-bin Poisson log-likelihood is
. The Fisher information is the
reverse-mode Poisson form
(poisson_fisher_information): the Engine A diffrax solve carries a custom_vjp,
so jax.hessian would crash — exactly the constraint that makes the
B2 demo use Gauss–Newton.
Inputs and assumptions¶
The fit recovers two parameters from star counts alone; the concentration is derived at the solution, not separately fit. Everything else is an assumed-known input or a numerical choice.
Table 1:Model inputs
Input | Meaning and role | Status (fiducial) |
|---|---|---|
Dimensionless central potential (concentration); sets the profile shape and . A science target. | recovered (6.0) | |
Core radius — the physical break scale. The second science target. | recovered (1.0 pc) | |
King concentration — reported at the MLE, derived from , not independently fit. | derived | |
LIMEPY truncation index fixed to the King limit. | known / fixed (1.0) | |
, | Stars sampled / Poisson normalization (); gravitational constant (STELLAR) for the sampling. | known / fixed |
bins, , , boxes | 20 log-spaced count bins; inner edge 0.10 pc (excludes the flat core); 3000-pt enclosed-number integration grid; sigmoid boxes (capped — the ODE hits | numerical choices |
, Adam, gates, seeds | 3 dispersed Adam starts (400 steps, lr 3e-2); gates self-consistency , recovery ; seeds (data / inits). | numerical choices |
Result — freshly run, ALL PASS¶
Measured 2026-06-12 ( stars, log-spaced bins over pc, three dispersed Adam starts; wall s; exit 0).
Parameter | Truth | Pull | |
|---|---|---|---|
(concentration) | 6.000 | +1.15 | |
(core radius) | 1.000 pc | pc | -0.47 |
Both within . Supporting diagnostics, same run:
King concentration recovered. at the MLE vs 1.255 at truth — the model’s relation is validated against King (1966) Table II on the King validation page.
Robust optimum. All three dispersed initializations converged to the identical loss .
Self-consistency. The analytic prediction at truth matches the binned counts to over the 20 bins — no oracle/binning bias.
The honest catch: counts alone are degenerate¶
The Gauss–Newton Fisher correlation is . The number-density profile alone leaves a strong – degeneracy: a more concentrated model () with a smaller core () reproduces almost the same count profile over the binned range. Both marginals are still tight (the demo recovers each to ), but the parameters are far from independent — the Fisher ellipse is a thin diagonal sliver (panel b). This is precisely the degeneracy the velocity channel breaks: adds the gravitational-mass / velocity-scale information that counts cannot supply, which is why the multi-channel demos (B2, B3) pin their parameters far more tightly. B11 isolates what the count channel can and cannot do on its own.
Figure¶

Figure 1:King concentration from star counts (scripts/demo_king_concentration.py,
ALL PASS). (a) The radial number-density profile: binned counts per shell
volume (points, errors) with the best-fit (vermilion) and truth (blue
dashed) King profiles, across the core-to-truncation dynamic range. (b) The
Fisher ellipse in : a thin diagonal sliver
() — the strong count-channel degeneracy — with the truth ★ inside,
near the MLE.
Caveats¶
How to run¶
env -u VIRTUAL_ENV uv run --no-sync python scripts/demo_king_concentration.pyReferences¶
The King lowered-isothermal model is King (1966); the LIMEPY family and the King limit are Gieles & Zocchi (2015). The Engine A construction and its validation against King (1966) Table II are documented on the populations and physics-tests pages.
- King, I. R. (1966). The structure of star clusters. III. Some simple dynamical models. The Astronomical Journal, 71, 64–75. 10.1086/109857
- Gieles, M., & Zocchi, A. (2015). A family of lowered isothermal models. Monthly Notices of the Royal Astronomical Society, 454, 576–592. 10.1093/mnras/stv1848