joellewis avatar

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-code

Installs 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 approximates sigma^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 with R_simple = e^r - 1 and r = 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

Recommended

More Debugging
1netresearch avatargit-workflownetresearch/git-workflow-skillUse when establishing branching strategies, implementing Conventional Commits, creating or reviewing PRs, resolving PR review comments, merging PRs (including C743skills.sh installs
2github avatarcode-tourgithub/awesome-copilotUse this skill to create CodeTour .tour files — persona-targeted, step-by-step walkthroughs that link to real files and line numbers. Trigger for: "create a tou739skills.sh installs
3joellewis avatarfund-vehiclesjoellewis/finance_skillsCompare and select investment vehicles including mutual funds, ETFs, index funds, and separately managed accounts. Use when the user asks about ETF vs mutual fu737skills.sh installs
4black-forest-labs avatarbfl-apiblack-forest-labs/skillsBFL FLUX API integration guide covering endpoints, async polling patterns, rate limiting, error handling, webhooks, and regional endpoints with Python and TypeS735skills.sh installs
5akin-ozer avatarbash-script-validatorakin-ozer/cc-devops-skillsValidate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.734skills.sh installs
6alirezarezvani avatarrevenue-operationsalirezarezvani/claude-skillsAnalyzes sales pipeline health, revenue forecasting accuracy, and go-to-market efficiency metrics for SaaS revenue optimization. Use when analyzing sales pipeli733skills.sh installs