Skip to content

abs

Input Stack:
expr: TimeSeriesExpr
Output Stack:
TimeSeriesExpr

Compute a new time series where each interval has the absolute value of the input time series. This ensures all values are non-negative by converting negative values to positive while leaving positive values unchanged.

Parameters

  • expr: The time series expression to take the absolute value of

Examples

Demonstrating absolute value with different constant values:

064-64
0,:abs
64,:abs
-64,:abs

This shows that :abs converts 0 to 0, leaves positive values unchanged, and converts negative values to positive.

  • :neg - Negation (changes sign, compared to abs which removes sign)
  • :sub - Subtraction (often used with abs for absolute differences)
  • :add - Addition operation
  • :mul - Multiplication operation