mstk.analyzer.fitting.polyfit

mstk.analyzer.fitting.polyfit(x, y, degree, weight=None)

Least square n-th order polynomial fitting: y = c0 + c1 * x + c2 * x**2 + … + cn * x**n

Parameters:
  • x (list of float) –

  • y (list of float) –

  • degree (int) –

  • weight (list of float, optional) –

Returns:

  • coeff (ndarray)

  • rsq (float)