[us-commits] [ehb54/ultrascan3] 3b3ffa: extrap_c0: studentize the outlier nomination resid...

emre brookes noreply at github.com
Mon Jul 20 09:20:20 MDT 2026


  Branch: refs/heads/ehb54-issue-920
  Home:   https://github.com/ehb54/ultrascan3
  Commit: 3b3ffaec747d5e17d2777dc5cb4bdaaaecfd980c
      https://github.com/ehb54/ultrascan3/commit/3b3ffaec747d5e17d2777dc5cb4bdaaaecfd980c
  Author: ehb54 <brookes at uthscsa.edu>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M us_somo/develop/include/us_hydrodyn_saxs.h
    M us_somo/develop/src/us_hydrodyn_saxs_iqq_extrap_c0.cpp
    M us_somo/develop/src/us_hydrodyn_saxs_iqq_extrap_c0_script.cpp

  Log Message:
  -----------
  extrap_c0: studentize the outlier nomination residual (leverage correction)

The QC nominated the curve with the largest mean |standardized residual|, with no
leverage adjustment. In a regression of y against concentration the HIGHEST-
concentration curve is the extreme x and therefore the highest-leverage point: it
drags the fitted line onto itself and shrinks its own residual, so a genuinely bad
top-concentration curve is masked by construction.

Measured on the 7-curve alpha-syn set: the top curve (conc 2.41176) carries mean
leverage 0.802 against ~0.29 average, giving raw mean|t| 0.822 -- rank 5 of 7, i.e.
apparently clean -- while the leverage-corrected value is 1.803, rank 2.

Nomination now uses the internally-studentized residual r/(sigma*sqrt(1-h)), with
h = w*(1/S + (x-xbar_w)^2/M) the point's leverage in the weighted line fit (sum h = 2).
Since Var(r_i) = sigma_i^2 (1-h_i), this is the standard statistic rather than a
heuristic. Controlled by the new `outlier_leverage 0|1` control-file directive
(default 1) so the previous behavior can still be reproduced.

Verified: all 9 regression baselines byte-identical -- on that set the same curve is
nominated either way, only the reported statistic changes (1.62 -> 1.97). The C++
values reproduce an independent Python computation of the same quantity exactly.

Note for the record: leverage correction alone does NOT let the detector find the
curve Mattia flags (conc 2.41176). Once the first outlier is removed that curve's
leverage rises to 0.987 -- the fit passes almost exactly through it, its raw residual
collapses to 0.123, and even an 8.8x studentized inflation leaves it below the next
candidate. At h ~ 1 the regression has essentially no information about that point,
so NO residual-based criterion can judge it. Identifying it requires external
information, which is exactly what Mattia's MW-vs-concentration check supplies.

Co-Authored-By: Claude Fable 5 <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/ehb54/ultrascan3/settings/notifications


More information about the us-commits mailing list