Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
calc_histogram [2012/11/23 23:42]
admin [Notes]
calc_histogram [2026/08/28 03:11] (current)
hermann Sync from local documentation review
Line 3: Line 3:
 ===== Description ===== ===== Description =====
  
-This functor calculates ​a histogram from a map.+Calculates ​a histogram from a map.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Map  | [[Map Type|Map]]  | Any map  |+| Map  | [[Map Type]] ​ | Any map |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
-^ Name ^ Type ^ Description ^ Default Value ^ +^ Name  ^ Type  ^ Description ​ ^ Default Value  
-| Interval Width  | [[Double ​Type|Double]] | The width of the histogram interval. ​ | 1.0  | +| Interval Width  | [[Real Value Type]] ​ Width of each histogram interval ​(bin).  | 1  | 
-| Cumulative ​ | [[Bool Type|Bool]]  | If true, the calculated histogram is cumulative. ​ | False  | +| Cumulative ​ | [[Boolean Value Type]] ​ | If true, the calculated histogram is cumulative. ​ | No  | 
-| Relative ​ | [[Bool Type|Bool]]  | If true, the values in the histogram are normalized by the total number of occurrences. | False  |+| Relative ​ | [[Boolean Value Type]] ​ | If true, the values in the histogram are normalized by the total number of occurrences. ​ No  |
  
 ===== Outputs ===== ===== Outputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Histogram ​ | [[Lookup Table Type|Lookup Table]]  | The calculated histogram. ​ |+| Histogram ​ | [[Lookup Table Type]] ​ | The calculated histogram. ​ |
  
-===== Notes =====+===== Group =====
  
-It also possible to calculate a histogram relative to the cumulative values. To do this, set both input flags ("​Cumulative"​ and "​Relative"​).+[[Functor List#​Statistics | Statistics]]
  
-When the "​Interval Width" is different from one, the input values are remapped according to the expression below to speed up the calculation.+===== Notes =====
  
-<​m>​value´=delim{|}{value/​width}{|}*width</​m>,​ where //value´// is the resulting value, //value// is the value present in the input map and //​width// ​is the width of the interval.+Only the map's first layer is used to build the histogram.
  
-Because of the remapping, ​the lower and upper limits ​of the resulting histogram can be lower and greaterrespectivelythan the lower and upper limits ​of the input map  ​+Each key in the output table is the lower bound of an interval, obtained by rounding ​the corresponding cell value down to the nearest multiple of Interval Width; the associated value is the count of cells falling in that interval (orif Relative is truethat count divided by the total number ​of non-null cells). Because of this rounding, ​the lowest and highest keys in the resulting table can fall outside the range of values actually present in Map.
  
-===== Group =====+Setting both Cumulative and Relative produces a histogram of cumulative relative frequencies.
  
-[[Functor List#​Statistics|Statistics]]+Raises an error if Interval Width is not greater than 0.
  
 ===== Internal Name ===== ===== Internal Name =====