I was using the mvport package (SSC) written by Alberto Dorantes. The package has meanrets program for finding geometric mean, however, its results seem to be upward biased, I cross checked it with MS EXCEL and another package gmci (SSC), this is to confirm that the meanrets has bugs, or am I missing something. See the following examples
Note that due to non-positive values, I had add option add(1) to the gmci, which later would be deducted.
:
clear input float(Price t) 12 1 10 2 12 3 15 4 13 5 18 6 24 7 18 8 17 9 22 10 end tsset t gen ri=p/l.p-1 gen gr=ln(p/l.p) . meanrets ri gr Observations to calculate expected simple returns: 10 Expected simple returns (Geometric means): Exp ret ri .09984347 gr .06966811 . gmci ri gr, add(1) Variable | Obs Geometric Mean [95% Conf. Interval] ------------+----------------------------------------------------------- ri | 9 1.06967 0.89375 1.28021 * gr | 9 1.04302 0.87249 1.24687 * (*) 1 was added to the variable(s) prior to calculating the results . sum ri gr Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- ri | 9 .0951679 .244355 -.25 .3846154 gr | 9 .0673484 .2337455 -.2876821 .3254224