return-calculations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Return Calculations

回报计算

Purpose

用途

This skill enables Claude to compute, explain, and compare investment return metrics across different methodologies and time horizons. It covers the full spectrum from simple holding-period returns through time-weighted and money-weighted returns, ensuring the appropriate metric is selected for each analytical context.
该技能支持Claude计算、解释并对比不同方法和时间跨度下的投资回报指标,覆盖从简单持有期回报到时间加权回报、资金加权回报的全范围场景,确保为每个分析场景选择合适的指标。

Layer

层级

0 — Mathematical Foundations
0 — 数学基础

Direction

方向

retrospective
回顾性

When to Use

使用场景

  • User asks about calculating investment returns
  • Comparing returns across different time periods
  • Understanding arithmetic vs geometric vs log returns
  • Computing CAGR, TWR, MWR/IRR
  • Linking sub-period returns
  • 用户询问投资回报计算方法
  • 对比不同时间段的回报
  • 理解算术均值、几何均值与对数回报的差异
  • 计算CAGR、TWR、MWR/IRR
  • 合并子周期回报

Core Concepts

核心概念

Simple (Holding Period) Return

简单(持有期)回报

The most basic measure of investment performance over a single period, capturing price change plus any income received.
$$R = \frac{V_{end} - V_{begin} + D}{V_{begin}}$$
where:
  • V_end
    = ending value
  • V_begin
    = beginning value
  • D
    = distributions (dividends, interest) received during the period
衡量单一时间段投资表现的最基础指标,涵盖价格变动及期间获得的任何收益。
$$R = \frac{V_{end} - V_{begin} + D}{V_{begin}}$$
其中:
  • V_end
    = 期末价值
  • V_begin
    = 期初价值
  • D
    = 期间获得的分配收益(股息、利息等)

Arithmetic Mean Return

算术平均回报

The simple average of a series of periodic returns. Represents the expected return for any single period.
$$R_a = \frac{1}{n} \sum_{i=1}^{n} R_i$$
The arithmetic mean is always greater than or equal to the geometric mean. It is an unbiased estimator of the expected single-period return but overstates the compounded growth rate.
一系列周期性回报的简单平均值,代表任意单一时间段的预期回报。
$$R_a = \frac{1}{n} \sum_{i=1}^{n} R_i$$
算术平均值始终大于或等于几何平均值,是单一时间段预期回报的无偏估计,但会高估复合增长率。

Geometric Mean Return

几何平均回报

The constant rate that, if earned each period, would produce the same terminal wealth as the actual sequence of returns.
$$R_g = \left(\prod_{i=1}^{n}(1 + R_i)\right)^{1/n} - 1$$
The geometric mean captures the effects of compounding and volatility drag. It is always the correct choice for describing realized multi-period growth.
若每期都获得该恒定收益率,最终财富将与实际回报序列产生的终端财富相同的收益率。
$$R_g = \left(\prod_{i=1}^{n}(1 + R_i)\right)^{1/n} - 1$$
几何均值体现了复利和波动拖累的影响,是描述实际多期增长的正确选择。

Log (Continuously Compounded) Return

对数(连续复利)回报

The natural logarithm of the wealth ratio. Log returns are time-additive, making them convenient for multi-period aggregation and statistical modeling.
$$r = \ln\left(\frac{V_{end}}{V_{begin}}\right)$$
Properties:
  • Time-additive:
    r_total = r_1 + r_2 + ... + r_n
  • Conversion:
    R_simple = e^r - 1
    and
    r = ln(1 + R_simple)
  • More symmetric and closer to normally distributed than simple returns for small magnitudes
财富比率的自然对数。对数回报具有时间可加性,便于多期汇总和统计建模。
$$r = \ln\left(\frac{V_{end}}{V_{begin}}\right)$$
特性:
  • 时间可加性:
    r_total = r_1 + r_2 + ... + r_n
  • 转换关系:
    R_simple = e^r - 1
    r = ln(1 + R_simple)
  • 相较于简单回报,小幅度对数回报更对称且更接近正态分布

CAGR (Compound Annual Growth Rate)

CAGR(复合年增长率)

