# Harmonic and Geometric Moving Averages Calculator

Given a list of ordered data, you can construct the *n*-point moving average (or rolling average) by finding the average of each set of *n* consecutive points. Traditionally, one takes the arithmetic mean of the data points, however, it is also possible to calculate the geometric average or harmonic mean of the data. For example, suppose you have the ordered data set

1.53, 0.9, 1.4, 0.85, 0.7, 1.12, 1.74, 1.32

which represents the percent increase/decrease in a certain quantity. When averaging percent changes, it makes more sense to compute the geometric mean, rather than the arithmetic mean. In this example, the 3-point moving geometric average is

1.245, 1.023, 0.941, 0.873, 1.109, 1.37

You can use the calculator below to find the moving harmonic or geometric average of an ordered data set.

#### Recursive Formula for Geometric Moving Average and Harmonic Moving Average

If the number of terms in the original set is*d*and the number of terms used in each average is

*n*, then the number of terms in the moving average sequence will be

d - n + 1.

If x

_{i}is the i

^{th}data point and G

_{i}is the moving geometric average up to the i

^{th}data point, then G

_{i}can be calculated with a simple recursion:

G

_{i+1}= (G

_{i})(x

_{i+1}/x

_{i-n+1})

^{1/n}

where

*n*is the number of periods used in the moving average. Likewise, you can recursively compute each moving harmonic average term H

_{i}with a recurrence equation:

H

_{i+1}= n/[n/H

_{i}+ 1/x

_{i+1}- 1/x

_{i-n+1}]

See also the simple moving averages article and calculator.

© *Had2Know 2010
*