Polynomial curve fitting in Spin
kolyur
Posts: 43
in Propeller 1
Does anyone have any Spin code for doing least squares regression? Ideally I'm looking for a method where I could specify memory locations of X and Y data arrays, and a degree, and it would return the coefficients and optionally an R^2 value.
I don't expect that I would need a degree higher than 2, as in y = Ax^2 + Bx + C.
I found a number of functions on the web in other languages that I could translate, but I thought I'd at least ask here in case someone has already gone through the exercise.
Thanks!
I don't expect that I would need a degree higher than 2, as in y = Ax^2 + Bx + C.
I found a number of functions on the web in other languages that I could translate, but I thought I'd at least ask here in case someone has already gone through the exercise.
Thanks!
Comments
-Phil