Skip to main content

Monte Carlo financial planning simulator

Project description

monteplan

Monte Carlo financial planning simulator

CI Python 3.11+ License Docs

Documentation | Technical Paper | Notebooks | Try in Colab


monteplan models accumulation and decumulation with realistic taxes, multiple spending policies, multi-asset correlated portfolios, and professional reporting. Use it as a Python library, CLI tool, or interactive Streamlit web app.

Features

  • Monte Carlo Engine -- Vectorized numpy simulation with monthly time steps and deterministic seeding
  • 4 Return Models -- Multivariate normal, Student-t (fat tails), historical block bootstrap, Markov regime switching
  • 5 Spending Policies -- Constant real, percent-of-portfolio, Guyton-Klinger guardrails, VPW, floor-and-ceiling
  • Tax-Aware Withdrawals -- US federal progressive brackets, LTCG rates, RMD enforcement, configurable withdrawal ordering
  • Multi-Account Support -- Taxable, traditional (401k/IRA), and Roth accounts with distinct tax treatment
  • Guaranteed Income -- Social Security, pensions, and annuities with COLA adjustments
  • Stress Testing -- Market crashes, lost decades, high inflation, and sequence-of-returns risk scenarios
  • Sensitivity Analysis -- One-at-a-time tornado charts and 2D heatmaps with parallel execution
  • Antithetic Variates -- Variance reduction for tighter confidence intervals
  • Glide Paths -- Age-based target allocation shifts
  • Investment Fees -- Expense ratios, AUM fees, and advisory fees as monthly drag
  • Streamlit App -- Interactive web UI with Plotly charts, scenario comparison, and CSV export

Example Output

Monte Carlo Wealth Projection

Spending Policy Comparison Ruin Probability by Age

Quick Start

Python Library

from monteplan import simulate, default_plan, default_market, default_policies, default_sim_config

result = simulate(default_plan(), default_market(), default_policies(), default_sim_config())
print(f"Success probability: {result.success_probability:.1%}")

CLI

monteplan run --paths 10000 --seed 42

Streamlit App

pip install monteplan[app]
streamlit run app/Home.py

Try It Now

Open in Colab

Installation

pip install monteplan

Or install from source:

git clone https://github.com/engineerinvestor/monteplan.git
cd monteplan
pip install -e ".[dev]"

Architecture

monteplan separates computation from presentation:

  • Engine (src/monteplan/) -- Pure Python package with no UI dependencies
  • App (app/) -- Streamlit web UI that imports the engine as a library
  • Plugin-style models -- Return models, spending policies, and tax models are swappable via protocols

See the documentation for the full user guide, API reference, and mathematical details.

Disclaimer

This is an educational tool for exploring financial planning concepts. It is not financial advice. Results are simulations based on simplified models and assumptions. Consult a qualified financial advisor for real planning decisions.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monteplan-0.5.0.tar.gz (596.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monteplan-0.5.0-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file monteplan-0.5.0.tar.gz.

File metadata

  • Download URL: monteplan-0.5.0.tar.gz
  • Upload date:
  • Size: 596.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for monteplan-0.5.0.tar.gz
Algorithm Hash digest
SHA256 fa6d23d061d3fe10bbfc42060c92f97abdef1da00da84a469ae368b9df997d34
MD5 3b9da6d015c8771fbf4579c86c540a0c
BLAKE2b-256 c75987d7b239097904789a8f63b25db4019ca01254ea079882366f3b49c39ece

See more details on using hashes here.

Provenance

The following attestation bundles were made for monteplan-0.5.0.tar.gz:

Publisher: publish.yml on engineerinvestor/monteplan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monteplan-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: monteplan-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 54.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for monteplan-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc4872d023a2bfcc92487ded2e4fe609c18ae80dda954a53b35496d25826d1bf
MD5 4c709c6b4e95f1b5ef5e5c1597d1bc25
BLAKE2b-256 733f770a516dc3cb55c2bbd30a998b369a5c102d725808d58a48329dd6bfe231

See more details on using hashes here.

Provenance

The following attestation bundles were made for monteplan-0.5.0-py3-none-any.whl:

Publisher: publish.yml on engineerinvestor/monteplan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page