combining two fit results

59 Views Asked by At

I have got two different kind of data points $(x_i, y_i)$. Because one kind are the result of several measurements of the same object I know their statistical error $\Delta x_i, \Delta y_i $ for $x_i$ and $y_i$. For the other one I do not now the statistical error. Thus, I am doing 2 separate fits ($y_i = a_i \cdot x^2 + b_i \cdot x + c_i $ with $ i=1, 2$) for the two kinds of data point using $\chi^2$ fits / Deming regression.

Result: $a_i, b_i, c_i, \Delta a_i, \Delta b_i, \Delta c_i$ Now I want to combine the two fit result to one functions including uncertainties: $$ y_m = (a_m \pm \Delta a_m) \cdot x^2 + (b_m \pm \Delta b_m) \cdot x + (c_m \pm \Delta c_m) $$ using weighted mean by using the $\frac{1}{\Delta a_i}, \frac{1}{\Delta b_i}, \frac{1}{\Delta c_i} $ as weights. Can I just use: $$ y_m = \frac{\sum_{i=1}^n y_i \cdot \frac{1}{(\Delta y_i)^2}}{\sum_{i=1}^n \frac{1}{(\Delta y_i)^2}} $$ where $\Delta y_i $ is got by Gaussian error propagation: $\Delta y_i = \sum_{j=1}^m \frac{\partial y_i}{\partial p_{j,i}} \cdot \Delta p_{j,i} $ with $ p_{1,i} = a_i, p_{2,i} = b_i, p_{3,i} = c_i$. And $$ \sigma_{y_m}^2 = \frac{1}{\sum_{i=1}^n \frac{1}{\Delta y_i²} } $$

As $ y_m $ will be a broken rational function (of order 2) and not a polynomial of order 2 anymore and there are no separate errors for the fitted parameters anymore, I hope there is a better way.

P.S.: Concerning SW: I am using (in Python) is numpy/scipy and ROOT.