Skip to content

Scientific Workbench: Fitting and Inference pack (NIST-validated) - #588

Merged
dovvnloading merged 4 commits into
mainfrom
science/fitting-inference-nist
Nov 18, 2026
Merged

dovvnloading merged 4 commits into
mainfrom
science/fitting-inference-nist

Conversation

@dovvnloading

@dovvnloading dovvnloading commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Fitting and Inference pack

Adds a separately enableable plugins/science_fitting manifest and graphlink_plugins/scientific/packs/fitting.py, registered through the existing catalog and Scientific Workbench contract.

Algorithms and outputs

  • Decimal-precision, equilibrated, pivoted weighted linear least squares: coefficients, standard errors, scaled covariance matrix, weighted R², residuals, chi-square diagnostics.
  • Analytic-Jacobian Levenberg–Marquardt nonlinear fitting for exponential, power-law, Gaussian, polynomial, and NIST-specific saturating exponential/rational models: diagnostics, errors, Student-t 95% local Wald intervals, reduced chi-square.
  • Two-sided Welch t-test and Pearson chi-square goodness-of-fit, with p-values calculated by standard-library-only regularized incomplete beta and gamma.
  • docs/SCIENTIFIC_FITTING_REFERENCE.md covers equations, assumptions, singularity/non-convergence handling, statistical limitations, table provenance, and reproduction.

Reference evidence

  • NIST StRD Longley: all 15 published significant digits for coefficients and standard errors.
  • NIST StRD Misra1a, Thurber, MGH09: all 11 published significant digits for parameters and standard errors from each of two certified starting vectors; certified residual sums of squares tested.
  • NIST Student t and chi-square table values; weighted/constant-response/invalid-input cases; receipt tampering; model Jacobian finite differences.
  • 42 focused tests pass in the local isolated scientific harness; independent 200-case WLS and 500-case Welch comparisons match NumPy/SciPy (development checks only, no dependency in the pack). Awaiting full GitHub CI.

Change control

Only seven permitted paths changed. No existing tests, web UI, chart files, build files, or workflows were modified. Four small commits; pushed blobs verified by GitHub readback SHA after every push.

@dovvnloading
dovvnloading marked this pull request as ready for review November 18, 2026 13:42

@dovvnloading dovvnloading left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial numerical review completed.

  • Verified the changes are restricted to the seven permitted paths; no existing tests, chart/UI code, workflows, or packaging configuration were modified.
  • Reproduced NIST StRD Longley to all 15 published significant digits (coefficients and uncertainties), and Misra1a, Thurber, MGH09 to all 11 published digits including uncertainties and RSS from both NIST starts. Checked analytic Jacobians against independent finite differences.
  • Checked singular/underdetermined design matrices, zero-weight rows, invalid model domains, non-finite input, numerical underflow, beta/gamma domain validation, and the receipt integrity contract. Corrected central Student-t CDF cancellation before committing; tested tail values against published distribution tables and independently compared large randomized samples to SciPy/NumPy (not runtime dependencies).
  • Re-ran focused tests (42 passed); CI passes Windows full pytest with coverage, Ruff, mypy, perf, POSIX permissions, wheel build/install, and frontend checks. E2E is intentionally skipped for PRs by existing workflow configuration.
  • Read back each changed file from GitHub after its push and verified the exact Git blob SHA; no readback mismatches.
  • Intervals are correctly characterized as local linearized/Wald intervals, and expected-count restrictions/LM convergence limits are documented rather than overstating inference certainty.

No unresolved review threads or scope violations. Final review outcome: ready for merge.

@dovvnloading
dovvnloading merged commit e8f6225 into main Nov 18, 2026
5 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