poly1d¶
- sofia_redux.toolkit.fitting.polynomial.poly1d(x, coeffs, covar=None)[source]¶
Evalulate polynomial coefficients at x
Simple and quick when
polynd
is not necessary.Coefficients should be supplied in order of power such that:
y = c[0] + c[1].x + c[2].x^2 + c[order].x^order
- Parameters:
- xfloat or array_like of float
Input 1D independent variable
- coeffsarray_like of float
Polynomial coefficients
- covararray_like of float
If a 1D array is supplied, then it is assumed to be a the variance of the coefficients. If a 2D array is supplied then assumed to be the covariance matrix.
- Returns:
- numpy.ndarray or (numpy.ndarray, numpy.ndarray)
The fitted dependent variable and optionally, the variance if covar is supplied.