The annualized geometric return that equates the beginning value to the ending value over a given number of years.
$$CAGR = \left(\frac{V_{end}}{V_{begin}}\right)^{1/n} - 1$$
where
n
is measured in years. CAGR smooths out volatility and provides a single annualized growth figure.
使期初价值在指定年限内增长至期末价值的年化几何回报。
$$CAGR = \left(\frac{V_{end}}{V_{begin}}\right)^{1/n} - 1$$
其中
n
以年为单位。CAGR平滑了波动,提供单一的年化增长数值。

Time-Weighted Return (TWR)

时间加权回报(TWR)

Chain-links sub-period returns calculated between each external cash flow, thereby removing the effect of cash flow timing on the measured return. TWR measures the manager's investment skill independent of investor deposit/withdrawal decisions.
$$1 + R_{TWR} = \prod_{i=1}^{n}(1 + R_i)$$
where each sub-period return
R_i
is computed between consecutive cash flow dates:
$$R_i = \frac{V_{end,i}}{V_{begin,i} + CF_i}$$
In practice, exact TWR requires portfolio valuation on every cash flow date. The Modified Dietz method approximates TWR when daily valuations are unavailable.
将每个外部现金流之间的子周期回报链式连接,从而消除现金流时机对回报计量的影响。TWR用于衡量基金经理的投资技能,不受投资者存入/取出资金决策的影响。
$$1 + R_{TWR} = \prod_{i=1}^{n}(1 + R_i)$$
其中每个子周期回报
R_i
在连续现金流日期之间计算:
$$R_i = \frac{V_{end,i}}{V_{begin,i} + CF_i}$$
实际操作中,精确的TWR需要在每个现金流日期对投资组合进行估值。当无法获取每日估值时,可使用Modified Dietz方法近似计算TWR。

Money-Weighted Return (MWR / IRR)

资金加权回报(MWR / IRR)

The internal rate of return that sets the net present value of all cash flows (contributions, withdrawals, and terminal value) to zero.
$$0 = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$
MWR reflects the actual investor experience because it is sensitive to the timing and magnitude of cash flows. It rewards (penalizes) investors who add capital before good (bad) periods.
使所有现金流(缴款、取款和终端价值)的净现值为零的内部收益率。
$$0 = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$
MWR反映了投资者的实际体验,因为它对现金流的时机和规模敏感。若投资者在行情好(差)之前追加资金,MWR会奖励(惩罚)该投资者。

Annualization

年化转换

Converts a return measured over any holding period to an equivalent annual rate, assuming compounding.
$$R_{annual} = (1 + R_{period})^{periods_per_year} - 1$$
For example, a 2% quarterly return annualizes to
(1.02)^4 - 1 = 8.24%
.
将任意持有期的回报转换为等效的年化收益率,假设复利计算。
$$R_{annual} = (1 + R_{period})^{periods_per_year} - 1$$
例如,2%的季度回报年化后为
(1.02)^4 - 1 = 8.24%

Sub-Period Linking

子周期合并

Combines returns from contiguous sub-periods into a single cumulative return.
$$(1 + R_{total}) = \prod_{i=1}^{n}(1 + R_i)$$
This is the foundational identity behind TWR and CAGR calculations.
将连续子周期的回报合并为单一累计回报。
$$(1 + R_{total}) = \prod_{i=1}^{n}(1 + R_i)$$
这是TWR和CAGR计算的基础恒等式。

Key Formulas

核心公式

