Hi,
I have a question about simultaneous fit.
Example,
I have 2 data sets, a(x, y) and b(x, y).
and user defined function “func” with 3 parameters par(0), par(1), and par(2).
Then, fit of 2 data sets, and get best values of par(0), par(1), and par(2) and chi2/ndf.
This means that I get 2 fitting lines (for a and b data).
The par(0,1,2) are for both a and b data sets and chi2/ndf is for both a and b data sets.
Would you tell me how to do simultaneous multi graph fitting?
e.g.)
a_data = new TGraphErrors(10);
b_data = new TGraphErrors(15);
Double_t func(Double_t *x, Double_t *par);
void main()
{
…
TF1 *intfunc_a = new TF1(“intfunc_a”, func, 0.0, 1.0, 3);
a_data->Fit(“intfunc_a”);
…
TF1 *intfunc_b = new TF1(“intfunc_b”, func, 0.0, 1.0, 3);
b_data->Fit(“intfunc_b”);
…
}
|
| *
| ------ * a_data
| --------- *
| ----------- *
Y|
| ---------------------- *
| +
| --- +
| -------- + b_data
| ------------- +
| ----------------------- +
|
+-------------------------------
------------------------ x
The above example is the independent fitting that means the fitting for a_data and fitting for b_data are separated.
And the parameters of a_data and the parameters of b_data are totally different, and chi2/ndf’s are different, too.
But, I want to get common parameters, means
par(0) for a_data = par(0) for b_data
par(1) for a_data = par(1) for b_data
par(2) for a_data = par(2) for b_data
and I want to know total chi2/ndf for (a_data + b_data).
So, this fitting is for minimizing total chi2.
The normalization constants (magnitude constant such as x 10, or x 100) are different for a_data and b_data.
I want to know how to do that.
Thank you!