cummed

Syntax

cummed(X)

Arguments

X is a scalar/vector.

Details

If X is a vector, calculate the cumulative median of X. The result is a vector of the same length as X. Null values are ignored in the calculation.

If X is a matrix, conduct the aforementioned calculation within each column of X. The result is a matrix with the same shape as X.

Examples

$ x = [7,9,5,NULL,9]
$ cummed(x);
[7,8,7,7,8]

$ m = matrix(6 5 7 8 1, 3 9 4 2 10);
$ m;

#0

#1

6

3

5

9

7

4

8

2

1

10

$ cummed(m);

#0

#1

6

3

5.5

6

6

4

6.5

3.5

6

4

Related functions: cummax, cummin, cumprod, cumPositiveStreak, cumsum, cumavg, cumstd