clophfit.fitting.odr#
Orthogonal Distance Regression (ODR) utilities and fitting pipeline.
Functions#
|
Format the value and its associated error into "{value} ± {error}" string. |
|
Handle multiple datasets with different lengths and masks. |
|
Analyze multi-label titration datasets using ODR. |
|
Identify outliers. |
Module Contents#
- clophfit.fitting.odr.format_estimate(value, error, significant_digit_limit=5)#
Format the value and its associated error into “{value} ± {error}” string.
- Parameters:
value (float)
error (float)
significant_digit_limit (int)
- Return type:
str
- clophfit.fitting.odr.generalized_combined_model(pars, x, dataset_lengths, *, is_ph)#
Handle multiple datasets with different lengths and masks.
- Parameters:
pars (clophfit.clophfit_types.ArrayF | list[float])
x (clophfit.clophfit_types.ArrayF)
dataset_lengths (list[int])
is_ph (bool)
- Return type:
clophfit.clophfit_types.ArrayF
- clophfit.fitting.odr.fit_binding_odr(ds_or_fr, *, reweight=False, remove_outliers=None, max_iter=15, tol=0.1)#
Analyze multi-label titration datasets using ODR.
- Parameters:
ds_or_fr (Dataset | FitResult[MiniT]) – Either a Dataset (will run initial LS fit) or a FitResult with initial params.
reweight (bool) – Whether to perform iterative reweighting (recursive ODR).
remove_outliers (str | None) – Outlier removal configuration, e.g., “zscore:2.5” or “zscore:2.5:5”. If set, performs recursive ODR and masks outliers iteratively.
max_iter (int) – Maximum number of iterations for recursive ODR.
tol (float) – Convergence tolerance for residual variance.
- Returns:
ODR fitting results. Residuals are WEIGHTED by the ORIGINAL y_err (before ODR modified it), making them comparable to LM residuals.
- Return type:
FitResult[odrpack.OdrResult]
- clophfit.fitting.odr.outlier(output, *, threshold=2.0, plot_z_scores=False)#
Identify outliers.
- Parameters:
output (odrpack.OdrResult)
threshold (float)
plot_z_scores (bool)
- Return type:
clophfit.clophfit_types.ArrayMask