Mathematical modelling
GeoStack · lens 3 of 5 · 1 December 2026
Abstract¶
The modelling cycle: two tracks meet at compare. A random misfit runs the inner loop, which re-estimates the state and the parameters. A systematic one runs the outer loop, which revises the model’s hypotheses one rung at a time, or the observing system. Below it, the six-step cycle takes a model from simple to fast, and the hypothesis ladder, after Hoshin Gupta, says what the outer loop revises and how to tell which rung a misfit points at.
Data assimilation spans three repos (the model in pyrox-ssm, the algorithms in filterax and vardax, the loop in pipekit-cycle) because each piece sits on its own rung.
| Step | Libraries | Shelf |
|---|---|---|
| Equations | geophysix for the physical terms | physics |
| Discretised | gridax, spectraldiffx | physics |
| Model → predictions | sesmax, radtrax, plumax | assemble |
| Measurements | geoproducts reads them, geocatalog indexes them | data |
| Retrievals | radiomax: radiometry, spectral response, empirical retrievals | physics |
| Regridded → observations | geoops (reproject, resample) | data |
| Compare | geocatalog.matchup pairs predictions with observations in space and time; pipekit-evaluate, diagnostix score them | orchestrate ① |
| Inner loop | state: filterax, vardax, pyrox-ssm; parameters: argminax, pyrox; run by pipekit-cycle | fit |
| Outer loop | you climb the hypothesis ladder: the uncertainty, the process forms, the architecture or the conservation laws, or the observing system; no library compares structures yet ④ | people |
Where it doesn’t fit¶
[1] Evaluation is split. Compare uses both pipekit-evaluate and diagnostix; see note 3 on the scientific-ML page.
[?] One placement is my reading. geoops as the regridding step on the observing track. The matchup under compare is confirmed: it is
geocatalog.matchup, in the data-engineering lens.
The six-step cycle: from a simple model to a fast one¶
The modelling cycle says which loop to run; the six-step cycle says how to make running it cheap, one step of model complexity at a time. Let be what is inferred (the state included), the forward model, the observation operator and the observation error.
Each learned step is scored against the earlier step that computes the same thing: the emulator against the simulator, both fast inversions against step 2, the oracle. Moving down, a query falls from hours to milliseconds, because training is paid once, up front.
1 · Simple model and ; simulate pairssesmax · plumax · radtrax
2 · Model-based inferencethe oracle: DACycle + filterax · vardax · pyrox
3 · Emulator fitted to SimulationDataset · geonnaxModelRegistry
4 · Emulator-based inferencestep 2 with in place of DACycle + NeuralForward
5 · Amortized inference, one passpipekit-train · gauss_flows · pyroxvardax AmortizedPosterior
6 · Improvererun, compare row by row, change one steppipekit-evaluate Benchmark · ReferenceRule
Solid arrows on the left: trained on step-1 simulations. Dashed arrows on the right: scored against. The tag on each box is the cost of one query. Steps 3 and 4 may be skipped where the forward model is already cheap, as in plumax’s Gaussian plume; step 2 may not.
| Step | What it is | Trained on | Reference | Lives in | Mode in scientific ML |
|---|---|---|---|---|---|
| 1 · Simple model | and , run forward to draw pairs | nothing | — | sesmax, plumax, radtrax | — |
| 2 · Model-based inference | the posterior by a classical method | nothing | none: it is the oracle | DACycle with filterax, vardax, pyrox | estimation |
| 3 · Emulator | fitted to | step-1 simulations | step 1, on inputs and Jacobians | SimulationDataset, geonnax, ModelRegistry | learning |
| 4 · Emulator-based inference | step 2 with in place of | nothing new | step 2, case by case | DACycle with NeuralForward | estimation |
| 5 · Amortized inference | , observations straight to a posterior | step-1 simulations | step 2, and the truth | pipekit-train with gauss_flows or pyrox; vardax AmortizedPosterior | amortized |
| 6 · Improve | rerun, compare row by row, change one step | — | the step before | pipekit-evaluate Benchmark, ReferenceRule; lineage in pipekit-experiment | bilevel, when a step’s parameters are learned through it |
The usual faults. An emulator scored against observations instead of the simulator; an amortized map trained on step 4’s outputs, which distils that inversion and its errors; a learned step compared only with the step that taught it; only the mean compared, never the spread; a classical method that no longer runs, so nothing can be scored again.
The hypothesis ladder: what the outer loop revises¶
After Hoshin Gupta’s 2017 Horton Lecture. A model is not one hypothesis but a stack of them, each adding information by restricting the trajectories the model can make: the conservation laws, the system architecture, the process forms, and the uncertainty. They are built from the top down, and a misfit is revised from the bottom up: change the lowest rung that can explain it, and climb only when it cannot. The rungs are where the other lenses meet: the top two are numerical-methods chapters 8 to 10, the next two are parts I and II of scientific ML, and the solution procedure is numerical methods again.
Built top down · revised bottom up
Conservation lawscontrol volume, what is conservedgeophysix · gridax termssesmax · radtrax · plumax models
restricts trajectories
System architecturescale, dimension, structure, classesgridax grids · layers, modessource and stability classes
Process formsclosures at the architecture’s scaledrag, diffusivity, plume risegeonnax · pyrox-gp functions
Uncertaintyinputs, structure, the data’s errorsradtrax NoiseModel · priorsfilterax model error
Solution procedureverify it; it is not a hypothesisintegrix · NM ch. 20–24
Parameters and statethe inner loopfilterax · vardax · argminax
revise upward, one rung at a time
Each rung holds the ones above it fixed. Inference gets harder going up: parameters and state are a search over values, process forms a search over equations, architecture a search over structures that the wrong closures confound. The four steps below write each search as an equation. The solution procedure is dashed because it is verified, not inferred; unverified numerics look like structural error.
Each rung in three of the applications¶
| Rung | Ocean and DA | Remote sensing | Sources |
|---|---|---|---|
| Conservation laws | which equations: barotropic or baroclinic QG, shallow water, plane or sphere (BarotropicQG, BaroclinicQG, NonlinearShallowWater2D, SphericalSWM) | absorption only (BeerLambert), or scattering, or emission; what the column conserves | a steady plume, transient puffs or Eulerian transport (GaussianPlume, GaussianPuff, EulerianDispersion); mass balance for the IME (IMEEstimate) |
| Architecture | resolution, eddy-permitting or resolving; how many layers (StratificationProfile), layers or modes (ModalTransform); closed basin or open boundaries | the column’s layers (layers_from_levels, afgl_us_standard); the band set and spectral sampling; the footprint; per pixel or per scene; surface classes | point or area source (GaussianSource, SurfaceFluxSource); one source or many; stack height; a prescribed wind (to_prescribed_wind) or a coupled one |
| Process forms | bottom drag linear or quadratic (LinearDrag2D, QuadraticDrag2D); harmonic or biharmonic viscosity (gridax diffuse, biharmonic); forcing as a field or a reduced basis (BasisForcing); a learned closure (geonnax) | the surface, Lambertian or a Legendre series in wavenumber (Lambertian, PolynomialAlbedo); the band form (BandInstrument); the line shape in the cross-section tables | the dispersion widths σ by Pasquill–Gifford or Briggs (calculate_pg_dispersion, get_dispersion_params); plume rise (BriggsPlumeRise); eddy diffusivity (EddyDiffusivity) |
| Uncertainty | background and model error (, ), observation and representativeness error (); ensembles in filterax | instrument noise (NoiseModel: DiagonalNoise, SNRNoise); the matched filter’s background covariance; structured noise is a gap (applications note 6) | the wind’s error; turbulence as a stochastic process (OUTurbulence); emission and population priors (LognormalMark, LognormalParetoMark); detection probability (LogLogisticPOD) |
Solution solve | steppers and the elliptic solve (integrix.march, gridax.solvers) | spectral quadrature through the response matrix (response_matrix); Jacobians by autodiff | Eulerian resolution against the analytic plume; quadrature over a population (integrix.expect) |
| Parameters, state | the initial state; drag, viscosity and wind amplitude (SeasonalWindForcing) | the column enhancement; albedo coefficients; the spectral shift δ (BandInstrument) | the emission rate in kg h⁻¹ (infer_emission_rate); the source location; a wind scaling |
Architecture is more than resolution¶
Gupta names scale, dimension and spatial structure, lumped against distributed. The applications add more decisions on the same rung:
Dimension and vertical structure. 2-D or 3-D; levels, layers or modes; how the column is cut.
Time structure. Steady or transient: one plume, a train of puffs, or a run through time; a snapshot retrieval or a time series.
Coupling. Which subsystems talk, and one way or both: a wind prescribed to the plume, or a plume fed back to the wind.
Domain and boundaries. Closed or open; nested; plane or sphere.
Which variables are prognostic. What the state is, and what is diagnosed from it.
How heterogeneity is represented. The table below: resolve it, classify it, or integrate over it.
Heterogeneity: resolve, classify or integrate¶
| Strategy | It assumes | Examples | It fails when |
|---|---|---|---|
| Resolve | heterogeneity is explicit down to the grid spacing; below it is a closure’s job | an eddy-resolving ocean; 30 m pixels; an Eulerian plume (EulerianDispersion) | it costs too much, or the data cannot constrain each cell: under-constrained |
| Classify | members of a class share parameters; classes are the units of the model | hydrologic response units; plant functional types; land-cover and surface classes; water masses; Pasquill–Gifford stability classes A to F (get_pg_params); source sectors (LandfillIntensity) | the class boundaries are wrong, or variance within a class matters: over-constrained |
| Integrate | heterogeneity is a distribution over sub-grid states or functions | Gupta’s conductivity, a distribution over sub-grid values; stochastic turbulence (OUTurbulence); emission populations (LognormalMark, MixtureLognormalMark); stochastic parameterisations | the distribution’s shape is itself a strong hypothesis |
Classes are architecture, not parameters. Choosing six stability classes, or one surface class per land-cover type, decides what the model can distinguish before any parameter is fitted, and a misfit that follows the classes says the classes are wrong.
Try to improve the hypothesis: four steps¶
Gupta’s loop is: make a hypothesis, collect data, assess the likelihood, fix the hypothesis. Fixing it is four inferences, each harder than the last, and each moves one more hypothesis from “assumed correct” to “inferred”. Read each equation by where its semicolon sits: what is left of it is searched, what is right of it is held fixed.
Symbols: = {, } the data, inputs and observations; the state and its prior (background) mean; the parameters; the observation operator and its Jacobian; and the prior and data-error covariances, and the covariance of the observations; the residual (innovation); , , and the four hypotheses; a set of candidate process forms; a random process function. Gupta writes for the likelihood; here it is the density , and the semicolon carries his brace: everything after it is assumed correct. Shapes: , , , , and .
1 · Check the assumptions about the data¶
Basic. Does the likelihood reflect the stochastic nature of the information the data provides?
The likelihood is itself a hypothesis, the data’s half of the uncertainty rung: Gaussian or not, which covariance, independent or correlated, with or without representativeness error. Check it before any search: the innovations should be exactly as spread as the prior and the data errors together say, and the whitened residuals should look like white noise.
Search over: the data’s error model, nothing else.
Gupta’s step: maximise the likelihood , but only once it is honest.
In the stack:
radtraxNoiseModel(DiagonalNoise,SNRNoise); innovation statistics on the inner loop’s outputs; structured noise is a gap (Sources, note 5).
2 · Estimate the parameters and the state¶
Easiest. Is there a state and a set of parameter values for which this model explains the data?
Hold every hypothesis fixed, behind the semicolon, and search over all feasible values of the state and the parameters. This is the inner loop: a posterior over values, cheap because the space is a vector space and the gradient exists.
Search over: the values of and .
Gupta’s step: search over all feasible values.
In the stack:
filterax,vardax,pyrox-ssmfor the state;argminax,pyroxfor the parameters; run bypipekit-cycle.
3 · Estimate the process forms¶
Harder. Which equation form, at this architecture’s scale, explains the data once its parameters are integrated out?
The process form moves to the left of the semicolon. Its parameters are integrated out rather than fitted, because parameters are artifacts of the equation chosen: comparing forms at their best-fit parameters rewards the one with the most knobs. The evidence of each candidate form is its score.
Search over: equations, from a candidate set .
Gupta’s step: re-read the literature, do more field work, try other guesses.
In the stack: candidate forms from the ladder’s table; the evidence from
argminax.diagnoseevidence(Laplace) orpyrox-gplog_marginal_likelihood; a learned closure ingeonnaxas one more candidate.
4 · Estimate the system architecture¶
Harder still. How do we tell the effects of the architecture from the effects of the parameterisation?
Architecture and process forms move left together, because a wrong closure can make a right architecture look wrong. Gupta’s answer is the maximum-entropy route: average over random process functions , drawn from the least informative distribution that still obeys the physics, so the closure no longer confounds the architecture. Each candidate then becomes a point on the performance–uncertainty plane.
Search over: structures, that is candidate architectures with the closures averaged out.
Gupta’s step: Monte Carlo over functions, 10,000 cases or more.
In the stack: no prior over constrained functions yet ③ and no tool that compares structures ④; emulators and amortized inference (the six-step cycle, steps 3 and 5) make the runs affordable.
The pattern¶
| Step | Inferred, left of the semicolon | Assumed correct, right of it | Searched over | Cost of one candidate |
|---|---|---|---|---|
| 1 · Basic | the data’s error model | the model | likelihood families and covariances | residual statistics |
| 2 · Easiest | , , , | a vector space, with gradients | one inversion | |
| 3 · Harder | , , | a set of equations | one evidence: an inversion with its curvature, or an integral | |
| 4 · Harder still | , | , | a set of structures | an ensemble over random closures |
| (5) | conservation laws | Gupta notes that the same route could test them; it is rarely done |
Diagnose, then revise: what a misfit says¶
Compare decides which rung to revise. Gupta’s two failures frame it: a model is over-constrained when a hypothesis is stronger than the evidence (a tight band that misses the data) and under-constrained when knowledge is missing (a band so wide it says little); usually it is some of both. Learning is a change in uncertainty, not only a reduction: a posterior can narrow, widen or move, and each says something different about the hypotheses.
Reduced
the posterior is narrower
Increased
the prior was overconfident
Shifted
same width, moved
prior posterior
Score the change, not only the misfit: the KL divergence from prior to posterior, the change in entropy, and whether the posterior lies inside the prior. A widening is learning too: the prior was overconfident. The measures exist in gauss_flows (kl_divergence, entropy, mutual_information, and their Gaussianization estimators) and gaussx (gaussian_kl_divergence, gaussian_entropy); none is a scorer yet ②.
| The misfit looks like | It says | Revise first | With |
|---|---|---|---|
| random and unbiased; the spread covers the observations | nothing structural is wrong | parameters and state: the inner loop | filterax, vardax, argminax |
| narrow and wrong: observations outside a tight spread | over-constrained: a hypothesis is too strong | uncertainty first (is the spread honest?), then process forms (a deterministic closure?), then architecture (missing heterogeneity) | spread–skill, rank histograms; a posterior shifted outside its prior |
| wide and right: the spread covers everything | under-constrained: knowledge is missing | more informative data, or a constraint the evidence justifies | expected information gain (gauss_flows mutual_information) |
| wrong in time: lagged peaks, the wrong recession or decay | a process form | process forms | compare forms by evidence (argminax.diagnose evidence, pyrox-gp log_marginal_likelihood) |
| wrong in some places or classes: one surface type, one stability class | heterogeneity unresolved or wrongly classified | architecture | residuals stratified by class |
| changes with the grid spacing or the time step | the solution, not a hypothesis | verify first | numerical methods chapter 24 |
| a budget that does not close | a conservation law, or a non-conservative scheme | conservation laws, or finite volumes instead of differences | numerical methods chapters 8 and 13 |
Comparing hypotheses: the maximum-entropy route¶
Gupta’s recipe for climbing the ladder without confounding the rungs: at each rung, add only as much information as the evidence justifies at the model’s scale.
A1A2A3vague
under-constrainedvague and wrongconfident and wrong
over-constrainedtarget, worse →ensemble entropy , vaguer →
Each candidate architecture is run with random process forms, then placed by its fit () and the entropy of its ensemble, each with a bootstrap box. Rank with a proper score (the log score or CRPS penalises both bias and overdispersion); read the plane to see why one candidate wins. After Gupta’s slide on inferring system architecture.
Fix the conservation laws. They are the rung we are most sure of.
Replace every process form with random functions constrained by physics: bounded by mass balance, monotone where a larger gradient must give a larger flux, stochastic because sub-element conditions differ ③.
Compare architectures on the plane by Monte Carlo over those functions: the closures no longer confound the architecture ④.
Choose process forms by Bayes, given the architecture.
Estimate parameters and state, given both: the inner loop.
Three questions, three figures. The modelling loop says which loop to run next. The ladder says what that loop revises. The six-step cycle says how cheaply each candidate can be evaluated, and this is where it pays: Gupta ran 10,000 cases on a lumped model, and for an ocean or a radiance model that many runs needs step 3’s emulator or step 5’s amortized inference.
Where the slides need care¶
“Information cannot be bad” holds only with the data’s error model on the uncertainty rung. Gupta adds it (“a hypothesis on data uncertainty”); the usable form is that there is no bad data, only a bad likelihood.
The maximum-entropy prior is not unique. It depends on the base measure and on how the function is parameterised, so the minimal prior is itself a hypothesis.
A learned closure merges two rungs. It picks the process form and its parameters together; the ladder is cleanest for physics-based models.
Where it doesn’t fit¶
[2] Information measures are not scorers. gauss_flows and gaussx compute entropy, KL divergence and mutual information, and pipekit-evaluate has a
Lensfor what kind of failure a score can see, but no scorer measures learning as a change in uncertainty. Proposed: Scorers for the KL divergence from prior to posterior, ensemble entropy and expected information gain; the last is also the value of information that scientific-ML note 5 finds missing.[3] No priors over physics-constrained functions. Random functions exist (GPs in pyrox-gp, kernels in kernellib), and so do monotone interpolants (functax
Pchip,Steffen) and monotone couplings (gauss_flows), but nothing draws functions that are bounded, monotone and stochastic together. Proposed: A shape-constrained random-function prior in pyrox-gp, on kernellib’s kernels.[4] Nothing compares structures. Evidence exists model by model (
argminax.diagnoseevidence, pyrox’s marginal likelihoods), but no tool runs candidates side by side and places them on the plane. Proposed: Candidate structures as an axis of pipekit-evaluate’s Benchmark, with lineage in pipekit-experiment.
Sources and status
Shelves as on the Layer Map (geostack PR #331). “Inherited” marks libraries the stack uses but does not contribute to. The six-step cycle is from geostack’s six-step-cycle skill. The hypothesis ladder, the kinds of learning and the maximum-entropy route follow H. V. Gupta, Towards a General Theory of Learning with Models & Data, the 2017 Robert E. Horton Lecture (Annual Meeting of the American Meteorological Society, Seattle).