suboptimumg.loganalysis.fitted_curve#

Polynomial curve fitting with Horner evaluation.

class suboptimumg.loganalysis.fitted_curve.FittedCurve(data, poly_order)[source]#

Bases: object

Polynomial fit of tabulated [x, y] data with Horner evaluation.

Parameters:
  • data (list of [x, y] pairs) – Raw tabulated input data.

  • poly_order (int) – Polynomial degree for the least-squares fit.

x_raw, y_raw

Original input arrays.

Type:

np.ndarray

poly_order#
Type:

int

coeffs#

Polynomial coefficients in descending degree order [c_n, c_{n-1}, ..., c_1, c_0], matching np.polyfit output and the order Horner’s method consumes directly.

Type:

np.ndarray

evaluate(x)[source]#

Evaluate the fitted polynomial via Horner’s method.

Parameters:

x (float or array-like) – Input value(s) at which to evaluate.

Returns:

Evaluated polynomial value(s).

Return type:

np.ndarray or np.floating