关于「「大量情景」有多大:房价与基金联动路径的蒙特卡洛」,《租售比与典权回赎期权》给出的定量结论是什么?
结论:第三章用固定种子的蒙特卡洛显示租房定投在 0.7035 的路径中期末领先,但其结局更分散,且一半优势来自投资纪律。
数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化的分析,不构成法律或理财建议,涉及古代法条之处只述大意,以上架前人工复核为准。 第一章用用户成本说明,在租金回报率为 0.016 的示意城市里,房租连房东的利息与税费都付不清,结论最敏感的参数是资金的机会成本。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.7035
| 20000 paths, 20 years, Taipei-like illustrative case | |
| mean p10 median p90 | |
| W_buy | 109.94 51.41 101.26 179.34 |
| W_rent | 168.92 71.22 141.74 295.54 |
| rent-buy | 58.98 -57.87 41.73 191.78 |
| P(renter ends ahead) | 0.7035 |
| P(buyer ahead by > 20 % of median W_buy) 0.2110 | |
| sd W_buy 52.89 sd W_rent 108.59 |
查看完整验算程序
# Chapter 3. p31: Random paths for the house and the index fund.
# Model: the ledger of p21, but yearly house and fund returns are
# correlated lognormal draws whose arithmetic means equal the base-case
# growth rates (house 0.02, fund 0.06); volatilities 0.08 and 0.16,
# correlation 0.2. Rent stays at yield x current price, so it moves with
# the house. 20000 paths of 20 years, fixed seed. All illustrative.
import math
import random
import statistics
BASE = {"price": 100.0, "yield": 0.016, "rate": 0.022, "ltv": 0.8,
"term": 30, "buy_cost": 0.02, "sell_cost": 0.04, "hold": 0.006,
"g": 0.02, "equity": 0.06}
def annuity(principal, rate, years):
if rate == 0:
return principal / years
return principal * rate / (1.0 - (1.0 + rate) ** -years)
def run_path(p, gh, gs):
"""gh, gs: yearly gross factors of house price and index fund."""
price = p["price"]
loan = p["ltv"] * price
pay = annuity(loan, p["rate"], p["term"])
bal = loan
port_b = 0.0
port_r = (1.0 - p["ltv"] + p["buy_cost"]) * price
for t in range(len(gh)):
c_b = math.fsum([pay if t < p["term"] else 0.0,
p["hold"] * price])
c_r = p["yield"] * price
port_b = (port_b + max(c_r - c_b, 0.0)) * gs[t]
port_r = (port_r + max(c_b - c_r, 0.0)) * gs[t]
if t < p["term"]:
bal = bal * (1.0 + p["rate"]) - pay
price = price * gh[t]
w_b = price * (1.0 - p["sell_cost"]) - max(bal, 0.0) + port_b
return w_b, port_r
def deterministic(p, years):
return run_path(p, [1.0 + p["g"]] * years, [1.0 + p["equity"]] * years)
VOL = {"hvol": 0.08, "svol": 0.16, "corr": 0.2}
def draw_factors(p, v, rng, years):
mh = math.log(1.0 + p["g"]) - 0.5 * v["hvol"] ** 2
ms = math.log(1.0 + p["equity"]) - 0.5 * v["svol"] ** 2
c = v["corr"]
s = math.sqrt(1.0 - c * c)
gh, gs = [], []
for _ in range(years):
z1 = rng.gauss(0.0, 1.0)
z2 = rng.gauss(0.0, 1.0)
gh.append(math.exp(mh + v["hvol"] * z1))
gs.append(math.exp(ms + v["svol"] * (c * z1 + s * z2)))
return gh, gs
def simulate(p, v, n, years):
rng = random.Random(20261112)
out = []
for _ in range(n):
gh, gs = draw_factors(p, v, rng, years)
out.append(run_path(p, gh, gs))
return out
def pct(xs, q):
xs = sorted(xs)
return xs[min(len(xs) - 1, int(q * len(xs)))]
if __name__ == "__main__":
res = simulate(BASE, VOL, 20000, 20)
wb = [a for a, b in res]
wr = [b for a, b in res]
d = [b - a for a, b in res]
wins = len([x for x in d if x > 0])
print("20000 paths, 20 years, Taipei-like illustrative case")
print(" mean p10 median p90")
for name, xs in (("W_buy", wb), ("W_rent", wr), ("rent-buy", d)):
print("{:<10} {:8.2f} {:8.2f} {:8.2f} {:8.2f}".format(
name, statistics.fmean(xs), pct(xs, 0.1),
statistics.median(xs), pct(xs, 0.9)))
print("P(renter ends ahead) {:.4f}".format(wins / len(d)))
cut = -0.2 * statistics.median(wb)
big = len([x for x in d if x < cut])
print("P(buyer ahead by > 20 % of median W_buy) {:.4f}"
.format(big / len(d)))
print("sd W_buy {:.2f} sd W_rent {:.2f}".format(
statistics.pstdev(wb), statistics.pstdev(wr)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《租售比与持有成本净现值、杠杆购房非遍历性与典权回赎期权母典》第 3 章「「大量情景」有多大:房价与基金联动路径的蒙特卡洛」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-219 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026219,
author = {Fan, Yafu},
title = {Price-to-Rent Ratios and Holding-Cost NPV, Non-Ergodic Leveraged Home Buying and the Redemption Option in Chinese Dian Tenure},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}