Given a set of data-points and a TF1, the best way to compute the ChiSquare is

to orgainze the data into a TGraph, and then use method

TGraph::Chisquare(TF1)

Unfortunately I have many sets of data (i.e. many TGraphErrors). So I gathered all the graphs into a large TMultiGraph object. It seems to me that all fitting methods works well for TMultiGraphs, as per TGraphErrors, but there is no method TMultiGraph::Chisquare(TF1)… why not?

How can I work around it to easily get my Chi2??

Another questio.

So, TGraph::Chisquare(TF1) gives the total chi^2 for a given TF1.

Is there a way to get the degrees-of-freedom number, NDof?

What if the TF1 is defined in a different range w.r.t. the Graph?

I assume that only points where the two ranges overlap enter in the Chi2 evaluation; Correct?

Is there a smart way to quickly get the number of these points (should be the DoF)?

[quote=“ntomasse”]Given a set of data-points and a TF1, the best way to compute the ChiSquare is

to orgainze the data into a TGraph, and then use method

TGraph::Chisquare(TF1)

Unfortunately I have many sets of data (i.e. many TGraphErrors). So I gathered all the graphs into a large TMultiGraph object. It seems to me that all fitting methods works well for TMultiGraphs, as per TGraphErrors, but there is no method TMultiGraph::Chisquare(TF1)… why not?

How can I work around it to easily get my Chi2??[/quote]

Hi,

You may want to repost this question in the Math and Stats forum.

Philippe.