pyfli.solver.shared_metrics#
Centralize tau ordering, lifetime summaries, FRET efficiency, and fit-quality metrics.
This module belongs to pyfli.solver and is part of PyFLI least-squares, maximum-
likelihood, CPU, GPU, binned, and global FLI fitting routines. Public API includes
functions enforce_tau_ordering(), compute_fli_stats(),
compute_average_lifetime(), and compute_fret_efficiency().
Functions
|
Compute average lifetime. |
|
Compute FLI fit statistics. |
|
Compute FRET efficiency. |
|
Enforce tau ordering. |
- enforce_tau_ordering(popt, perr=None, pcov=None, bounds=None)[source]#
Enforce tau ordering.
- Parameters:
popt (
np.ndarray) – Optimized model parameter vector.perr (
Any | None) – One-standard-deviation parameter uncertainty estimates.pcov (
np.ndarray | None) – Parameter covariance matrix.bounds (
tuple[np.ndarray,np.ndarray] | None) – Optional (low, high) bound vectors used for the fit. When either tau1 or tau2 was pinned by the caller (low == high), that parameter’s slot is left alone.
- Returns:
Tuple containing the reordered parameter vector and any reordered uncertainty or covariance data.
- Return type:
tuple[Any,]
- compute_fli_stats(final_model, d_fit, n_params)[source]#
Compute FLI fit statistics.
- Parameters:
final_model (
np.ndarray) – Model decay evaluated at the fitted parameters.d_fit (
np.ndarray) – Measured decay samples over the fitted range.n_params (
int) – Number of fitted model parameters.
- Returns:
Tuple containing SSR, chi-square, reduced chi-square, R-squared, and RMSE statistics.
- Return type:
tuple[Any,]