Equanimity
New Member
- Joined
- Feb 2, 2014
- Messages
- 9
Hello Everyone!
I’m aware of a few types of histograms.
I'm aware that Excel supports a standard "frequency histogram" via DATA > DATA ANALYSIS > HISTOGRAM. The is the simplest kind, in that the height of the bar is the # of outcomes that fall within the “bin”.
A slightly more sophisticated type of histogram is called a “Relative Frequency Histogram”, which tells us the percentage of outcomes that fall within each bin.
What I'm looking to do is build a "Normalized Relative Frequency Histogram", which does not grow taller or flatter if we change the bin width.
If we define "y" as the height of the bar, then the Normalized Relative Frequency Histogram is:
y = (# of observations in each bin) / ((bin width) * (number of realizations))
The key idea behind the Normalized Relative Frequency Histogram is that the AREA under the histogram is equal to 1 (which is important because it's consistent with the definition of probability).
Mathematically, it looks like:
area = (1/number of realizations)*(number of realizations) = 1
This type of histogram is really important in cases where the bin width shrinks close to 0 and the number of observations goes to infinity.
When taken to the limit, this type of histogram leads to the notion of Continuous Probability Density.
Does anyone know how to tackle this with some VBA code?
Thanks!
Sarah
I’m aware of a few types of histograms.
I'm aware that Excel supports a standard "frequency histogram" via DATA > DATA ANALYSIS > HISTOGRAM. The is the simplest kind, in that the height of the bar is the # of outcomes that fall within the “bin”.
A slightly more sophisticated type of histogram is called a “Relative Frequency Histogram”, which tells us the percentage of outcomes that fall within each bin.
What I'm looking to do is build a "Normalized Relative Frequency Histogram", which does not grow taller or flatter if we change the bin width.
If we define "y" as the height of the bar, then the Normalized Relative Frequency Histogram is:
y = (# of observations in each bin) / ((bin width) * (number of realizations))
The key idea behind the Normalized Relative Frequency Histogram is that the AREA under the histogram is equal to 1 (which is important because it's consistent with the definition of probability).
Mathematically, it looks like:
area = (1/number of realizations)*(number of realizations) = 1
This type of histogram is really important in cases where the bin width shrinks close to 0 and the number of observations goes to infinity.
When taken to the limit, this type of histogram leads to the notion of Continuous Probability Density.
Does anyone know how to tackle this with some VBA code?
Thanks!
Sarah