Cry for a new option in TProfile constructor

Dear Root Experts,

In my analysis I am reporting the results and statistical errors in terms of unbiased estimators for mean and variance (see attached document errors.pdf).

It would be really great if the Root team would implement new option in TProfile constructor which would give me automatically results and errors for each bin in accordance with Eq. (3) in the attached document - that would save so much lines in my code in which I am keeping manually track of ‘sum of weights^2’ and ‘(sum of weights)^2’ appearing in Eq. (2).

Btw, I checked the documentation of TProfile:

1.) Can somebody please indicate the formula which is used to report statistical error for default option ‘’ in constructor AND when non-unit weights are used? With what I though would be a correct formula I do not get the same results as the one obtained from GetBinError() method when non-unit weights are used.

2.) Option ‘s’ reports biased estimator for spread (for instance in denominator it uses N instead of N-1 in Eq. (5) in the attached file). To my knowledge there is a priori no good reason to prefer biased estimator over the unbiased one.

Thanks and cheers,
errors.pdf (39.3 KB)


The quoted error should be already implemented in the case of weights different than 1. Which ROOT version are you using ? The correct calculation is done only from version 5.24.
There is only the fact we use the biased estimator (i.e. N instead of N-1). I agree it is probably better to used the unbiased one, however historically we have ben used the biased one.

If you have an example showing a problem in the GetBinError, I would be grateful if you can attach it

Best Regards


Hi Lorenzo,

I am using

ROOT 5.26/00 (tags/v5-26-00@31883, Jan 15 2010, 17:02:49 on linuxx8664gcc)


I have attached example errors.C in which I am comparing results for errors from GetBinError and from manual calculation following strictly the prescription I attached previously. The results for error are rather different:

[code]Profile calculation:
mean = 3.53089
error = 0.245298

Manual calculation:
mean = 3.53089
error = 1.03032


I think that user should be able to decide whether he wants to report his errors in terms of biased or unbiased estimators, hence both options in TProfile constructor should be enabled.

errors.C (1.29 KB)

Thanks for your example. In order to have support for weights you need to call TProfile::Sumw2() before filling the histogram.
By doing that you will get an error similar to your case. The only difference is we used the biased estimated.

I will consider, as you suggested, to implement the unbias estimate as option in the constructor.

Best Regards


Hi Lorenzo,

I have completely missed this method - thanks for clarifying this out!

Thanks in advance!