Language Reference |
calculates cumulative sums
where matrix is a numeric matrix or literal.
The CUSUM function returns a matrix of the same dimension as the argument matrix. The result contains the cumulative sums obtained by scanning the argument and summing in row-major order.
For example, the following statements produce the matrices and , as shown:
a=cusum({1 2 4 5}); b=cusum({5 6, 3 4});
A 1 row 4 cols (numeric) 1 3 7 12 B 2 rows 2 cols (numeric) 5 11 14 18
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.