tmLowRange

Syntax

tmLowRange(T, X, window)

Please see tmFunctions for the parameters and windowing logic.

Details

For each element Xi in a sliding window of X, count the continuous nearest neighbors to its left that are larger than Xi. NULLs are treated as the minimum values.

If X is a matrix, conduct the aforementioned calculation within each column of X.

Examples

t = [0, 1, 2, 3, 7, 8, 9, 10, 11]
x = [NULL, 3.1, NULL, 3.0, 2.9, 2.8, 3.1, NULL, 3.2]
tmLowRange(t, x, window=3)
// output: [,0,1,0,0,1,0,2,0]

tmLowRange(t, x, window=4)
// output: [,0,1,0,0,1,0,3,0]

index = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)
data = 1 NULL 3 4 5 NULL 3 NULL 5 3
tmLowRange(index, data, 4h)
// output: [0,1,0,0,0,3,0,1,0,1]