0
$\begingroup$

I asked a question here but I did a rather poor job of explaining my problem the question was poorly formed.

If I have some histogram with $N_{total}$ number of total data points, and $N_{bins}$ number of bins. If I integrate across the maximum bin and the minimum bin, then I just get back $N_{total}$, likewise if I integrate between two bins on the histogram, I simply sum the counts within those two bin points.

Now I can fit a function, $f(x)$, that describes the histogram. If I Integrate the function $f(x)$ between two points - which correspond to two bins, what I want to get back is a value which is close to the total counts in the region between the two bins.

Is there a relation that I need to use which scales with the number bins, such that the result of the integral $\int_{max\ bin}^{min\ bin}f(x)\ \ dx \approx N_{total}$

I hope this is clearer than my first attempt!

$\endgroup$
  • 2
    $\begingroup$ If you normalize the histogram and then estimate a curve with total area below it equal to 1, you've essentially re-created the procedure of kernel density estimation. $\endgroup$ – Sycorax Feb 9 '18 at 18:23
  • 2
    $\begingroup$ What is on your other axis? People often show frequency, proportion or percent when the real scale is one of those per unit of the variable shown. $\endgroup$ – Nick Cox Feb 9 '18 at 19:08
  • $\begingroup$ Is there some reasons why you have specified your integration interval from the maximum to the minimum values? Typically such ranges are expressed in the opposite direction, both for continuous integration notation $\int_{\min}^{\max}{f(x)dx}$ and for discrete summation notation $\sum_{i=\min}^{\max}{f(x_{i})}$. $\endgroup$ – Alexis Feb 12 '18 at 16:55
  • 1
    $\begingroup$ Please don't start multiple threads for one question: just edit the original. $\endgroup$ – whuber Feb 12 '18 at 16:59
  • $\begingroup$ @NickCox I simply use counts on the y-axis $\endgroup$ – QuantumPenguin Feb 12 '18 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.