Histogram Normalization 'pdf' area under the curve less than 1

8 views (last 30 days)
Why is the area under the curve (sum of bar areas) less than 1 for 'pdf' normalization in histograms?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Aug 2019
When using the 'pdf' normalization in Histograms, note that the area of each bar is the relative number of observations. Therefore, the area under the curve could be less than or equal to 1.
An example of the area under the curve being less than 1 is having 'NaN' values in your data.
>> X = [1 1 2 nan];
>> h = histogram(X, 'Normalization', 'pdf')
>> sum(h.Values.*h.BinWidth)
Removing the NaN values from the data can be done like so -
>> X = X(~isnan(X))

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!