# Propagating systematic error on slope and offset of linear regression

Assume you measure a fluctuating voltage on a photodiode on which a beam of fluctuating power is incident. Or any other pair of values (U, P) with statistical uncertainty. You estimate the statistical uncertainty $$\Delta U_\textrm{stat}, \Delta P_\textrm{stat}$$on the individual data points by the fluctuations on the readings.

Assume there is a linear relationship $$U=PA+B$$ between the quantities. The central values of A and B are easily found by doing some linear curve fitting, one can use orthogonal distance regression for example (https://docs.scipy.org/doc/scipy/reference/odr.html) to take into account both the statistical error on U and P, giving statistical errors $$\Delta A_\textrm{stat}, \Delta B_\textrm{stat}$$.

Now comes the difficult part: Assume that your cheap photodiode has a systematic error of 5% on all measurements. You can not just add this error to the statistical error, it doesn't go away just by taking more measurements, it is inherent to the photodiode.

So how to deal with this?

I myself would do a linear error propagation to estimate the systematic error, finding $$B=PA-U \rightarrow \Delta B_\textrm{sys}=\Delta U_\textrm{sys}$$ and $$A=\frac{U-B}{P} \rightarrow \Delta A_\textrm{sys}=\frac{\Delta U_\textrm{sys}}{P}+\frac{\Delta B_\textrm{sys}}{P}=\frac{2\Delta U_\textrm{sys}}{P}=2\frac{U}{P}5\%=2A5\%$$

Such that in total $$A=A\pm\Delta A_\textrm{stat}\pm\Delta A_\textrm{sys}=A\pm\sqrt{A_\textrm{stat}^2+A_\textrm{sys}^2}$$

I made this up myself though and I'm having a hard time to find out the right way to do it. Statistics literature of mathematicians is super confusing to me. Is there even one commonly accepted way?

I've discussed this with several phd students supervising my graduate labs and none of them really have a good answer, some don't even differentiate between systematic error and statistical error and just treat everything as statistical.. Also many of my peers just never give any systematic error on the measurement devices or don't even take any x-error into account at all, so they don't have to worry about any of this - It's frustrating.

• You already got good answer, so just comment in addition: you don't have to add statistical and systematic uncertainties but can quote your final result as $17\pm 4^{stat} \pm 3^{sys}$
– rfl
Commented Mar 15, 2022 at 8:45

Is there even one commonly accepted way?

Yes, the best reference I know of for the accepted way of doing analysis of uncertainty is in the NIST guide for evaluating and reporting uncertainty:

https://emtoolbox.nist.gov/Publications/NISTTechnicalNote1297s.pdf

In section 5.1 it says that the usual approach is to use the root-sum-of-squares that you mention. That is the usual approach for estimating the combined uncertainty due to both statistically evaluated uncertainty and uncertainty evaluated by non-statistical means. So your 5% uncertainty, which is not obtained with your own statistical analysis, is included along with any statistically-determined uncertainty to get the total standard uncertainty. This should be reported as the “combined standard uncertainty”

• Yes, but I don't see how the pdf explains how to get the systematic (they refer to it as type B) on the slope
– user285375
Commented Mar 14, 2022 at 6:16
• @TheoreticalMinimum you use the propagation of uncertainty, as you suggested. The details are given in appendix A, but your post indicates that you are already aware of it
– Dale
Commented Mar 14, 2022 at 11:08