一个开源项目在Hacker News社区发布了针对美国241个城市的房租与购房决策回测分析[1]。该项目强调数据透明性和可复现性,提供了完整的代码和数据集供用户验证[1]。
项目基于Robert Shiller的月度美国股市数据集构建,数据时间跨度从1871年1月至2026年6月[1]。回测结果显示,在1,855个起始月份中,一次性投资战胜定期定额投资的比例达到67.2%[1]。灵敏度分析进一步表明,若闲置现金零名义收益,一次性投资的胜率可达72.0%[1]。
项目包含多个投资决策模拟的完整代码和假设参数,所有内容均开源可验证[1]。使用该项目需要Node.js 22或更新版本以及.NET SDK 9或更新版本[1]。
A developer has released an open-source project that backtests rent-versus-buy financial decisions across 241 metropolitan areas in the United States [1]. The analysis spans historical data from January 1871 through June 2026 and provides fully transparent, reproducible code and datasets for evaluating housing investment strategies [1].
The project's core finding demonstrates that lump-sum investing outperformed dollar-cost averaging in 67.2% of cases across 1,855 possible starting months within the dataset [1]. When idle cash is assumed to generate zero nominal returns, lump-sum investing's win rate rises to 72.0%, according to sensitivity analysis included in the research [1]. All underlying code and data are open-source and verifiable, enabling independent researchers to reproduce the results and test alternative assumptions [1].
The technical implementation requires Node.js version 22 or later and .NET SDK version 9 or later [1]. The foundational market data derives from Robert Shiller's monthly US stock market dataset, available through shillerdata.com [1].