I have a set of experimental data (with each data-point having its own measured uncertainty), and I wish to produce a histogram of it. The x values of the edges of each bin are already defined. The trick is that I need to have uncertainties for the value of each bin, since I am then going to fit a model-histogram to it. (The model is of a physical process, the outcome of which is best described by a histogram. The model will be fit using a non-linear least squares algorithm, and I want to weight each bin based on its uncertainty).
The uncertainties of each histogram bin need to depend on both the known uncertainties associated with each data-point within the bin, and also the number of data-points within the bin. This is where I am stuck - how can I calculate this?