poly4

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

Convenience function for the poly4 model from MATLAB:

\[y=p_1x^4+p_2x^3+\cdots+p_5\]
Parameters:
xnumpy.ndarray

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

p1float

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

p2float

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

p3float

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

p4float

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

p5float

Constant term \(p_5\).

Returns:
fitnumpy.ndarray

Fitted \(y\)-values.