desc.profiles.PowerSeriesProfile.from_values

classmethod PowerSeriesProfile.from_values(x, y, order=6, rcond=None, w=None, grid=None, sym='auto', name='')[source]

Fit a PowerSeriesProfile from point data.

Parameters:
  • x (array-like, shape(M,)) – coordinate locations

  • y (array-like, shape(M,)) – function values

  • order (int) – order of the polynomial to fit

  • rcond (float) – Relative condition number of the fit. Singular values smaller than this relative to the largest singular value will be ignored. The default value is len(x)*eps, where eps is the relative precision of the float type, about 2e-16 in most cases.

  • w (array-like, shape(M,)) – Weights to apply to the y-coordinates of the sample points. For gaussian uncertainties, use 1/sigma (not 1/sigma**2).

  • grid (Grid) – default grid to use for computing values using transform method

  • sym (bool) – Whether the basis should only contain even powers (T) or all powers (F).

  • name (str) – name of the profile

Returns:

profile (PowerSeriesProfile) – profile in power series basis fit to given data.