FormulaExpressionUse Case
Holding Period Return
R = (V_end - V_begin + D) / V_begin
Single-period total return
Arithmetic Mean
R_a = (1/n) * sum(R_i)
Expected single-period return
Geometric Mean
R_g = [prod(1+R_i)]^(1/n) - 1
Realized compound growth rate
Log Return
r = ln(V_end / V_begin)
Time-additive return for modeling
CAGR
(V_end / V_begin)^(1/n) - 1
Annualized growth over n years
TWR
prod(1 + R_i) - 1
Manager performance (cash-flow neutral)
MWR / IRR
sum(CF_t / (1+r)^t) = 0
, solve for r
Investor-specific experience
Annualization
(1 + R_period)^(periods/year) - 1
Standardize to annual basis
Sub-Period Linking
(1 + R_total) = prod(1 + R_i)
Combine contiguous returns
公式表达式适用场景
持有期回报
R = (V_end - V_begin + D) / V_begin
单期总回报
算术均值
R_a = (1/n) * sum(R_i)
预期单期回报
几何均值
R_g = [prod(1+R_i)]^(1/n) - 1
实际复合增长率
对数回报
r = ln(V_end / V_begin)
用于建模的时间可加性回报
CAGR
(V_end / V_begin)^(1/n) - 1
n年期的年化增长
TWR
prod(1 + R_i) - 1
基金经理绩效(现金流中性)
MWR / IRR
sum(CF_t / (1+r)^t) = 0
, 求解r
特定投资者的体验
年化转换
(1 + R_period)^(periods/year) - 1
标准化为年度基准
子周期合并
(1 + R_total) = prod(1 + R_i)
合并连续回报

Worked Examples

示例计算

Example 1: Computing CAGR from a 5-Year Investment

示例1:计算5年期投资的CAGR

Given: An investment of $10,000 grows to $16,105.10 over exactly 5 years with no intermediate cash flows.
Calculate: The compound annual growth rate (CAGR).
Solution:
CAGR = (V_end / V_begin)^(1/n) - 1
CAGR = (16,105.10 / 10,000)^(1/5) - 1
CAGR = (1.610510)^(0.2) - 1
CAGR = 1.10 - 1
CAGR = 0.10 = 10%
The investment grew at a compound annual rate of 10% per year.
Verification:
$10,000 * (1.10)^5 = $10,000 * 1.61051 = $16,105.10
已知: 10,000美元的投资在5年内无中间现金流,增长至16,105.10美元。
计算: 复合年增长率(CAGR)。
解法:
CAGR = (V_end / V_begin)^(1/n) - 1
CAGR = (16,105.10 / 10,000)^(1/5) - 1
CAGR = (1.610510)^(0.2) - 1
CAGR = 1.10 - 1
CAGR = 0.10 = 10%
该投资的复合年增长率为10%
验证:
$10,000 * (1.10)^5 = $10,000 * 1.61051 = $16,105.10

Example 2: TWR vs MWR Divergence with Poorly Timed Cash Flow

示例2:现金流时机不佳时TWR与MWR的差异

Given: A fund has the following history:
  • Start of Year 1: Portfolio value = $100,000
  • End of Year 1: Portfolio value = $120,000 (return = +20%)
  • Start of Year 2: Investor deposits $100,000, bringing portfolio to $220,000
  • End of Year 2: Portfolio value = $198,000 (return = -10%)
Calculate: Both TWR and MWR, and explain the divergence.
Solution:
Time-Weighted Return (TWR):
Sub-period 1 return: R_1 = (120,000 - 100,000) / 100,000 = +20%
Sub-period 2 return: R_2 = (198,000 - 220,000) / 220,000 = -10%

TWR (cumulative) = (1 + 0.20) * (1 + (-0.10)) - 1
                  = 1.20 * 0.90 - 1
                  = 1.08 - 1
                  = +8.0%

TWR (annualized) = (1.08)^(1/2) - 1 = 3.92%
Money-Weighted Return (MWR / IRR): Cash flows from the investor's perspective:
  • t=0: -$100,000 (initial investment)
  • t=1: -$100,000 (additional deposit)
  • t=2: +$198,000 (terminal value)
Solve:
-100,000 + (-100,000)/(1+r) + 198,000/(1+r)^2 = 0
Testing r = -0.0051 (approximately -0.51%):
-100,000 + (-100,000)/0.9949 + 198,000/0.9899
= -100,000 - 100,512.6 + 200,020.2
approx -492.4  (close to zero; actual IRR approx -0.48%)
The MWR is approximately -0.48% annualized.
Interpretation: The TWR of +3.92% annualized reflects the manager's skill: the fund gained 20% then lost 10%, netting +8% over two years. The MWR of approximately -0.48% reflects the investor's experience: more money was at risk during the losing year (Year 2) because of the large deposit, so the investor's dollar-weighted outcome was slightly negative. This divergence highlights why TWR is preferred for evaluating manager performance, while MWR better describes the specific investor's realized result.
已知: 某基金的历史表现如下:
  • 第1年初:投资组合价值 = 100,000美元
  • 第1年末:投资组合价值 = 120,000美元(回报 = +20%)
  • 第2年初:投资者存入100,000美元,投资组合价值变为220,000美元
  • 第2年末:投资组合价值 = 198,000美元(回报 = -10%)
