5. Inference
The model is a hierarchical generative model of a whole animal.
Genome / transcriptome priors ─┐
EM connectome (G, morphology) ─┤
Developmental wiring model ────┼─▶ per-type programs Φ_c ─▶ z_i(t₀) ~ p₀,c ─▶ regulation along the schedule ─▶ θ_i (per neuron)
Latent edges (gap, peptide) ───┘ │
▼
stimulus / optogenetics / mutation ─▶ closed-loop simulation ─▶ indicator + behavior forward models
│
▼
likelihood vs. raw fluorescence, ephys, behavior
Because initial states are random, the model predicts a distribution over neurons and animals, not one parameter set. Likelihoods marginalize over initial states, developmental-schedule samples and set-point jitter. Within-type and between-animal variability in the data are therefore evidence about Φ, not nuisance.
Conditioned prediction. For an observed animal, maintain a joint posterior over programs Φ, fast neural/body state x_t and slow regulatory/plastic state z_t, conditioned only on the recordings permitted by the task up to its declared cutoff. Forecast interventions by propagating that posterior through the closed loop and observation model. Similar present activity can correspond to different history-dependent states; ensemble predictions must retain that uncertainty. Compact history coordinates may replace part of z_t only after their predictive sufficiency and observability are tested on held-out histories and interventions. A0 establishes such coordinates for its synthetic endpoint calculation, but does not infer them from recordings or establish their sufficiency for arbitrary transients. The mathematical target, proposed experiments and separation of assimilation from forecasting are in 11-prediction-and-history.md.
-
Parameters inferred:
- Φ (per-type regulatory programs): set points s*_c; the gain subspace U_c (a point on the Grassmannian); gain rates and mixing C_c (from transient data only); leak D_c; the initial-state distribution p₀,c (mean and covariance Σ₀,c); set-point jitter Σ_η,c; learned-rule parameters;
- latent edge sets (L4, L5);
- global physics (temperature, extracellular composition);
- uncertainty in morphology corrections.
-
Methods (computational details in 06-compute.md §5–7):
- Differentiable simulation (JAX). Gradients through the selected regulation equilibrium use implicit differentiation of the slice equation where its validity conditions hold; trajectory data and invalid cases use the adjoint of the averaged slow dynamics (06-compute.md §5.5–§6).
- Fitting staged by timescale: linear-response initialization, then short-horizon data (E1, E2) with ordinary gradients, then long-horizon statistics (E3, regulation targets) with shadowing gradients. Multiple shooting and teacher forcing on recorded neurons control chaotic divergence.
- Latent edges as continuous variables with sparsity priors, fitted by gradients. Simulation-based inference (neural posterior estimation) only for what remains non-differentiable: a shortlist of contested discrete edges, and stochastic release where needed.
- Body replay during fitting: recorded kinematics and sensory input replace the body inside the gradient loop; the closed loop is used for burn-in and evaluation (E4, E5).
- Optimizer for sloppy models: geodesic Levenberg–Marquardt in the stiff subspace.
- Posteriors, not point fits: full ensembles for the worm; stiff-subspace sampling plus Laplace approximation for the fly; multilevel Monte Carlo across fidelity levels. Predictions report credible intervals.
-
Sloppiness analysis: compute the Fisher information / Hessian spectrum at the posterior mode to find the stiff directions. Report which experiments constrain them.
-
Identifiability known in advance. Some non-identifiabilities follow from the structure of regulation (04-physics.md, L7) and are not treated as fitting failures:
- equilibrium data carry no information about the gain rates C_c, including a common rescaling of all regulation rates; only transients (F3, F7 time courses) do;
- equilibrium data constrain gains only through their range, U_c;
- initial-state spread Σ₀,c is visible only in the directions P projects onto (null(J)); the sensor-controlled directions reveal only set-point and input variability.
The M3 gate reports identifiability separately for the equilibrium-identifiable parameters (s*_c, U_c, p₀,c) and the transient-identifiable ones (C_c, D_c), for each experiment type.
-
Developmental wiring. Connectomes from different animals at different ages are combined in a probabilistic developmental wiring model: an age trend plus individual deviation, with the deviation's variance estimated from same-stage datasets (04-physics.md, L7). Developmental histories are sampled from it, never taken as one interpolated path.
-
Channel presence. Genes enter with spike-and-slab priors whose inclusion probabilities come from transcriptome detection evidence (04-physics.md, L2). Posterior inclusion probabilities are reported per type and gene, as predictions that electrophysiology and reporters can test.
-
Information budget. Numerical tolerances in fitting and prediction are shares of a per-task budget in nats of detectable change in the dataset distribution (12-information-budget.md); expected information gain in experiment design uses the same units.
-
Closed-loop experiment design (active learning): rank candidate perturbations (which neuron to stimulate, which mutant, which drug, which neurons to image) by expected information gain on stiff directions and on high-uncertainty latent edges. Export them as an experiment proposal queue for collaborating labs. Per Beiran & Litwin-Kumar, the expected number of recorded neurons needed scales with the dimensionality of the dynamics. We measure this empirically.