Skip to content

docs(oilmm): state the interleaved output ordering - #843

Open
thomaspinder wants to merge 2 commits into
mainfrom
docs/oilmm-output-ordering
Open

thomaspinder wants to merge 2 commits into
mainfrom
docs/oilmm-output-ordering

Conversation

@thomaspinder

@thomaspinder thomaspinder commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

OILMMPosterior.__call__ flattens the predictive mean and covariance with index n * P + p (test input n, output p). The docstring said "output-major". It also gave the covariance as (H ⊗ I) Σ (H ⊗ I)ᵀ, which is the formula for the blocked ordering (index p * N + n). Thus the documentation and the code did not agree.

In other GPJax code, "output-major" means the blocked ordering (MultiOutputGaussian, ExactPosterior, the ICM and LCM kernels). Thus the old docstring told users the opposite of what the code does.

Solution

This PR changes only docstrings, comments and documentation text. It does not change behaviour.

  • The docstring states that the ordering is interleaved (input-major), index n * P + p, and that mean.reshape(N, P) gives one row for each test input.
  • The docstring says that this ordering is different from ExactPosterior and the ICM and LCM kernels.
  • The docstring gives the formulas for the interleaved ordering: mean vec(H Λ), covariance Σ_m Σ_m ⊗ h_m h_mᵀ = (I_N ⊗ H) Σ̃ (I_N ⊗ H)ᵀ, and marginal variance Σ_m H_pm² [Σ_m]_nn. I checked each formula numerically against the dense and diagonal output.

A change of the code to the blocked ordering is not part of this PR. The interleaved ordering is in the v1.0.0 and v1.1.0 releases, and the OILMM example notebook uses it (pred.mean.reshape(N_test, num_outputs)). A change would give silently wrong values to code that reshapes the output, so it needs a decision and a CHANGELOG entry.

The PR also corrects the same term in two other places: docs/migration.md ("flattened output-major") and a comment in tests/test_models_oilmm.py.

Verification

uv run poe lint
uv run poe docstrings
uv run pytest tests/test_models_oilmm.py

All three pass.

🤖 Generated with Claude Code

OILMMPosterior.__call__ flattens its predictive mean and covariance with
index n * P + p (test input n, output p). The docstring called this
"output-major" and gave the covariance formula for the blocked ordering
(index p * N + n). State the interleaved ordering and give the formulas
that match it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size/s ci Continuous Integration documentation Improvements or additions to documentation tests labels Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration documentation Improvements or additions to documentation size/s tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant