ProjectionLab's Monte Carlo Simulations Show 'Spectrum of Possible Outcomes'—Can You Replicate This With Beancount + Python Scripts?

I’ve been exploring ProjectionLab recently (the FIRE planning tool everyone raves about), and honestly, the Monte Carlo simulation feature is impressive. Instead of giving you a single “you’ll retire at age 45” number, it runs thousands of simulations with varying market returns, inflation rates, and spending patterns—then shows you a probability distribution. Like “80% chance of retiring by 45, 95% chance by 48.”

This got me thinking: can we replicate this with Beancount + Python?

What ProjectionLab Does

From what I can tell, ProjectionLab’s Monte Carlo engine:

  1. Takes your current net worth and spending rate
  2. Projects forward 10-40 years
  3. Randomizes investment returns each year (based on historical volatility)
  4. Randomizes inflation (within realistic bounds)
  5. Runs 10,000+ simulations
  6. Shows you the spectrum of possible outcomes

The result is a chart showing probability ranges—not false precision, but honest uncertainty. Which is way more useful for FIRE planning than “assume 7% returns forever.”

The Beancount Advantage

Here’s what got me excited: Beancount gives us actual historical data instead of guesses:

  • Real spending: Pull 3-5 years of expenses from my ledger, not “I think I spend $40K/year”
  • Real returns: Calculate my actual portfolio performance (not assumed 7%)
  • Real savings rate: Income - Expenses over time, accounting for raises, lifestyle inflation, etc.
  • Real volatility: Measure how much my monthly spending varies (helps model risk)

This eliminates the “garbage in, garbage out” problem that plagues most FIRE calculators.

Technical Implementation Questions

For those who’ve done this (or want to try):

1. What’s the minimum data requirement?

  • Is 2 years of Beancount history enough, or do you need 5-10 years?
  • Can you mix Beancount data (2 years) with historical spreadsheets (previous 5 years)?

2. Which Python libraries?

  • NumPy for random distributions? (numpy.random.normal for returns, inflation)
  • Pandas for time series manipulation?
  • Matplotlib/Plotly for visualization?

3. How do you model returns?

  • Historical average ± standard deviation?
  • Fat-tailed distributions (account for market crashes)?
  • Different return assumptions for stocks vs bonds vs cash?

4. What’s the output format?

  • Probability of success at different ages (80% at 45, 95% at 48)?
  • Distribution chart showing 10th/50th/90th percentile outcomes?
  • Safe withdrawal rate analysis?

The Value Proposition

Why build this when ProjectionLab exists?

For me:

  • Privacy: My complete financial history stays on my laptop, not in someone’s cloud
  • Customization: Can model weird edge cases (inheritance in 15 years, rental property income phase-out, etc.)
  • Learning: Understanding the math makes me more confident in the results
  • Integration: Generate report directly from my Beancount ledger—one source of truth

Effort vs reward: If this is a weekend project for someone Python-literate, it’s worth it. If it takes a month, maybe just use ProjectionLab and pay the $120/year.

Has Anyone Done This?

I found a few GitHub repos for retirement Monte Carlo in Python, but they all require manual input of current balance, spending, etc. Has anyone built a tool that reads Beancount ledger directly?

Something like:

$ python monte_carlo_fire.py --ledger my_finances.beancount --simulations 10000
Running 10,000 Monte Carlo simulations...
Current net worth: $287,450 (from Beancount)
Annual spending (3yr avg): $52,340 (from Beancount)
Savings rate (3yr avg): 42% (from Beancount)

Results:
- 50% probability of FI by age 43 ($1,100,000 target)
- 80% probability of FI by age 46 ($1,250,000 target)
- 95% probability of FI by age 49 ($1,400,000 target)

Generating charts in ./output/

The Moonshot Version

If we’re dreaming big: Fava plugin that adds a “Monte Carlo” tab showing:

  • Interactive simulation controls (sliders for return assumptions, spending scenarios, etc.)
  • Real-time probability charts
  • “What-if” scenario comparison (what if I save $500 more per month?)
  • Downloadable reports for sharing with spouse/financial advisor

Too ambitious? Or is this the kind of thing the Beancount community could build collaboratively?


I’m planning to start hacking on this next weekend—even if it’s just a rough Python script pulling data from my ledger. Happy to share progress (and inevitable failures) if anyone’s interested.

Questions:

  1. Has anyone already built this?
  2. Am I overcomplicating something ProjectionLab does better?
  3. Would a Monte Carlo Fava plugin be useful, or is this too niche?

Looking forward to hearing your thoughts!

This is exactly what I’ve been working on! I actually built a basic version of this about 6 months ago, and I’m happy to share what I learned.

My Implementation

I created a Python script that reads my Beancount ledger and runs Monte Carlo simulations. The code is ~300 lines and uses:

  • beancount.loader to parse the ledger
  • NumPy for random distributions (numpy.random.lognormal for returns—more realistic than normal distribution)
  • Pandas for time series analysis
  • Plotly for interactive charts

The basic workflow:

  1. Extract historical spending from Expenses accounts (last 36 months)
  2. Calculate actual portfolio returns from Assets:Investments price changes
  3. Measure volatility (standard deviation of monthly returns)
  4. Run 10,000 simulations with randomized returns each year
  5. Plot probability distribution of retirement dates

Key Insights From Building This

1. Data Requirements

I found 3 years minimum for meaningful results. With only 1-2 years, spending volatility is too high (one vacation or car repair throws everything off). With 5+ years, you get more stable averages but risk including outdated lifestyle data.

I handle irregular expenses by:

  • Calculating rolling 12-month average (smooths out annual vacation, quarterly insurance, etc.)
  • Flagging outliers (spent $8K on home repair in March 2024—exclude from baseline)
  • Adjusting for known future changes (kid starting college in 2027—increase projected spending)

2. Return Modeling Matters A LOT

Using normal distribution (numpy.random.normal) gives unrealistic results—real markets have fat tails (crashes are more frequent than normal curve predicts).

I switched to log-normal distribution which better models actual market behavior:

annual_return = np.random.lognormal(
    mean=np.log(1 + historical_avg) - 0.5 * volatility**2,
    sigma=volatility
) - 1

This produces more conservative (realistic) estimates—my 80% confidence retirement date pushed back 2 years when I fixed this!

3. The Beancount Advantage Is Real

You’re absolutely right about “garbage in, garbage out.” When I compared my Beancount-derived spending ($58,200 actual) vs my estimate ($45,000 guess), I was off by 30%. That’s the difference between retiring at 42 vs 47!

Same with returns—I assumed 8% historical, but my actual diversified portfolio averaged 6.2% over 3 years. Humbling but necessary reality check.

What I Wish I’d Known Earlier

1. Sequence of returns risk is huge

Early market crash matters WAY more than late market crash. I added a feature to model “unlucky early retiree” scenario (market drops 30% in year 1 of retirement). This increased my target FI number by $150K.

2. Inflation modeling is tricky

I initially used fixed 3% inflation, but better approach is:

  • Historical inflation volatility (2-4% range)
  • Different inflation for housing vs food vs healthcare
  • Ability to model lifestyle deflation in retirement (spending drops 20% when you stop commuting, buying work clothes, etc.)

3. Withdrawal strategy matters as much as accumulation

Monte Carlo for accumulation phase is straightforward. But modeling withdrawal phase requires decisions:

  • Fixed 4% vs variable withdrawal (spend less in down years)?
  • Tax optimization (which accounts to draw from first)?
  • Social Security timing (claim at 62, 67, or 70)?

I haven’t implemented withdrawal phase fully yet—too many variables!

Would I Use ProjectionLab Instead?

Honestly, both. I use ProjectionLab for quick what-if scenarios (beautiful UX, fast iteration). But I trust my Beancount-based simulation more for final decisions because:

  • I understand exactly what it’s modeling (no black box)
  • It uses MY actual data (not industry averages)
  • I can model weird edge cases (inheritance, rental property sale, etc.)

The DIY version took me about 2 weekends to build (maybe 16 hours total?), and I’m a pretty experienced Python developer. If you’re just learning pandas/numpy, budget 4-6 weekends.

Code Sharing

I’d love to open-source this, but it’s currently a messy script with hardcoded paths and my personal assumptions baked in. If there’s interest, I could clean it up and put it on GitHub with:

  • Configurable parameters (return assumptions, inflation, spending adjustments)
  • Multiple output formats (text report, HTML dashboard, CSV data)
  • Documentation for non-experts

Would people actually use this? Or is ProjectionLab “good enough” for 95% of FIRE folks?

One more thing: The Fava plugin idea is brilliant, but I suspect it’s a 100+ hour project to do right (web UI, interactivity, chart generation, error handling). Might be better as a standalone tool that generates a report you can view in browser?

Let me know if you want to see my code or collaborate on this!

Okay, this is intimidating but also really exciting. I’m a software developer who just started using Beancount 4 months ago, and I’ve been using ProjectionLab for FIRE tracking. Never occurred to me I could build my own!

My Newbie Questions

1. How do you extract historical returns from Beancount?

I understand getting spending data (sum of Expenses accounts by month), but portfolio returns seem tricker. Do you:

  • Track price changes for each investment with bean-price?
  • Calculate returns on entire portfolio (including contributions/withdrawals)?
  • Separate realized gains from unrealized gains?

I have my investments in Beancount, but I’m not confident I could write the query to calculate “portfolio returned 6.2% last year” accurately.

2. What about assets that aren’t in Beancount yet?

I only started tracking in October 2025, so I have 5 months of data. But I have 3 years of historical data in spreadsheets (net worth snapshots from Personal Capital exports). Can you:

  • Backfill Beancount with old transactions? (seems tedious)
  • Mix Beancount data with CSV files? (defeats the “single source of truth” benefit)
  • Just wait until I have 3+ years of Beancount history? (that’s 2028!)

3. Is Monte Carlo overkill for someone like me?

My situation is pretty simple:

  • Single income, no dependents
  • Index fund investing (VTI/VXUS, nothing fancy)
  • Stable spending ($3,500/month avg)
  • No major life changes planned

Do I actually need probabilistic modeling, or is a simple compound interest calculator sufficient? Like, what’s the value-add of “80% chance retire at 45” vs “retire at 45 assuming 7% returns”?

What Excites Me About This

Coming from a DevOps background, I love the idea of:

  • Version control for projections: Git history shows how my FI date estimate changed over time as I added real data
  • Reproducible analysis: Anyone can run my script and verify the math (vs trusting ProjectionLab’s black box)
  • Infrastructure-as-code mindset: Define my entire financial model in code, not clicking around a GUI

But I’m worried about:

  • Time investment: If this takes 4-6 weekends (finance_fred’s estimate), that’s a lot of learning NumPy/Pandas when I could just use ProjectionLab
  • Maintenance burden: What happens when tax laws change, or I need to model Roth conversions, or Social Security strategy?
  • Reinventing the wheel: Are we building something that already exists in some open-source project I haven’t found yet?

A Simpler Starting Point?

What if we start with a super minimal MVP:

  1. Read Beancount ledger
  2. Calculate net worth (total assets - total liabilities)
  3. Calculate annual spending (sum of Expenses for last 12 months)
  4. Run simple Monte Carlo (just randomize returns, ignore inflation/taxes/etc.)
  5. Output one number: “X% probability of FI by age Y”

No fancy charts, no withdrawal modeling, no tax optimization. Just proof-of-concept that you can go from my_finances.beancount to “78% chance of FI by age 44” in ~100 lines of Python.

Then iterate from there based on what people actually need.

Question for finance_fred

Would you be willing to share your code, even if it’s messy? I learn way better from working code than theoretical explanations. I’d be happy to help clean it up and document it for the community.

Also: how did you handle the learning curve for NumPy/Pandas? Any resources you’d recommend for someone who knows Python basics but hasn’t done data analysis?

Bottom Line

I’m torn between:

  • Just use ProjectionLab (it works, it’s pretty, saves me 20+ hours)
  • Build this myself (learn a ton, full control, matches my plain text philosophy)

The deciding factor for me is: will I actually learn useful skills, or is this just yak-shaving disguised as self-improvement?

What do you all think?

As a CPA who advises clients on retirement planning, I want to offer both encouragement and caution about DIY Monte Carlo analysis.

The Professional Perspective

What you’re building is legitimate financial modeling. Monte Carlo simulation is used by financial advisors, pension funds, and insurance companies for risk analysis. The math is sound, and having direct access to your own data (via Beancount) is a genuine advantage over generic calculators.

However, there are some technical considerations that matter a lot for accurate projections:

Tax Optimization Is The Elephant in the Room

The biggest limitation I see in most DIY FIRE calculators—including ProjectionLab—is oversimplified tax modeling. Your actual retirement date depends heavily on:

