How to do it...

This table represents the main parameters of the method:

Parameters

x: array_like, shape (M,). x coordinates of the M sample points (x[i], y[i]).

y : array_like, shape (M,) or (M, K). y coordinates of the sample points. Several datasets of sample points sharing the same x coordinates can be fitted at once by passing in a 2D array that contains one dataset per column.

deg: intDegree of the fitting polynomial.

rcond: float, optional. 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.

full: bool, optional. Switch determining nature of return value. When it is False (the default) just the coefficients are returned. When True, diagnostic information from the singular value decomposition is also returned.

w: array_like, shape (M,), optional. Weights to apply to the y coordinates of the sample points. For Gaussian uncertainties, use 1/sigma (not 1/sigma**2).

cov: bool, optional. Return the estimate and the covariance matrix of the estimate. If full is True, then cov is not returned.

Returns

p: ndarray, shape (deg + 1,) or (deg + 1, K)Polynomial coefficients, highest power first. If y was 2D, the coefficients for the kth dataset would be in p[:,k].

residuals, rank, singular_values, rcondPresent only if full = True. Residuals of the least-squares fit, the effective rank of the scaled Vandermonde coefficient matrix, its singular values, and the specified value of rcond. For more details, see linalg.lstsq.

V: ndarray, shape (M,M) or (M,M,K)Present only if full = False and cov=True. The covariance matrix of the polynomial coefficient estimates. The diagonal of this matrix are the variance estimates for each coefficient. If y is a 2D array, then the covariance matrix for the kth dataset are in V[:,:,k].

Warns

RankWarning

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset