Best coefficient between two data sets

89 Views Asked by At

I want to determinate a sensor coefficient but I struggle with a basic math problem...

Here are my values :

Newton      Bytes
-----------------
0           2300
0.0196133   2333
0.04903325  2374
0.0980665   2415
0.196133    2524
0.4903325   2848
0.980665    3380
1.96133     4343
2.941995    4610

What I need is to find the newton value from any bytes I get. For example if I measure 4600 bytes I need to recover ~2.9N


First I calculated coefficients for each row (Newton/Byte) and I've made an average of all these coefficients but it doesn't work at all. It was 0.0002124330614 (without the first row) but 4610 * 0.0002124330614 = 0.979316413 which is far less than 2.94

Secondly I calculated the correlation coefficient which is 0.983871813 but this number doesn't help me. Except that now I know that the curve is almost linear.


How to get a global coefficient that correlate the datasets like:

2300 * coeff = 0
2500 * coeff ≈ 0.19
4500 * coeff ≈ 2.8

Thanks

1

There are 1 best solutions below

4
On BEST ANSWER

If the least squares regression line were of the form $$\text{Newtons} = \text{coeff} \cdot \text{bytes}$$ then that line would go through the origin. If you plot this data, it is nearly linear, but it does not go through the origin.

enter image description here

Using your favorite statistical package (or Excel or Google Sheets) you can find that the least squares line for predicting Newtons from bytes is $$\text{Newtons} \approx 0.001143 \cdot \text{bytes} -2.696.$$

Plugging in $2300$, $2500$, and $4500$ gives $-0.0671$, $0.1615$, and $2.4475$, respectively.