cumwsum

Syntax

cumwsum(X, Y)

Syntax

X and Y Arguments

Details

Calculate the cumulative weighted sum of X with Y as the weights. The result is a vector of the same length as X. Null values are ignored in the calculation.

Examples

$ cumwsum(2.2 1.1 3.3, 4 5 6);
[8.8,14.3,34.1]

$ cumwsum(1 NULL 1, 1 1 1);
[1,1,2]

Related function: wsum