# Fitting of experimental data affected by different kinds of errors

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?

• 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.
– nu.
Dec 17, 2021 at 16:06
• 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? Dec 21, 2021 at 10:01
• 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.
– nu.
Dec 23, 2021 at 7:51
• The $\chi^2$ value can be calculated analoguously to the case of 1-d errors. See Semoi's answer below for details.
– nu.
Dec 23, 2021 at 7:56

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.