All,
Thanks in advance for your help. There're a lot of "low hanging fruit" problems at work I need to tackle as a tech-level employee. One of them is curve-fitting 6 data points to a cubic curve, and the other regression questions don't address it as well.
The specific application is calibration of pressure sensors. First, the system calibration curve is set to $f(x) = x$. Next, data points are collected from $0$ to $x$ on the $x$-axis where $x$ is applied pressure and the 6 points are spaced $6/x$ units of pressure apart (the $y$-axis is the current provided by the sensor at a given pressure $x$).
The question is, from a programming perspective, how do I get the coefficients $a, b, c, d$ of the curve $dx^3+cx^2+bx+a$ to which the data points are fitted? In other words, what is a simple generalization/algorithm or pseudo-code of the operation?
Again, thanks for your help!
If you tabulate your data in Excel and plot it, you can ask it to Add Trendline, select a degree 3 polynomial, and show trendline equation. That is probably the least work to get to a solution. I don't know how to read the coefficients off in machine-readable form.
Any numerical analysis text will have a whole section on this. I like chapter 15 of Numerical Recipes. Obsolete versions are free on line. You have a linear least squares problem, as your equation depends linearly on the parameters (the coefficients of your cubic), even if non-linearly on $x$.