Mathematical Operations

Functions performing calculations over the stream.

Major themes are:

  • Moving and running product, sum, and simple average
  • Running population and sample standard deviation
  • Variations for working with Stream<BigDecimal> or mapping input elements to BigDecimal

Gatherers

FunctionDescription
movingProduct()Calculate the moving product of a Stream<BigDecimal> looking back windowSize number of elements.
movingProductBy()Calculate the moving product of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
movingSum()Calculate the moving sum of a Stream<BigDecimal> looking back windowSize number of elements.
movingSumBy()Calculate the moving sum of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
runningPopulationStandardDeviation()Calculate the running population standard deviation of a Stream<BigDecimal>.
runningPopulationStandardDeviationBy()Calculate the running population standard deviation of a BigDecimal objects mapped from a Stream<BigDecimal> via a mappingFunction.
runningProduct()Calculate the running product of a Stream<BigDecimal>.
runningProductBy()Calculate the running product of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningSampleStandardDeviation()Calculate the running sample standard deviation of a Stream<BigDecimal>.
runningSampleStandardDeviationBy()Calculate the running sample standard deviation of a BigDecimal objects mapped from a Stream<BigDecimal> via a mappingFunction.
runningSum()Calculate the running sum of a Stream<BigDecimal>.
runningSumBy()Calculate the running sum of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
simpleMovingAverage()Calculate the simple moving average of BigDecimal values over the previous windowSize number of values.
simpleMovingAverageBy()Calculate the simple moving average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
simpleRunningAverage()Calculate the simple running average of a Stream<BigDecimal>.
simpleRunningAverageBy()Calculate the simple running average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.