Use when 需要计算/解释投资组合的年化收益率、月度现金流与长期(如30年)资产路径,且包含固定支出与不确定收入(自由职业波动、随机收入、回款集中)并需要给出耗尽概率与分位数(P10/P50/P90)
64
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/portfolio-cashflow-modeling/SKILL.md核心原则:先定口径与假设,再算;能解析就别假装模拟;声称“跑了蒙特卡洛/查了统计均值”必须有可复现证据。
Uniform(0,5000)、自由职业“项目期/空窗期”、回款集中、断档。自然到账现金流:利息/分红/到期兑付(不卖出资产)。提取现金流:为满足支出而赎回/卖出资产(净值会下降)。rm = (1+R)^(1/12)-1。组合年化(期望)永远先写成:
R = Σ(w_i * r_i),并列清 w_i 与 r_i 的来源(历史窗口/期望值/产品年化)。
用月度递推表达清楚模型(默认月末发生支出/收入):
A_{t+1} = A_t * (1 + rm) + income_t - spend_t
耗尽判定:若 A_t <= 0,记为“触底/耗尽”。
推荐先给“可解释、可校准”的模型,而不是凭感觉:
当且仅当需要分位数/耗尽概率、且解析推不出时使用。
最低复现要求:
N(建议≥10,000)seed目标:让 30 年末余额接近某个值(例如 50万)。
f(E) = median(A_T(E)) - target(或用 P10 更保守)E。以下示例用于“固定收益 + 收入随机”场景;真实使用时替换参数:
import numpy as np
def simulate(A0, R, spend, years, N=20000, seed=42,
income_low=0, income_high=5000):
rng = np.random.default_rng(seed)
rm = (1 + R) ** (1/12) - 1
T = years * 12
A = np.full(N, A0, dtype=float)
depleted = np.zeros(N, dtype=bool)
for _ in range(T):
income = rng.uniform(income_low, income_high, size=N)
A = A * (1 + rm) + income - spend
depleted |= (A <= 0)
A = np.maximum(A, 0)
q10, q50, q90 = np.quantile(A, [0.1, 0.5, 0.9])
p_deplete = depleted.mean()
return p_deplete, (q10, q50, q90)ae15870
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.