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

4 Ansichten (letzte 30 Tage)
Why is the area under the curve (sum of bar areas) less than 1 for 'pdf' normalization in histograms?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 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))

Weitere Antworten (0)

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by