Class BigDecimalEmStdOperator


public class BigDecimalEmStdOperator extends BaseBigNumberEmStdOperator<BigDecimal>
Compute an exponential moving standard deviation for a BigDecimal column source. The output is expressed as a BigDecimal value and is computed using the following formula:

variance = alpha * (prevVariance + (1 - alpha) * (x - prevEma)^2)

This function is described in the following document:

"Incremental calculation of weighted mean and variance" Tony Finch, University of Cambridge Computing Service (February 2009) https://web.archive.org/web/20181222175223/http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf

NOTE: `alpha` as used in the paper has been replaced with `1 - alpha` per the convention adopted by Deephaven.

  • Constructor Details

    • BigDecimalEmStdOperator

      public BigDecimalEmStdOperator(@NotNull @NotNull MatchPair pair, @NotNull @NotNull String[] affectingColumns, @NotNull @NotNull OperationControl control, @Nullable @Nullable String timestampColumnName, double windowScaleUnits, @NotNull @NotNull MathContext mathContext)
      An operator that computes an EM Std from a BigDecimal column using an exponential decay function.
      Parameters:
      pair - the MatchPair that defines the input/output for this operation
      affectingColumns - the names of the columns that affect this ema
      control - defines how to handle null input values.
      timestampColumnName - the name of the column containing timestamps for time-based calcuations
      windowScaleUnits - the smoothing window for the EMA. If no timestampColumnName is provided, this is measured in ticks, otherwise it is measured in nanoseconds
  • Method Details