Histogram Normalization 'pdf' area under the curve less than 1
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 20 Aug. 2019
Beantwortet: MathWorks Support Team
am 27 Jan. 2020
Why is the area under the curve (sum of bar areas) less than 1 for 'pdf' normalization in histograms?
Akzeptierte Antwort
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))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!