CUMAVG

Purpose:

Calculates the cumulative average of a series.

Syntax:

CUMAVG(series)

series

-

A series or table.

Returns:

A series or table.

Example:

cumavg({20, 15, 30, 10, 25})

 

returns {20, 17.5, 21.6667, 18.75, 20}.

Example:

W1: gnorm(1000, 1)

W2: gline(length(w1), deltax(w1), 1/1000, 0)

W3: W1 + W2

W4: cumavg(W3)

 

W3 contains the sum of 1000 random samples and a linear trend.

 

W4 shows the linear trend developing as more samples of the data are averaged.

Example:

W1: integ(gnorm(1000, 1))

W2: cumavg(W1)

 

mean(W1) == W2[end]

 

The last point of CUMAVG is the overall average of the input data.

Remarks:

The nth value of the output series is equal to the mean of the first n points of the input series:

 

 

See CUMSUM to compute the cumulative sum.

See Also:

CUMPROD

CUMSUM

CUMTRAPZ

INTEG

MEAN

MOVAVG

PARTSUM

SUM