Pension Calculator
计算退休时的养老金储蓄,并使用4%法则估计月收入。
关于此工具
养老金计算器是任何计划通过个人储蓄、雇主退休计划或两者结合来退休的人必不可少的工具。它回答了一个基本问题:我在目标年龄退休时会有足够的钱吗?通过预测您的储蓄增长并使用4%规则将余额转换为可持续的月收入,此计算器消除了长期财务规划的不确定性。
输入您的当前年龄、期望退休年龄、现有储蓄和每月能贡献的金额。指定您的预期年回报率和通货膨胀率——历史股市平均7%和约2.5%的通胀是很好的起点。计算器随后显示您退休时的总储蓄,既以名义美元形式也以通胀调整(实际)值的形式,加上您的估计月收入——两种格式都有——这样您就能看到您的实际购买力会是多少。
大多数退休人员发现,开始越早、储蓄越稳定,退休前景就会越好。此计算器可帮助您测试不同情景:如果我在62岁而非67岁退休怎么办?如果我每月增加100美元的贡献怎么办?结果通常显示,几十年前做出的微小改变会复合成实质性差异,使退休计划感觉不那么令人困惑,而是更可操作的。
常见问题
代码实现
def pension_projection(
current_age: int,
retirement_age: int,
current_savings: float,
monthly_contribution: float,
annual_return_pct: float,
inflation_pct: float,
) -> dict:
"""Project pension savings and retirement income."""
years = retirement_age - current_age
monthly_rate = annual_return_pct / 100 / 12
months = years * 12
# Future value of current savings (compound growth)
fv_savings = current_savings * (1 + annual_return_pct / 100) ** years
# Future value of monthly contributions (annuity formula)
if monthly_rate > 0:
fv_contributions = monthly_contribution * (
((1 + monthly_rate) ** months - 1) / monthly_rate
)
else:
fv_contributions = monthly_contribution * months
total_savings = fv_savings + fv_contributions
# Monthly retirement income using the 4% rule
annual_income = total_savings * 0.04
monthly_income = annual_income / 12
# Inflation adjustment (today's dollars)
inflation_factor = (1 + inflation_pct / 100) ** years
real_total = total_savings / inflation_factor
real_monthly_income = monthly_income / inflation_factor
return {
"total_savings": round(total_savings, 2),
"monthly_income_nominal": round(monthly_income, 2),
"total_savings_real": round(real_total, 2),
"monthly_income_real": round(real_monthly_income, 2),
"years_to_retirement": years,
}
result = pension_projection(
current_age=35,
retirement_age=65,
current_savings=50_000,
monthly_contribution=500,
annual_return_pct=7.0,
inflation_pct=3.0,
)
for key, value in result.items():
print(f"{key}: {value:,.2f}" if isinstance(value, float) else f"{key}: {value}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.