Aggregators

Aggregators are the tools to connect between DGGS Calculator and DGGS Selectors, in a form to generating summaries (or statistics) based on the given values and selected cells.

the DGGS Language SDK provide several built in aggregate functions:
  1. min - return the minimum value found for a given DGGS calculator and selector.
  2. max - return the maximum value found for a given DGGS calculator and selector.
  3. average - return the average value found for a given DGGS calculator and selector.
  4. standard deviation - return the standard deviation calculated on the cells value for a given DGGS calculator and selector.
  5. histogram - return an histogram of values for a given DGGS calculator and selector.
Here is an example how to use the built in functions:

 

The DGGS provide opportunities for optimize the run time for those aggregate functions. we can leverage the DGGS Structure and run those aggregate functions on low resolutions first and increase the resolution over time. lower resolution have fewer cells, however, larger amount of error. Moreover, we can leverage the DGGS.Calculator.getRange(selector) to give a bound on error introduced into the aggregated results. 

Therefore, those aggregate functions provide additional async interface for estimating the results with a given error bound:

 

async estimation is applyed simulansly for both DGGS Calculator evaluations and DGSS Selector evaluation.


Comments