# Fitting exponential data to histogram

When dealing with a large volume of data and wanting to fit this data to five different bins (the number of bins is fixed), how might one find a good fit for the different bins relative to the data?

For instance, the data that I am currently using are classes with discrete frequencies. Like so:

class1: 10
class2: 382


In an example of the data I'm using there are 489 classes, an absolute sum of over 100,000 for the frequencies. A reasonable approach would be to delineate the bins for the histograms by the total frequencies/5 (which is 20,800 here). In an ideal world this might have 20 classes in the first bin, maybe sixty in the next, a hundred in the next and so on. However, because the data is exponential (a standard deviation of over 17,000), not even the first class would adequately fit into the bin (it has a frequency of 34,000).

What options do I have in order to create a decent fit for the different histogram bins?

• You mention classes, as if your data were categorical, but you are asking about histograms, exponential data and standard deviation, all related to continuous data. Are your data categorical on numeric?
– Pere
Dec 25, 2016 at 21:12
• @Pere I asked this question before and used the word 'continuous' which worked out badly. I got a number of posters who went to some lengths to point out to me how integers are not actually continuous, and refused to address the actual question. To all intents and purposes though, you are correct. Dec 26, 2016 at 15:09

If your data is made of 489 integer numbers, it's discrete - if we want to be strict - but it can be treated as continuous and therefore it's fine to draw a histogram.

A histogram with different interval sizes could be good to represent exponential data, although 5 bins for 489 data points seem too few to be very informative.

Anyway, if you want to select sizes for 5 bins, I'd suggest two ways:

• Percentiles of your data (0-20%, 20%-40%, 40%-60%, 60%-80% and 80%-100%).
• Percentiles of the exponential distribution if you know its rate (parameter) or you adjusted it from your data.

Anyway, if your data is actually exponential and sample size is large, both kinds of percentiles should be very similar.