Differences

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

Link to this comparison view

Both sides previous revision Previous revision
calc_histogram [2015/10/12 00:42]
admin
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]] ​ | Any map  |+| Map  | [[Map Type]] ​ | Any map |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
 ^ Name  ^ Type  ^ Description ​ ^ Default Value  ^ ^ Name  ^ Type  ^ Description ​ ^ Default Value  ^
-| Interval Width  | [[Real Value Type]] ​ | The width of the histogram interval. ​ | 1.0  | +| Interval Width  | [[Real Value Type]] ​ | Width of each histogram interval ​(bin).  | 1  | 
-| Cumulative ​ | [[Boolean Value Type]] ​ | If true, the calculated histogram is cumulative. ​ | False  | +| Cumulative ​ | [[Boolean Value Type]] ​ | If true, the calculated histogram is cumulative. ​ | No  | 
-| Relative ​ | [[Boolean Value Type]] ​ | 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>​value2 =delim{|}{value/​width}{|}*width</​m>,​ where //value2// is the resulting value, //value// is the value present in the input map and //​width// ​is the "​Interval Width".+Only the map's first layer is used to build the histogram.
  
-Because of the remapping, ​the lower limit of the resulting histogram can be lower than the minimum ​value in the input mapThe upper limit of the histogram ​can be greater than the maximum value in 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 (or, if Relative is true, that 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 =====