Commit Graph

8 Commits

Author SHA1 Message Date
ThotDjehuty dd51156174 docs(v2.0.0-alpha.4): enrich v2.0 notebooks with FR sandwich + real-world examples
Each of the eight v2.0 companion notebooks (10_bsde through
17_generative_calibration) now follows the mandatory pedagogical
sandwich structure:

  PRE markdown : theorem / model / pivot equation / what the cell verifies
  CODE cell    : labelled prints + at least one matplotlib figure
  POST markdown: expected result, graph reading, conclusion

Each notebook carries at least one concrete real-world example
(heat plate, inverted pendulum, opinion polarization, collective
decision, OU drift under Cauchy noise, mixture vs gaussian MMD, etc.)

Generator script: scripts/enrich_v2_notebooks.py
Doc plots refreshed via scripts/inject_doc_plots.py.
2026-05-12 16:07:42 +02:00
ThotDjehuty cce31055c1 docs(v2.0.0-alpha.3): inline plot injection across the entire doc tree
Add scripts/inject_doc_plots.py that scans every .md and .rst page under
docs/source/, executes each Python code-block in an isolated namespace
with a non-interactive matplotlib backend, captures every figure
produced, and inserts an inline image directive immediately after the
code-block.  Markers AUTO-PLOT-BEGIN/END make the injection idempotent
on re-runs.  Blocks that fail to execute or produce no figure are left
untouched.

Add a transparent __getattr__ fallback in python/optimizr/__init__.py
that forwards any unresolved top-level attribute to the compiled _core
extension.  This lets all v1.x and v2.0 doc samples that use
'from optimizr import X' (estimate_ou_params_py, linear_bsde_constant_coeffs,
mmd_gaussian, ...) execute as written.

Augment the OU Parameter Estimation example
(docs/source/algorithms/optimal_control.md) with a two-panel
visualization (simulated path plus empirical/theoretical autocorrelation).

Net effect: 14 doc pages now display matplotlib plots inline directly
under the code that produced them -- including the OU page, point
processes, Grid Search, HMM, MCMC, plus the 8 v2.0 RST pages.
2026-05-12 13:05:14 +02:00
ThotDjehuty d8682f61e5 release(v2.0.0-alpha.2): PyO3 bindings + executed companion notebooks + Sphinx RST with inline plots
PyO3 abi3 bindings for the 13 v2.0.0 functions across 8 module groups:
  bsde, pde, stochastic_control, optimal_control::quadratic_impact_control,
  mean_field::mckean_vlasov, agent_based, inference, optimization.

8 executed companion notebooks under examples/notebooks/10_bsde.ipynb …
17_generative_calibration.ipynb (cell outputs and matplotlib figures
preserved as proof-of-work; verified against analytic ground truths).

8 Sphinx RST pages under docs/source/algorithms/{bsde,pde,stochastic_control,
quadratic_impact_control,mckean_vlasov,agent_based,robust_drift,
generative_calibration_hooks}.rst with .. math:: derivations and inline
.. image:: directives placed immediately after each .. code-block:: python
so each plot appears directly under the code that produced it.

18 PNG plot assets under docs/source/_static/v2/<group>/.

index.rst extended with a new 'v2.0 Generic Stochastic Control & PDE'
toctree caption.

Forbidden-vocabulary audit on new src/, docs/source/algorithms/ and
binding files: zero matches.

All previously stable APIs untouched; v2.0.0 is additive at the binding
level — no v1.x function signature was changed.
2026-05-12 12:18:14 +02:00
ThotDjehuty 49be6c7bf7 docs(diagrams): add 4 remaining SVG figures for §8 HMM + §10 geometry
- fig_hmm_regime: 3-state Bull/Neutral/Bear HMM state machine + emission table
- fig_viterbi_trellis: Viterbi trellis K=3 T=4 with MAP path highlighted
- fig_std_vs_nat_gradient: standard vs natural gradient property comparison panels
- fig_lie_group_hierarchy: GL/SL/O/SO/Sp/H Lie group tree with finance annotations

All 27 SVGs regenerated; mathematical_foundations.md now 0 remaining ASCII blocks.
_fix_diagrams3.py added for reproducibility.
2026-03-07 13:39:43 +01:00
ThotDjehuty 5d06f0ab57 docs: replace all ASCII/Unicode diagram blocks with matplotlib SVG figures
Replace 23 ASCII/Unicode text diagram code-blocks in mathematical_foundations.md
with professionally rendered matplotlib SVG figures.

Changes:
- Add docs/source/_gen_diagrams.py: Python script generating all 23 SVG figures
  with consistent styling (white bg, blue/orange/green/red palette, scipy/numpy/
  matplotlib Agg backend)
- Add docs/source/_static/diagrams/*.svg: 23 rendered SVG figures covering:
  §1 DE/random-walk/BM/GBM, §2 Ito/Picard/FP/EM/OU, §3 Poisson/Merton/Levy,
  §6 Kalman, §7 MCMC, §9 KL/Fisher, §10 curvatures/natural-gradient
- Update mathematical_foundations.md: all ASCII art code-blocks replaced with
  MyST {figure} directives pointing to the generated SVGs
- Sphinx build: clean success, all 23 SVGs copied to build, 1 pre-existing warning

Resolves: user request for professional publication-quality figures instead of
  ASCII/Unicode art (which was too low-level for publication)
2026-03-07 11:29:14 +01:00
ThotDjehuty d24b8b1036 docs: enrich mathematical_foundations SDE sections + transparent logo 2026-03-07 09:44:08 +01:00
ThotDjehuty b41618c627 docs(theory): enrich Section 4 optimal control with 4 worked examples
- Add HJB/PMP/HJBI comparison overview table
- Add Merton 1969 portfolio allocation example (log-utility, constant fraction)
- Add Almgren-Chriss inventory liquidation example (LQR + TWAP-like schedule)
- Add PMP costate derivation for Merton problem
- Add American option as viscosity example (variational inequality, smooth-pasting)
- Explain jump integral term intuition in HJBI
- Add shooting method pseudocode for PMP
- Mirror all enrichments in LaTeX .tex source
- Regenerate PDF (13 pages, cross-refs resolved)
2026-03-06 20:22:35 +01:00
ThotDjehuty f6a74716e2 docs: replace ASCII diagrams with Mermaid visuals + brand CSS
- Add sphinxcontrib-mermaid>=0.9.2 to requirements.txt
- Add custom.css with orange brand theme (admonitions, tables, mermaid containers)
- Replace Complete Algorithm ASCII pseudocode with Mermaid flowchart (differential_evolution.md)
- Add Mermaid stateDiagram-v2 for Bull/Normal/Bear regime transitions (hmm.md)
- Replace Rust module file tree with Mermaid graph TD (point_processes.md)
- Configure mermaid_version=10.9.0 and dark+orange themeVariables in conf.py
2026-03-06 17:39:03 +01:00