It is quite easy to evaluate the best-fit curve for a set of n data points when the dependent variable is affected by a statistical error (namely when you have n triplets $(x_i,y_i,\sigma_{y_i})$. I use $\chi^2 $ minimization (with ROOT software, mainly) because it also helps me evaluate the goodness of fit. But how should I behave when the $x_i$ variables are affected by a maximum uncertainty? Namely not statistical, just sensitivity uncertainties? How do I tell if their uncertainties can be neglected? If they can't be neglected, how do I treat them?
-
$\begingroup$ If you are unsure whether or not to include some uncertainty in your data analysis, I suggest you do, to be on the safe side. There is software which can calculate fits with 2-dimensional errors, like kafe. $\endgroup$– sim0Commented Dec 17, 2021 at 16:06
-
$\begingroup$ Hi, but how do I rigorously compare maximum errors on the x and statistical errors on the y axis? Also ROOT can calculate fits with 2-d errors, and it also gives me the value of minimized chi-square, but where does it come from when we have 2-d errors? $\endgroup$– Salvatore Manfredi DCommented Dec 21, 2021 at 10:01
-
$\begingroup$ To account for correlations between the errors (I guess that is what you mean by "maximum errors") you will need to calculate or estimate the covariance matrix, however I do not know enough about the details of that to be of a great help here. The software kafe I mentioned before accepts these matrices as input for uncertainties so I guess there will be a way to pass them to ROOT, too. For uncorrelated errors, the covariance matrix is proportional to the identity, which is why in this cases the uncertainty can be represented as a single number, namely the proportionality constant. $\endgroup$– sim0Commented Dec 23, 2021 at 7:51
-
$\begingroup$ The $\chi^2$ value can be calculated analoguously to the case of 1-d errors. See Semoi's answer below for details. $\endgroup$– sim0Commented Dec 23, 2021 at 7:56
1 Answer
Instead of fitting the function $y=f(\vec x)$ for fixed input parameters $\vec x$ a single time you could change the input parameters $\vec x$ according to your uncertainty model and perform multiple fittings. This yields a distribution of the fit coefficients. The distribution captures the uncertainty of your inputs.
As nu pointed out in many software packages we have the opportunity to capture an uncertainty in the input parameters. What the software usually does is to calculate the residual of the fit by using the shortest distance between the data point and the fitted line -- in contrast, the vertical distance is used if the input parameters have no uncertainty. I reckon you should also compare the distribution of the fit coefficients to the result obtained using such a software package.
There is of course a bunch of possible other options. You might want to start on wiki and then look for "uncertainty in independent variable".