I attached a nonparametric fit to data. After fitting with a RooKeysPdf pdf I try to get the chiSquare from the RooPlot using chiSquare(int number_of_parameters_of_freedom=0). I chose 0, because its a non parametric fit. Is this the right thing to do? Does the Chi2 still make sense with these fits?
plot.pdf (103 KB)
I don;t think the chi-square makes much sense. The density estimated with the keys uses just the data points as the histogram does. So you will not get any statistical useful quantities.
If you know the true distribution, you could compare the keys result with the true distribution, however a chi2 test is difficult since if you evaluated the keys in 100 bins, the estimated errors are correlated between the bins.