quantopy.ReturnSeries.gmean¶
- ReturnSeries.gmean()[source]¶
Compute the geometric mean of series of returns. Commonly used to determine the performance results of an investment or portfolio.
Return the geometric average of the simple returns. That is: n-th root of (1+R1) * (1+R2) * … * (1+Rn)
- Returns
- np.float64
The geometric mean of past simple returns
References
- 1
“Weighted Geometric Mean”, Wikipedia, https://en.wikipedia.org/wiki/Weighted_geometric_mean.
Examples
>>> rs = qp.ReturnSeries([-0.1, 0.25, 0.05]) >>> rs.gmean() 0.057094