@@ -72,6 +72,8 @@ fit_zero_power_resistance(
7272 observations: Iterable[SelfHeatingObservation],
7373 * ,
7474 resistance_standard_uncertainties_ohms: Iterable[float ] | None = None ,
75+ measurement_current_standard_uncertainties_a: Iterable[float ] | None = None ,
76+ current_resistance_error_correlations: Iterable[float ] | None = None ,
7577 context: SelfHeatingExperimentContext | None = None ,
7678) -> ZeroPowerResistanceFitResult
7779```
@@ -91,9 +93,17 @@ The default multi-observation path uses **unweighted ordinary least squares** in
9193resistance. If every observation has an absolute resistance standard uncertainty,
9294pass those values with ` resistance_standard_uncertainties_ohms ` ; the same function
9395then uses inverse-variance weighted least squares with weights proportional to
94- ` 1/u² ` . The ` I² ` coordinate remains fixed/exact in both cases, so this is not an
95- errors-in-variables treatment for uncertain measurement current. Optional
96- `` context `` is retained as non-behavioral provenance and does not alter the fit.
96+ ` 1/u² ` . The ` I² ` coordinate remains fixed/exact in those two modes.
97+
98+ If every observation also has a measurement-current standard uncertainty, pass it
99+ with ` measurement_current_standard_uncertainties_a ` . The fit then uses York
100+ errors-in-variables regression in ` (I², R) ` coordinates. Current uncertainty is
101+ propagated to the squared-current coordinate with the first-order relation
102+ ` u(I²) = 2 I u(I) ` . Optional ` current_resistance_error_correlations ` supply one
103+ within-observation correlation coefficient per current/resistance pair; omitted
104+ coefficients are recorded as zero. The York path does not infer covariance between
105+ separate observations. Optional `` context `` remains non-behavioral provenance and
106+ does not alter any fit.
97107
98108``` python
99109weighted_fit = self_heating.fit_zero_power_resistance(
@@ -106,10 +116,25 @@ print(weighted_fit.evidence.chi_squared)
106116print (weighted_fit.evidence.reduced_chi_squared)
107117```
108118
109- The uncertainties must be finite, positive, and match the observation count. They
110- are treated as absolute independent resistance-domain standard uncertainties and
111- are never inferred from replicate scatter. ` rtd-sensor ` does not define a universal
112- acceptable reduced-chi-square threshold.
119+ The uncertainty sequences must be finite, positive, and match the observation
120+ count. Errors-in-variables fitting requires both current and resistance standard
121+ uncertainties. Correlation coefficients must lie from ` -1 ` through ` 1 ` . These values
122+ are supplied measurement evidence; ` rtd-sensor ` does not infer them from replicate
123+ scatter or shared instrumentation and does not define a universal acceptable
124+ reduced-chi-square threshold.
125+
126+ ``` python
127+ eiv_fit = self_heating.fit_zero_power_resistance(
128+ observations,
129+ resistance_standard_uncertainties_ohms = (0.002 , 0.002 , 0.005 , 0.005 ),
130+ measurement_current_standard_uncertainties_a = (2e-7 , 2e-7 , 5e-7 , 5e-7 ),
131+ current_resistance_error_correlations = (0.0 , 0.0 , 0.2 , 0.2 ),
132+ )
133+
134+ print (eiv_fit.evidence.current_squared_standard_uncertainties_a2)
135+ print (eiv_fit.evidence.errors_in_variables_effective_weights)
136+ print (eiv_fit.evidence.chi_squared)
137+ ```
113138
114139## ` assess_zero_power_extrapolation `
115140
@@ -230,13 +255,19 @@ residual_standard_deviation_ohms: float
230255fitted_resistances_ohms: tuple[float, ...]
231256context: SelfHeatingExperimentContext | None
232257resistance_standard_uncertainties_ohms: tuple[float, ...] | None
258+ measurement_current_standard_uncertainties_a: tuple[float, ...] | None
259+ current_resistance_error_correlations: tuple[float, ...] | None
260+ current_squared_standard_uncertainties_a2: tuple[float, ...] | None
233261effective_weights: tuple[float, ...] | None
262+ errors_in_variables_effective_weights: tuple[float, ...] | None
263+ errors_in_variables_iteration_count: int | None
234264chi_squared: float | None
235265reduced_chi_squared: float | None
236266weighted_rms_residual_ohms: float | None
237267method: (
238268 "ordinary_least_squares_resistance_vs_current_squared"
239269 | "inverse_variance_weighted_least_squares_resistance_vs_current_squared"
270+ | "york_errors_in_variables_resistance_vs_current_squared"
240271)
241272```
242273
@@ -262,13 +293,14 @@ Estimates fitted-parameter covariance using the statistical model retained by th
262293fit. For an unweighted fit, the calculation uses residual variance
263294` SSE / residual_degrees_of_freedom ` and ordinary-least-squares covariance. For an
264295inverse-variance weighted fit, covariance comes directly from the supplied absolute
265- resistance standard uncertainties and is not rescaled by residual scatter or
266- reduced chi-square. Measurement-current-squared coordinates remain fixed/exact in
267- both cases.
296+ resistance standard uncertainties. For a York errors-in-variables fit, covariance
297+ comes from the York adjusted coordinates and the supplied current/resistance
298+ coordinate uncertainty model. Neither absolute-uncertainty path is rescaled by
299+ residual scatter or reduced chi-square.
268300
269- Measurement-current uncertainty and correlated observation errors still require a
270- different or larger statistical model. Fitted RTD-model covariance also remains
271- separate.
301+ The York path can represent correlation between current and resistance errors
302+ within each observation. Correlation between separate observations still requires a
303+ larger covariance model. Fitted RTD-model covariance also remains separate.
272304
273305## ` ZeroPowerResistanceFitUncertaintyResult `
274306
@@ -355,19 +387,23 @@ propagate_zero_power_fit_temperature_uncertainty(
355387
356388Propagates the full retained covariance of the fitted zero-power resistance and
357389`` dR/d(I²) `` slope through the supplied RTD model. The covariance may come from
358- residual-scatter OLS or from supplied absolute resistance uncertainties in the
359- weighted fit. The result reports fit-covariance uncertainty for the zero-power
360- temperature, each fitted temperature, and each fitted temperature rise.
390+ residual-scatter OLS, supplied absolute resistance uncertainties in the weighted
391+ fit, or a York errors-in-variables coordinate-uncertainty model. The result reports
392+ fit-parameter-covariance uncertainty for the zero-power temperature, each fitted
393+ temperature, and each fitted temperature rise.
361394
362395At sampled `` x = I² `` , fitted resistance depends on the retained parameters as
363396`` R0 + k*x `` . The fitted-temperature sensitivity vector is the local `` dT/dR ``
364397times `` (1, x) `` . Temperature-rise sensitivities subtract the zero-power
365398temperature sensitivity first, preserving the shared fitted intercept and the
366399intercept/slope covariance.
367400
368- This is first-order/local propagation. The RTD model is treated as fixed and no
369- measurement-current uncertainty, additional resistance uncertainty, model-parameter
370- covariance, or correlated experiment effects are inserted automatically.
401+ This is first-order/local propagation. For a York fit, measurement-current
402+ uncertainty has already influenced the fitted-parameter covariance, but no separate
403+ direct uncertainty term is added for the nominal sampled current coordinate used to
404+ report each fitted point. The RTD model is treated as fixed and no additional
405+ resistance uncertainty, model-parameter covariance, or cross-observation correlated
406+ experiment effects are inserted automatically.
371407
372408## ` ZeroPowerResistanceFitTemperatureUncertaintyResult `
373409
@@ -419,6 +455,14 @@ The two-current correction path is intentionally not accepted here. Its two poin
419455exactly determine the resistance line, so the named context-bound characterization
420456remains on the larger-observation path with residual diagnostics and fit covariance.
421457
458+ The current coefficient calculation also rejects York errors-in-variables fits.
459+ When measurement-current uncertainty is material, fitted `` I²R `` power depends
460+ directly on an uncertain current coordinate; propagating only the fitted intercept/
461+ slope covariance would omit that dependence. The EIV fit can still be used for the
462+ zero-power extrapolation and its temperature interpretation, but coefficient
463+ characterization remains on the fixed-current OLS/WLS paths until that downstream
464+ uncertainty model is defined.
465+
422466## ` SelfHeatingCoefficientResult `
423467
424468** Introduced in:** rtd-sensor 0.8.0
0 commit comments