Fitting two data sets to a third

Hi everyone,

Inexperienced with data analysis, I am trying to fit a multiple set of calculated data points (as my fitting functions) to another single set of data points. Therefore, I would not need to use any mathematical polynomial or functions for my fitting. What I need in the end is a set of weighting factors that give the best fit.

So, for example, I have data points of f1(x) and f2(x), and also the target data points F(x). I need to calculate the double numbers w1 and w2 in
w1.f1(x) + w2.f2(x) so that this combination gives the best fit to F(x)

I would appreciate it if anyone helps me understand if there is such functionality within Root.

Best regards,
Nima

Perhaps @moneta can give a hand here? Thanks!

Hi,

You can look at this tutorial for example : ROOT: tutorials/fit/FittingDemo.C File Reference
where a fit to a signal and background distributiun is performed.
If you want to interpret the fitted coefficients as number of events, you can then look also at this one:
ROOT: tutorials/fit/fitNormSum.C File Reference

If you have further questions, please let us know

Cheers

Lorenzo