1. Account location strategy:

  • What’s in taxable vs Roth vs traditional 401(k)?
  • What’s your withdrawal order to minimize lifetime taxes?
  • Can you do Roth conversions in low-income years?

2. Tax bracket management:

  • Keeping income below certain thresholds unlocks benefits (ACA subsidies, 0% capital gains rate, etc.)
  • Strategic Roth conversions in early retirement (before Social Security/RMDs start)
  • Harvesting capital gains at 0% rate

3. Sequence of returns + taxes:

  • If market crashes in year 1 of retirement AND you’re in high tax bracket (bad RMD timing), your plan can fail
  • But if you have flexibility (draw from Roth in down years, minimize taxable income), you survive

My point: A Monte Carlo simulation that ignores taxes is like a weather forecast that ignores wind. You’ll get directional accuracy but potentially wrong conclusion.

Data Quality Concerns

finance_fred mentioned being off by 30% on spending estimate—this is VERY common. I see it with clients all the time:

Spending categories that people underestimate:

  • Healthcare (especially pre-Medicare years 55-65)
  • Home maintenance (averages 1-3% of home value annually, but irregular)
  • “Fun money” (travel, hobbies, gifts—the stuff that makes retirement enjoyable)
  • Insurance (health, home, auto, umbrella—gets expensive in retirement)

The Beancount advantage is you have real data, but watch for:

  • Lifestyle changes (are you modeling 2023 pandemic spending or 2019 travel spending?)
  • One-time expenses that won’t recur (paid off mortgage, kids finished college)
  • New expenses in retirement (more travel, expensive hobbies, healthcare)

I always advise clients to model retirement spending as 1.2x current spending (not 0.7x like most calculators assume). People underestimate how much they’ll spend when they have free time.

Where DIY Makes Sense

You SHOULD build this if:

  • You want to understand the math (educational value)
  • You have complex situation (rental properties, stock options, inheritance expected, etc.)
  • You value privacy and data ownership
  • You’re Python-literate and enjoy this kind of project

Just use ProjectionLab if:

  • Your situation is straightforward (W2 income, index funds, no major complications)
  • You want to spend weekends hiking, not coding
  • You trust commercial software (it’s probably fine for 90% of people)
  • You value their UX and ongoing feature development

My Recommendations

1. Start with commercial tools, then validate with DIY

Use ProjectionLab to get a baseline. Then build your Beancount-based Monte Carlo and compare results. If they’re within 10-20%, great—you understand your plan. If they’re off by 50%, dig into why (probably taxes, spending assumptions, or return modeling).

2. Focus on the variables that matter

Don’t spend 20 hours modeling inflation to the second decimal. The big levers are:

  • Savings rate (can you save $5K more per year?)
  • Asset allocation (60/40 vs 80/20 drastically changes risk profile)
  • Retirement spending (every $10K reduction moves FI date up ~2 years)
  • Tax optimization (can save you $50K+ over lifetime)

Get those right before worrying about perfect Monte Carlo implementation.

3. Validate with a professional (at least once)

I’m biased as a CPA, but: run your model by a fee-only financial planner before making life-changing decisions. They’ll catch blind spots (estate planning, insurance gaps, tax mistakes) that no calculator addresses.

Not saying don’t trust your own analysis—but get a second opinion on major decisions.

The CPA Use Case

Slightly off-topic, but: I’m interested in this for my CLIENT work. If we could build a Beancount-to-Monte-Carlo tool that:

  • Reads client’s Beancount ledger (or QuickBooks export converted to Beancount)
  • Generates retirement projections with proper tax modeling
  • Produces PDF reports for client meetings
  • Shows probability ranges (not false precision)

…that would be VERY useful for my practice. I’d pay for well-built version of this (or sponsor open-source development).

Current tools like eMoney, MoneyGuidePro cost $2K-5K annually and require manual data entry. If Beancount could automate this, that’s a real business value proposition.

Technical Resources

For those building this, I recommend:

Monte Carlo basics:

Tax optimization:

  • “The Definitive Guide to Retirement Income” by Wade Pfau
  • Kitces.com articles on Roth conversion strategies

Python libraries:

  • numpy.random.lognormal for returns (finance_fred is right about this)
  • scipy.stats for statistical analysis
  • matplotlib or plotly for visualization

Good luck to everyone building this! And please share your code when you have something working—I’d love to test it with client scenarios.