# Error associated with bins in a histogram

I have recently performed a laboratory experiment using an Hanbury Brown and Twiss setup to measure the g^(2) correlation function (intensity correlation function) of different sources. The apparatus was very simple: a source whose light is separated by a 50:50 beam splitter and 2 detectors which detect the photons of the beams. The electrical signals generated by detectors as a consequence of the detection process are sent to an instrument which determines the time differences: the first signal from one of the two detectors starts a timer that is stopped from a signal coming from the other detector. Finally, a histogram is constructed in which each time value is inserted in the corresponding bin (whose dimension is chosen by the user), thus increasing its value. The result is something like this:

Now, I'm trying to understand what kind of errors I should give to the $$y$$ (i.e. the counts) and the $$x$$ (i.e. times) values. Since $$y$$ values are counts ($$N$$), can I give them the Poissonian error $$\sqrt{N}$$? About $$x$$ (times) values, let consider that both the detectors and the instrument for the time differences have a time resolutions. Moreover I think that timing jitters of instruments should be taken into account. I don't understand how to take everything into account. Probably the question is not very clear; if so, ask me and I will of course be happy to specify.

• step 1 is fix the ordinate label. It's not g(2), it's "counts per 100 ps". I also recommend calling the abscissa "t" rather than "x", but that's a question of style.
– JEB
Dec 13, 2020 at 19:44
• @JEB I'm sorry, I changed the plot specifically for this question and I forgot to cancel the g(2) label. However It's not counts per 100 ps, but simply counts. They have to be normalised to obtain the g(2). They were normalised, but I changed the plot before uploading the question, that's why the g(2) label appears. I didn't get what you mean about the abscissa "t". In the plot there is already t. I used to call it "x" in the question just for generality because I think the answer would be valid for any type of histogram.
– Tech
Dec 14, 2020 at 8:34

There appears to be no correlation peak in your data. So with that, I have simulated your data:

with the addition of Poisson errors ($$\sqrt N$$). Each $$t$$-bin is filled randomly with a mean of 225 counts, and a variance of 225 ($$\sigma=15$$).

Note that the actual statistical fluctuations on each count is $$\pm 15$$, but the estimated value from the data is $$\pm \sqrt{n_i}$$. When it comes time to fit the data with a constant, using Poisson errors gives more weight to bins with fewer counts (as the error bar is smaller), and this shows up in the fit to a constant.

When I use the true (unknown to the experimenter) error bars, I get:

$$\bar y = 225.2$$

and when I used the estimated errors:

$$\bar y = 224.3$$

That is something to keep in mind if your bins gets too narrow.

You can also bin the count frequency (project onto the y axis):

Is that a Poisson distribution? A Gaussian? Neither? These are things you need to do to understand if your data makes sense. What is the standard deviation of your data. It should be the square root of you mean if everything is working (unless there is a HBT-correlation peak in there somewhere...)

Regarding the timing error, how big do you expect it to be? Suppose it is $$\sigma_t$$, the timing error introduced by binning the data into bin sizes of $$\Delta t$$ is $$\Delta t/\sqrt{12}$$, so if:

$$\sigma_t \ll \frac{\Delta t}{\sqrt{12}}$$

it is most likely ignorable. Unless the HBT autocorrelation peak is less then that...then the experiment won't detect it.