Language Reference

GEOMEAN Function

calculates geometric means

GEOMEAN( matrix)

where matrix is a numeric matrix of nonnegative values.

The GEOMEAN function returns a scalar containing the geometric mean of the elements of the input matrix. The geometric mean of a set of nonnegative numbers a_1, a_2, ... ,a_n is the nth root of the product a_1 \cdot a_2  ...  a_n.

The geometric mean is zero if any of the a_i are zero. The geometric mean is not defined for negative inputs. If any of the a_i are missing, they are excluded from the computation.

The geometric mean can be used to compute the average return on an investment. For example, the following data gives the annual returns on U.S. Treasury bonds from 1994 - 2004. The following statements compute that the average rate of return during this time was 6.43%:

  
    /*         year  return% */ 
    TBonds = { 1994  -8.04, 
               1995  23.48, 
               1996   1.43, 
               1997   9.94, 
               1998  14.92, 
               1999  -8.25, 
               2000  16.66, 
               2001   5.57, 
               2002  15.12, 
               2003   0.38, 
               2004   4.49 }; 
  
    proportion = 1 + TBonds[,2]/100; /* convert to proportion */ 
    aveReturn = geomean( proportion ); 
    print aveReturn; 
  
  
                                 aveReturn 
  
                                 1.0643334
 

Previous Page | Next Page | Top of Page