mstk.analyzer.fitting.polyfit_2d

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

Least square n-th order 2-D polynomial fitting. e.g. the 3rd polynomial fitting: z = c0 + c1 * x + c2 * y + c3 * xx + c4 * xy + c5 * yy + c6 * xxx + c7 * xxy + c8 * xyy + c9 * yyy

Parameters:
  • x (list of float) –

  • y (list of float) –

  • z (list of float) –

  • degree (int) –

  • weight (list of float, optional) –

Returns:

  • coeff (ndarray)

  • rsq (float)