Performing operations between TimeArray objects—or rather between the elements contained in them—is a common occurrence in time series analysis. The TimeSeries package exposes a complete set of element-wise operators for mathematical, comparison, and logical operations.
As we have already seen when doing division between two TimeArray objects, the mathematical operators create a new TimeArray instance by using the values with common timestamps. Operations between a single TimeArray and Int or Float are also supported. The following operators are available:
- .+: Arithmetic element-wise addition
- .-: Arithmetic element-wise subtraction
- .*: Arithmetic element-wise multiplication
- ./: Arithmetic element-wise division
- .^: Arithmetic ...