cumavg
Syntax
cumavg(X)
Please see Cumulative Window Functions (cum-functions) for the parameters and windowing logic.
Details
Calculate the cumulative average of X.
Examples
$ x=[2,3,NULL,4];
cumavg(x);
[2,2.5,2.5,3]
$ m=matrix(1 2 3 NULL 4, 5 6 NULL 7 8);
$ m;
#0 |
#1 |
---|---|
1 |
5 |
2 |
6 |
3 |
|
7 |
|
4 |
8 |
$ cumavg(m);
#0 |
#1 |
---|---|
1 |
5 |
1.5 |
5.5 |
2 |
5.5 |
2 |
6 |
2.5 |
6.5 |
Related functions: cummax, cummin, cumprod, cumPositiveStreak, cumsum