Skip to content

Add low-rank and full-Jacobian Gauss–Newton assimilation with a Laplace posterior - #204

Merged
KriFos1 merged 3 commits into
Python-Ensemble-Toolbox:mainfrom
KriFos1:feature/lowrank-gn
Nov 27, 2026
Merged

KriFos1 merged 3 commits into
Python-Ensemble-Toolbox:mainfrom
KriFos1:feature/lowrank-gn

Conversation

@KriFos1

@KriFos1 KriFos1 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a simulator-independent scheme that finds the posterior mode in physical state coordinates and draws a Laplace posterior ensemble. Low-rank mode requests the misfit gradient and one adjoint product per retained data direction. Full-Jacobian mode uses the same solver with identity directions. Each damping trial forecasts one member; the final posterior ensemble is forecast once.

Entry points and public APIs

  • pipt.LowRankGN, pipt.update_schemes.LowRankGN, and the existing scheme factory/registry: set scheme = "lowrankgn" and analysis = "laplace". [dataassim.iteration] selects rank or full_jacobian; [dataassim.laplace] configures prior covariance or precision actions.
  • Optional simulator hook run_vjp(state, weights): PET supplies labelled observation weights; the simulator returns one gradient row per objective and state variable. MiniRes.run_vjp implements it. MiniRes's existing adjoint path also covers BHP-controlled wells, bottom-hole pressure and permeability-dependent well indices.
  • Single-level BaseEnsemble.calc_prediction and ForecastMixin.forecast use ensemble.ne by default; an explicit keyword-only member_count selects a different batch width. LowRankGN uses one member per MAP trial and [dataassim.laplace].posterior_samples for final sampling and forecast (default ensemble.ne). The assimilation restart path recognises already-converged runs; imported state can supply the prior ensemble without a separate prior specification.
  • The MiniRes benchmark runner adds low-rank and full-Jacobian rows and counts backward sweeps. Only the two new method entries are appended to each case JSON; all ten published baselines and their metadata are preserved. The benchmark README identifies both source runs.

Verification

  • Pre-commit run: pytest -q tests/assimilation/test_lowrank_gn.py tests/test_minires_sim.py tests/assimilation/test_scheme_factory.py — 97 passed.
  • Full suite at a7dc998: 777 passed, 5 xfailed, 1 xpassed. Regression coverage includes 8 prior members, single-member trials, 100 posterior draws, unchanged MAP and basis, short prior rejection, and reloading a saved posterior forecast.
  • Official MiniRes runs: low-rank vs full-Jacobian simulation counts were 185 vs 300 on the coarse grid (20 truths) and 186 vs 300 on the fine grid (8 truths).

@KriFos1
KriFos1 merged commit ccceaf6 into Python-Ensemble-Toolbox:main Nov 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant