Mathematical Operations

Functions performing calculations over the stream.

Major themes are:

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

Gatherers

FunctionDescription
exponentialMovingAverageWithAlpha()Create an exponential average of BigDecimal values, with the given alpha.
exponentialMovingAverageWithAlphaBy()Calculate the exponential moving average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction with the given alpha.
exponentialMovingAverageWithPeriod()Create an exponential average of BigDecimal values, over the given number of periods.
exponentialMovingAverageWithPeriodBy()Calculate the exponential moving average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction over the given number of periods.
movingGeometricMean()Calculate the moving geometric mean of a Stream<BigDecimal> looking back windowSize elements.
movingGeometricMeanBy()Calculate the moving geometric mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
movingHarmonicMean()Calculate the moving harmonic mean of a Stream<BigDecimal> looking back windowSize elements.
movingHarmonicMeanBy()Calculate the moving harmonic mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
movingMax()Create a Stream that represents the moving maximum of a Stream<T> looking back windowSize elements.
movingMaxBy()Create a Stream that represents the moving maximum of a Stream<T> looking back windowSize elements, as calculated by the given Comparator.
movingMean()Calculate the moving mean of BigDecimal values over the previous windowSize number of values.
movingMeanBy()Calculate the moving mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements.
movingMedian()Create a Stream that represents the moving median of a Stream<BigDecimal> looking back windowSize elements.
movingMedianBy()Create a Stream that represents the moving median of BigDecimal objects mapped from a Stream<INPUT> via a function and looking back windowSize elements.
movingMin()Create a Stream that represents the moving minimum of a Stream<T> looking back windowSize elements.
movingMinBy()Create a Stream that represents the moving minimum of a Stream<T> looking back windowSize elements, as calculated by the given Comparator.
movingPercentile()Create a Stream that represents the moving percentile of a Stream<BigDecimal> looking back windowSize elements.
movingPercentileBy()Create a Stream that represents the moving percentile of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction, looking back windowSize elements.
movingProduct()Calculate the moving product of a Stream<BigDecimal> looking back windowSize elements.
movingProductBy()Calculate the moving product of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements.
movingRootMeanSquare()Calculate the moving root mean square (quadratic mean) of a Stream<BigDecimal> looking back windowSize elements.
movingRootMeanSquareBy()Calculate the moving root mean square (quadratic mean) of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
movingStandardDeviation()Calculate the moving standard deviation of a Stream<BigDecimal> looking back windowSize elements, as either a population or a sample.
movingStandardDeviationBy()Calculate the moving standard deviation of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements, as either a population or a sample.
movingStatistics()Calculate summary statistics (count, sum, mean, min, max, variance, and standard deviation) of a Stream<BigDecimal> looking back windowSize elements.
movingStatisticsBy()Calculate summary statistics (count, sum, mean, min, max, variance, and standard deviation) of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction, looking back windowSize elements.
movingSum()Calculate the moving sum of a Stream<BigDecimal> looking back windowSize elements.
movingSumBy()Calculate the moving sum of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements.
movingVariance()Calculate the moving variance of a Stream<BigDecimal> looking back windowSize elements, as either a population or a sample.
movingVarianceBy()Calculate the moving variance of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements, as either a population or a sample.
movingWeightedMean()Calculate the weighted moving mean of BigDecimal values over the previous windowSize number of values, giving newer values more weight.
movingWeightedMeanBy()Calculate the weighted moving mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize elements, giving newer values more weight.
runningGeometricMean()Calculate the running geometric mean of a Stream<BigDecimal>.
runningGeometricMeanBy()Calculate the running geometric mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningHarmonicMean()Calculate the running harmonic mean of a Stream<BigDecimal>.
runningHarmonicMeanBy()Calculate the running harmonic mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningMax()Calculate the running maximum value of a Stream<Comparable<T>>.
runningMaxBy()Calculate the running maximum value of a Stream<T>, as calculated by the given Comparator.
runningMean()Calculate the running mean of a Stream<BigDecimal>.
runningMeanBy()Calculate the running mean of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningMedian()Calculate the running median of a Stream<BigDecimal>.
runningMedianBy()Calculate the running median of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningMin()Calculate the running minimum value of a Stream<Comparable<T>>.
runningMinBy()Calculate the running minimum value of a Stream<T>, as calculated by the given Comparator.
runningPercentile()Calculate the running percentile of a Stream<BigDecimal>.
runningPercentileBy()Calculate the running percentile of BigDecimal objects mapped from a Stream<INPUT> 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.
runningRootMeanSquare()Calculate the running root mean square (quadratic mean) of a Stream<BigDecimal>.
runningRootMeanSquareBy()Calculate the running root mean square (quadratic mean) of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningStandardDeviation()Calculate the running standard deviation of a Stream<BigDecimal>, as either a population or a sample.
runningStandardDeviationBy()Calculate the running standard deviation of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction, as either a population or a sample.
runningStatistics()Calculate summary statistics (count, sum, mean, min, max, variance, and standard deviation) of a Stream<BigDecimal> so far.
runningStatisticsBy()Calculate summary statistics (count, sum, mean, min, max, variance, and standard deviation) of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction so far.
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.
runningVariance()Calculate the running variance of a Stream<BigDecimal>, as either a population or a sample.
runningVarianceBy()Calculate the running variance of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction, as either a population or a sample.