See also (M^T M)^-1 M^T
Re:Polynomial Interpolation
by thomasahle on Wednesday February 08, 2023 @07:16PM
(#34717773)
Sure, if you have more equations the degree, but that doesn't seem to be the case in the article.
Re:Polynomial Interpolation
by thomasahle on Wednesday February 08, 2023 @09:54PM
(#34719194)
Edit: Should of course be without plusses in the matrix form:
[x1^3, x1^2, x1, 1] [a] = [y1]
[x2^3, x2^2, x2, 1] [b] = [y2]
[x3^3, x3^2, x3, 1] [c] = [y3]
[x4^3, x4^2, x4, 1] [d] = [y4]If there is a way of doing it without inversion it's probably more accurate - some people go out of their way to formulate methods without inversion to reduce inaccuracies.
Re:Polynomial Interpolation
by thomasahle on Thursday February 09, 2023 @12:50PM
(#34728086)
For sure. I just wanted to point out the approach that arguably required "the least math knowledge".
Also, OP was solving a degree four problem and wanted a closed form.
For better stability just use `x = np.linalg.solve(M, y)`, or whichever linear solver you expect to be fast.
I think hackers should know enough linear algebra to do that, without "having to go asking the maths gods".