Looking for a solution to what I thought should be an easy problem, but has me running in circles somehow...
I'm working with two sets of data: he first set is raw values from a sensor (accelerometer), and the second set is the temperatures at which these values were read. The values from the sensor are meaningless (as in, they're in sensor ticks) until run through the formula
$Value = (Ticks - OFFSET) * SCALE + Temp * CONST$
which gives me a $Value$ in useful units (in this case, $m/s^2$). The $OFFSET$ and $SCALE$ values are known; I'm trying to find a $CONST$ such that $Value = 0 m/s^2$ across all $Temp$.
The story here is that the sensor output changes over temperature even if its acceleration isn't changing due to the thermal characteristics of the sensor.
I had a similar problem with another sensor (granted, a different formula) and I was able to use simple linear regression to find the $CONST$, but for some reason it doesn't work for this data... One possible theory I've come up with is that the output being dependent on the temperature violates the independence requirement of linear regression, but if that is the case, what should I use instead to calculate a single $CONST$ that will result in the equation being zero (or near-zero) for all temperatures and tick values?
Thanks!
You are assuming that OFFSET is linear over temperature and that SCALE doesn't change with temperature. If those assumptions were true, a linear regression would solve your problem. You can make more complicated functions for OFFSET and SCALE-make each quadratic in temperature, for example. Say your model is $OFFSET=A_0+A_1t+A_2t^2, SCALE=B_0+B_1t+B_2t^2$ (the $CONST$ will get absorbed in these) and feed your data to a multidimensional minimizer. Programs are available in any numerical analysis text or in data analysis packages.