计算: TWR和MWR,并解释两者差异。
解法:
时间加权回报(TWR):
子周期1回报:R_1 = (120,000 - 100,000) / 100,000 = +20%
子周期2回报:R_2 = (198,000 - 220,000) / 220,000 = -10%

累计TWR = (1 + 0.20) * (1 + (-0.10)) - 1
                  = 1.20 * 0.90 - 1
                  = 1.08 - 1
                  = +8.0%

年化TWR = (1.08)^(1/2) - 1 = 3.92%
资金加权回报(MWR / IRR): 从投资者视角的现金流:
  • t=0: -100,000美元(初始投资)
  • t=1: -100,000美元(追加存款)
  • t=2: +198,000美元(终端价值)
求解:
-100,000 + (-100,000)/(1+r) + 198,000/(1+r)^2 = 0
测试r = -0.0051(约-0.51%):
-100,000 + (-100,000)/0.9949 + 198,000/0.9899
= -100,000 - 100,512.6 + 200,020.2
≈ -492.4 (接近零;实际IRR约为-0.48%)
年化MWR约为**-0.48%**。
解读: 年化TWR为+3.92%,反映了基金经理的投资技能:基金先上涨20%再下跌10%,两年累计回报+8%。而年化MWR约为-0.48%,反映了投资者的实际体验:由于在第2年(下跌年份)追加了大额资金,更多资金面临亏损风险,因此投资者的美元加权回报略为负值。这种差异凸显了为何评估基金经理绩效时首选TWR,而MWR更能描述特定投资者的实际收益结果。

Common Pitfalls

常见误区

  • Confusing arithmetic and geometric means: the arithmetic mean is always greater than or equal to the geometric mean (AM-GM inequality). Using arithmetic mean to project compounded growth overstates terminal wealth.
  • Using arithmetic mean for multi-period compounding: always use geometric mean or CAGR when describing compound growth over multiple periods.
  • Annualizing returns from very short periods: annualizing a 2% weekly return yields
    (1.02)^52 - 1 = 180%
    , which amplifies noise and is misleading. Annualization is most meaningful for periods of at least one year.
  • Ignoring cash flow timing when TWR is appropriate: MWR conflates manager skill with investor timing decisions. Use TWR for manager evaluation.
  • Double-counting dividends: if the ending value
    V_end
    already includes reinvested dividends, do not add
    D
    separately in the holding period return formula.
  • 混淆算术均值与几何均值:算术均值始终大于或等于几何均值(AM-GM不等式)。使用算术均值预测复合增长会高估终端财富。
  • 使用算术均值进行多期复利计算:描述多期复合增长时,应始终使用几何均值或CAGR。
  • 对极短周期回报进行年化:将2%的周回报年化得到
    (1.02)^52 - 1 = 180%
    ,这会放大噪声并产生误导。年化对至少一年的周期最有意义。
  • 在适合使用TWR的场景忽略现金流时机:MWR混淆了基金经理的技能与投资者的时机决策。评估基金经理时应使用TWR。
  • 重复计算股息:若期末价值
    V_end
    已包含再投资股息,则在持有期回报公式中不应额外添加
    D

Cross-References

交叉引用

  • time-value-of-money (core plugin, Layer 0): NPV, IRR, and discounting concepts overlap with MWR calculations
  • statistics-fundamentals (core plugin, Layer 0): Arithmetic and geometric means, return distribution analysis
  • time-value-of-money(核心插件,层级0):NPV、IRR和贴现概念与MWR计算重叠
  • statistics-fundamentals(核心插件,层级0):算术均值、几何均值、回报分布分析

Reference Implementation

参考实现

See
scripts/return_calculations.py
for computational helpers.
计算工具可参考
scripts/return_calculations.py