
Return Calculations
When you need to explain why a fund's 8% time-weighted return translates to a negative money-weighted return for an investor who deposited right before a drawdown, this is the skill to load. It covers the full spectrum from simple holding period returns through CAGR, TWR, MWR/IRR, and the math behind geometric versus arithmetic means. The worked examples are solid, showing exactly how cash flow timing creates divergence between what the manager earned and what the investor experienced. It's Layer 0 math, so expect formulas and precision rather than high-level commentary. Use it when someone asks about portfolio performance, linking sub-period returns, or why their actual return feels different from what their advisor reported.
- skills.sh installs
- 745
- GitHub stars
- 224
- last updated
- Aug 21, 2026
Install
$ npx -y skills add joellewis/finance_skills --skill return-calculations --agent claude-codeInstalls into .claude/skills of the current project.
Files
Return Calculations
Core Concepts
Simple (Holding Period) Return
$$R = \frac{V_{end} - V_{begin} + D}{V_{begin}}$$
where D = distributions (dividends, interest) received during the period. If V_end already reflects reinvested distributions, do not add D again.
Mean and Log Return Conventions
- Arithmetic mean
R_a = (1/n) * sum(R_i)— unbiased estimate of the expected single-period return (use for forward-looking inputs, e.g., mean-variance optimization). Always >= geometric mean; overstates realized compound growth. - Geometric mean
R_g = [prod(1 + R_i)]^(1/n) - 1— the correct measure of realized multi-period compound growth. The gap below the arithmetic mean approximatessigma^2 / 2(volatility drag). - Log return
r = ln(V_end / V_begin)— time-additive (r_total = r_1 + ... + r_n), so preferred for statistical modeling and multi-period aggregation. Convert withR_simple = e^r - 1andr = ln(1 + R_simple). Log returns are additive across time but NOT across assets.
CAGR (Compound Annual Growth Rate)
$$CAGR = \left(\frac{V_{end}}{V_{begin}}\right)^{1/n} - 1$$
Sponsors
Details
- Repository
- github.com/joellewis/finance_skills
- Categories
- Debugging, Finance & Trading
- First seen
- Jun 3, 2026
More from joellewis/finance_skills
All 84- Lending741
- Savings Goals741
- Trade Execution739
- Fund Vehicles737
- Forward Risk733
- Privacy Data Security731
- Performance Reporting729
- Equities727
- Tax Efficiency724
- Anti Money Laundering723
- Financial Planning Integration723
- Advertising Compliance722
- Fixed Income Corporate722
- Portfolio Management Systems721
- Real Assets721
- Digital Assets719
- Fixed Income Sovereign718
- Know Your Customer715
- Tax Loss Harvesting715
- Investment Suitability714
- Next Best Action712
- Qualitative Valuation709
- Reconciliation707
- Regulatory Reporting707