calamari.boundary.BoundaryFit#
- class calamari.boundary.BoundaryFit(fit, estimates, sweeps, band, jackknife, comparison, chi_squared_quantile, scatter_below_errors, warnings, params, total=None, model=None)#
Bases:
objectOne stated model fitted to one criterion’s points, one per sweep, with its diagnostics.
Read
sweepsandscatter_below_errorsbefore the parameters: the first says which sweeps the curve rests on and which it does not, and the second whether the error bars describe the scatter at all. The curve is a model of candidate locations under the caller’s assumed form, nothing more.- fit#
The fit (iminuit MIGRAD + HESSE, FT-1), of the location against the held coordinate, weighted by each used point’s error. A failure is
fit.success == False, never an exception.
- estimates#
One row per model parameter:
value,hesse_err(canonical),fixed,jackknife_se(the leave-one-sweep-out standard error; NaN unless every refit succeeded),max_abs_shift_sigmaandmost_influential_sweep_id(fromjackknife), andcriterion.- Type:
- sweeps#
One row per sweep of the family (
SWEEP_COLUMNS), sorted bysweep_id.statusis'used','excluded by caller','no candidate in window','no candidate detected','no point given'or'skipped: <reason>'. The location and its errors are filled only where the sweep gave a point; nothing is imputed.predicted_*is the model at every known held coordinate, including the sweeps without a point, in its own column.residual_*is location minus prediction andpullis that over the fit’s weight (*_err_fit_*). An excluded point’s residual is from the fit made without it.- Type:
- band#
The model with its 1-sigma band on
BAND_POINTSvalues of the held coordinate spanning the used points (no extrapolation): the held column,model_*,model_err_*,lower_*,upper_*(unit suffixes as the location’s), andcriterion. It is a band on the MODEL, under its assumptions: the form is right and the errors are right. It is not a band on where the points will fall, and it does not include the form’s own uncertainty. Seeband_at()for other values.- Type:
- jackknife#
One row per used sweep: that sweep left out and the model refitted (seeded at the full fit).
refitis'ok','failed'or'underdetermined: dof N'; for each free parameterp, its refitted valuepandp_shift_sigma, the shift from the full fit in units of the full fit’s HESSE error. A failed refit is kept, with NaN values.- Type:
- comparison#
The stated model and each
compare=model fitted to the same points with the same errors:model,role,success,n_free,dof,chi_squared,reduced_chi_squared,aic,bic,delta_aic,delta_bic(compared minus stated: positive favours the stated model),criterion.- Type:
- chi_squared_quantile#
P(chi2_dof <= chi_squared)for this fit’s dof: where the fit’s chi-squared sits in the distribution it would follow if the form and the errors were right. NaN when the fit failed.- Type:
- scatter_below_errors#
chi_squared_quantile < LOW_CHI2_TAIL: the points scatter about the curve far less than their errors allow. The errors are then overstated – typically a location error floored at the scan’s grid spacing – and the HESSE errors, the band and the information criteria all inherit that (seefit_boundary()).- Type:
- params#
The recipe:
model,model_description,criterion,signal(a TransitionResult’s),swept_axis,location,held,source,select(the result’s record for that axis),other_axis_sweep_ids,exclude,errors('stat'or'stat+sys'),yerr_sys(whether one was given, its source and its per-sweep values),compare,initial,limits,fixed,band_points,low_chi2_tail,information_criteria,weightingandcalamari_version.- Type:
- total#
The same fit weighted by the statistical and systematic errors in quadrature, with its own diagnostics, when
yerr_sys(or a systematic column) was given;Noneotherwise. Its owntotalisNone.- Type:
BoundaryFitorNone
- band_at(values)#
The model and its 1-sigma band at chosen values of the held coordinate.
bandstops at the used points’ range, deliberately. Beyond it nothing in the points constrains the curve, and the value and band there are the assumed form speaking: two forms that agree across the points can part company quickly outside them. Ask for those values here, where the call says so.- Parameters:
values (
ArrayLike) – Values of the held coordinate, in its own unit:H_T(Tesla) for a T-swept fit,T_K(Kelvin) for an H-swept one.- Return type:
- Returns:
pandas.DataFrame– Columns asband. All NaN when the fit failed.