poly3

mdhelper.fit.polynomial.poly3(x: ndarray, p1: float, p2: float, p3: float, p4: float) ndarray[source]

Convenience function for the poly3 model from MATLAB:

\[y=p_1x^3+p_2x^2+p_3x+p_4\]
Parameters:
xnumpy.ndarray

One-dimensional array containing \(x\)-values.

p1float

Coefficient \(p_1\) for the \(x^3\) term.

p2float

Coefficient \(p_2\) for the \(x^2\) term.

p3float

Coefficient \(p_3\) for the \(x\) term.

p4float

Constant term \(p_4\).

Returns:
fitnumpy.ndarray

Fitted \(y\)-values.