Skip to content

refactor: migrate least-squares fits to basin 1.11 - #34

Merged
dancixx merged 1 commit into
rust-dd:mainfrom
jolars:refactor/basin-levenberg-marquardt
Sep 12, 2026
Merged

dancixx merged 1 commit into
rust-dd:mainfrom
jolars:refactor/basin-levenberg-marquardt

Conversation

@jolars

@jolars jolars commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Replace levenberg-marquardt with basin 1.11 across calibration, volatility surfaces, and AI surrogates. This also adds bounded coordinates to keep CGMYSV converging, preserves SVI fits with negative sigma, and removes unused BSM history allocations.

Criterion means from release builds, with 20 samples per case:

Calibration Before After Change
BSM, low initial volatility 22.738 µs 10.663 µs -53.1%
BSM, high initial volatility 19.999 µs 8.261 µs -58.7%
Heston, numerical Jacobian 626.466 ms 623.096 ms -0.5%
Heston, analytic Jacobian 78.155 ms 77.802 ms -0.5%
SABR 34.787 µs 30.763 µs -11.6%
Variance gamma 3.810 ms 3.913 ms +2.7%
Merton jump diffusion 6.269 ms 5.407 ms -13.8%
SVI 9.602 µs 7.937 µs -17.3%
SSVI 39.950 µs 35.341 µs -11.5%

Both Heston changes are within noise. Variance gamma is consistently a little slower, with the same fit accuracy and evaluation count.

No convergence regression appeared in the test fixtures. Calibration, surface, stats, and AI tests passed, as did workspace/Python checks and the benchmark build. Scoped Clippy passed; strict checks still hit existing warnings. The all-features Clippy commit hook was skipped because it pulls in Apple frameworks on Linux.

I used Codex GPT-6 Astra to prepare this PR.

Upgrade `basin` to 1.11 and replace `levenberg-marquardt` across
calibration, volatility surfaces, and AI surrogates. Preserve evaluation
budgets and report the best accepted fit on failures.

Add convergence fixtures and Criterion comparisons. Use bounded CGMYSV
coordinates to retain convergence, preserve negative-sigma SVI fits,
and remove unused BSM history allocations.

The measured fits retain their accuracy. Six benchmark cases improve,
Heston stays within noise, and variance gamma remains about 3% slower.

Closes rust-dd#33
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

@jolars is attempting to deploy a commit to the GymPiper Team on Vercel.

A member of the Team first needs to authorize it.

@dancixx
dancixx merged commit 2005bd4 into rust-dd:main Sep 12, 2026
20 of 21 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.

2 participants