Least squares with known error in y

467 Views Asked by At

so I want to do a linear least squares regression on my data, however I have known experimental error on my data points in $y$ and relatively few numbers of points so I would like to use values measured instead of the usual residual method. It seems like a simple question but I can't seem to find it online. Does anyone have any idea how to do this?

1

There are 1 best solutions below

1
On

As Occupy commented, using weighted least squares is the solution.

Let me take something similar from data validation and data reconciliation. In this area, what we want to minimize is $$\Phi=\sum_{i=1}^n \Big(\frac{y_i^*-y_i}{\sigma_i}\Big)^2$$ where $y_i^*$, $y_i$ and $\sigma_i$ are respectively the reconciled value, the measured value and the standard deviation for the $i^{th}$ measurement.

In your case $y_i^*=f(a,b,c,\cdots,x_i)$ which is the model to fit and you can assume that the $\sigma_i$'s are just proportional to the error $\Delta y_i$'s you know for each $y_i$ data point. So, just minimize $$\Phi=\sum_{i=1}^n \Big(\frac{y_i^*-y_i}{\Delta y_i}\Big)^2$$ which is the same as $$\sum_{i=1}^n w_i\Big({y_i^*-y_i}\Big)^2$$ with $w_i=\frac{1}{(\Delta y_i)^2}$.

The procedure are very similar to ordinary least square fits (linear or nonlinear)