return-calculations

Calculates investment return metrics including TWR, IRR, CAGR, and annualized returns using Python scripts.

164|33|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/JoelLewis/finance_skills --skill return-calculations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: return-calculations
Source: https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations
Command: npx skills add https://github.com/JoelLewis/finance_skills --skill return-calculations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps users understand and calculate various investment return metrics, clarifying performance and growth over time.

Core Features & Use Cases

  • Calculate Key Metrics: Compute Time-Weighted Return (TWR), Money-Weighted Return (MWR/IRR), Compound Annual Growth Rate (CAGR), and simple holding period returns.
  • Understand Return Types: Differentiate between arithmetic, geometric, and log returns, and learn when to use each.
  • Annualize & Link: Convert returns across different periods and link sub-period returns for cumulative analysis.
  • Use Case: A user wants to know the true performance of their investment portfolio over the last year, considering both gains/losses and any deposits or withdrawals they made.

Quick Start

Calculate the compound annual growth rate for an investment that grew from $10,000 to $16,105.10 over 5 years.

Frequently Asked Questions about return-calculations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate investment returns when there are deposits and withdrawals?

To calculate investment returns with cash flows, you can use Money-Weighted Return (MWR/IRR) to measure performance based on the timing and size of your deposits and withdrawals.

What is the difference between TWR and MWR for portfolio performance?

TWR (Time-Weighted Return) isolates investment manager performance by removing cash flow impacts, while MWR (Money-Weighted Return) measures your actual portfolio growth based on specific deposit and withdrawal timing.

How do I calculate CAGR for an investment over multiple years?

CAGR (Compound Annual Growth Rate) is calculated by taking the nth root of the total return ratio, where n is the number of years, providing a smoothed annualized growth rate for your investment.

When should I use arithmetic vs geometric vs log returns?

Use arithmetic returns for single-period analysis, geometric returns for linking sub-periods to calculate cumulative performance, and log returns for continuous compounding analysis in mathematical modeling.

Can I use Python and numpy to link sub-period returns for cumulative analysis?

Yes, this Skill utilizes Python scripts with numpy dependencies to perform deterministic calculations, linking sub-period returns geometrically to output accurate cumulative portfolio performance metrics.

Why does my reported portfolio return differ from the market index?

Reported portfolio returns may differ from market indexes due to the impact of your specific cash flows, making metrics like Time-Weighted Return necessary to properly compare manager performance against benchmarks.