Let's say I have an histogram of some continuous data with unknown and arbitrary pdf. I don't have access to the original raw data. So I don't know that 3 of my data points are 21, 25 and 27, all I know is that 3 of my data points are in the bin 20-30. How accurate is it to compute the moments of this pdf from the binned data? Can I estimate the error I'm making?
See Experimental uncertainty estimation and statistics for data having interval uncertainty (Ferson et al. 2007). Calculating the uncertainty in the mean is easy, just compute the mean of the data assuming all points are at the lowest value of the interval and the mean assuming all points are at the highest value of the interval. The true mean has to lie somewhere in this interval.
Variance is a bit harder. But the referenced publication gives some algorithms to estimate it, and fortunately for binned histogram data it is a case of what Ferson et. al (2007) refer to as no-nesting type data.
There are various other measures that are easy to calculate by only examining the end points of the intervals (like the CDF). Ferson et. al (2007) refer to such measures as stochastic dominant (wording taken from Charles Manski).