Skip to content

fix(plot): take sqrt for gaussian fit sigma initial guess#698

Open
henryiii wants to merge 1 commit into
mainfrom
fix-plot-gaussian-sigma
Open

fix(plot): take sqrt for gaussian fit sigma initial guess#698
henryiii wants to merge 1 commit into
mainfrom
fix-plot-gaussian-sigma

Conversation

@henryiii

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Closes #483.

_construct_gaussian_callable assigned the variance to sigma, and the gauss closure then used 2 * np.square(sigma) — effectively squaring the variance. The initial-guess sigma is now np.sqrt(variance), a true standard deviation.

Test: tests/test_plot.py::test_construct_gaussian_callable_sigma builds a histogram from a known Gaussian (std 2.0), calls _construct_gaussian_callable directly (no --mpl needed), and asserts the recovered sigma ≈ 2.0 (was ≈ 4.0). Confirmed failing before, passing after.

_construct_gaussian_callable assigned the variance to sigma, which the
gauss closure then squared again. Take the square root so the initial
guess is a true standard deviation. Closes #483.

Assisted-by: ClaudeCode:claude-opus-4.8
@henryiii henryiii force-pushed the fix-plot-gaussian-sigma branch from 598bded to 8af8b4e Compare June 25, 2026 20:22
@henryiii henryiii marked this pull request as ready for review June 25, 2026 20:29
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.

[BUG] Missing sqrt when computing sigma in _construct_gaussian_callable

1 participant