For the purposes of MPT, to compute return of an asset, one typically uses the daily log return of the assets and then anualizes it and the same goes for stddev
mean = mean(daily log returns)*252 stddev = stddev(daily log returns)*sqrt(252)
Now, I've several years worth of data. So I also compute this in a different way as well to compare:
I compute the annual return for each year separately (i.e., non overlapping, calendar year)
annual return = (P365 - P1)/P1
And then the mean
mean = mean(annual returns for each year) stddev = stddev(annual returns)
Now, when I compare the restults from these two, there seems to be large differences. For instance, I get a (mean, stddev) of (13%, 26%) by the first method compared to (22%, 52%) in the second method. Doing an exp(mean) in the first method to compare the results doesn't make much of a difference.
First method: In : np.log(t2.a.pct_change()+1).mean()*252 Out: 0.13256313708025944 In : np.exp(np.log(t2.a.pct_change()+1).mean()*252) Out: 1.1417511006444343 In : np.log(t2.a.pct_change()+1).std()*np.sqrt(252) Out: 0.2666418976278336 Second method: In : t2.a.groupby(t2.a.index.year).apply(lambda x:(x[-1] - x)/x).mean() Out: 0.2223071697039014 In : t2.a.groupby(t2.a.index.year).apply(lambda x:(x[-1] - x)/x).std() Out: 0.5251807718593228
Question: Are we likely to see such large differences between annualized returns and the annual returns...esp the volatility part? Or am I going wrong somewhere?
Thank you for your time.