mimax
Syntax
mimax(X, window, [minPeriods])
Please see Moving Functions (m-functions) for the parameters and windowing logic.
Details
Return the position of the element with the largest value in X in a sliding window.
Examples
$ x = 1.2 2 NULL 6 -1 6
$ mimax(x, 3);
[,,1,2,1,0]
$ mimax(x, 3, 1);
[0,1,1,2,1,0]
$ m=matrix(1 6 2 9 10 3, 9 10 2 6 6 6);
$ m;
#0 |
#1 |
---|---|
1 |
9 |
6 |
10 |
2 |
2 |
9 |
6 |
10 |
6 |
3 |
6 |
$ mimax(m,3);
#0 |
#1 |
---|---|
1 |
1 |
2 |
0 |
2 |
1 |
1 |
0 |