I'm hoping to use the coefficients of the polynomial regression in an algorithm to apply a correction to measured values from a machine on my production floor, i.e., calibrate it in software. We have been using a first-order correction successfully except on one machine.
I have some calibration data which I have graphed with an X-Y scatterplot in Excel. Looking at it, it is obvious that linear regression is not a very good fit, so I tried some higher-order polynomial trendlines. A 4th order polynomial looks pretty decent, and has an R^2 of 0.8-something. So far, so good. But when I use the coefficients from the 4th-order equation to try to predict a dependent value for an arbitrary independent value, I get a result that is far different than the displayed trendline curve. I tried this for various independent values (angles from 15 to 65 degrees), and the disparity got worse with increasing angle. The original data has dependent values all within a range of less than ±.2, and the trendline stays in that range, but my calculated values based on the trendline coefficients go from .18 to 22 over the same 15-65 degree range! Fitting a 4th order trendline to my calculated values gives exactly the same equation as that of the trendline for my original data, even though the curves bear no resemblance to each other. I tried the same thing using a 2nd order trendline, with similar results.
This doesn't match my experience with linear regression, in Excel or otherwise, at all. I've triple-checked my formulas and even run the calcs on my HP15C. It's like the displayed equation for the trendline is totally bogus. Anybody have any idea what's going on here?
-Jim
I have some calibration data which I have graphed with an X-Y scatterplot in Excel. Looking at it, it is obvious that linear regression is not a very good fit, so I tried some higher-order polynomial trendlines. A 4th order polynomial looks pretty decent, and has an R^2 of 0.8-something. So far, so good. But when I use the coefficients from the 4th-order equation to try to predict a dependent value for an arbitrary independent value, I get a result that is far different than the displayed trendline curve. I tried this for various independent values (angles from 15 to 65 degrees), and the disparity got worse with increasing angle. The original data has dependent values all within a range of less than ±.2, and the trendline stays in that range, but my calculated values based on the trendline coefficients go from .18 to 22 over the same 15-65 degree range! Fitting a 4th order trendline to my calculated values gives exactly the same equation as that of the trendline for my original data, even though the curves bear no resemblance to each other. I tried the same thing using a 2nd order trendline, with similar results.
This doesn't match my experience with linear regression, in Excel or otherwise, at all. I've triple-checked my formulas and even run the calcs on my HP15C. It's like the displayed equation for the trendline is totally bogus. Anybody have any idea what's going on here?
-Jim