Closed NGoetz closed 2 months ago
The reason why the tests let that through is because we only check for the value, but not the error in the test for average
. This is sad. Additionally, average_weighted
is never tested as far as I can see.
You mean this: self.error_ = np.sqrt(np.sum(self.histograms_, axis=0) / self.number_of_histograms_)
is wrong? This is just the $\sqrt{N}$ of the averaged histograms assuming Poissonian statistics if I'm right.
I would have assumed to get the standard error just like for the average_weighted
. The documentation claims that too. If we want a Poisson distributed error, that should be an optional argument, for both functions, and independently tested.
The standard deviation for Poissonian statistics is $\sigma= \sqrt{N}$, so this statement is correct, at least for a single histogram.
It's correct for Poissonian, but the documentation says standard error. Isn't standard error also a more reasonable default?
We should discuss with the others on Monday, what we want to put as a default.
I agree. An additional idea would be to add the option of error weighted average for weighted average right out of the box.
I think the standard error in the average_weighted
is not even the standard error tbh. there is a factor missing.
raw_count
is also not updated...? Bug or feature?
The average function of Histogram is "grob falsch". The standard error is not calculated correctly. I would replace this function by calling
average_weighted
with unit weights (DRY!). We should investigate why this was not caught by tests.