Skip to main content

Monte Carlo financial planning simulator

Project description

monteplan

Monte Carlo financial planning simulator

PyPI Open in Streamlit CI Python 3.11+ License Docs

Live App | PyPI | 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

Try the live app or run locally:

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

Try It Now

Open in Colab

Installation

Install from PyPI:

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.6.0.tar.gz (604.1 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.6.0-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for monteplan-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b9d5743aeeef00b71124e30be514b64d1ded45391de905a78a59c4328627beb4
MD5 43184ba292d3e234c20237ab91dcc9c4
BLAKE2b-256 99c6ba5e43bd14d4a68a3a69fc281b33315633f8d0ca373242223e88a088901c

See more details on using hashes here.

Provenance

The following attestation bundles were made for monteplan-0.6.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.6.0-py3-none-any.whl.

File metadata

  • Download URL: monteplan-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 55.9 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de434d4e6ccabccd52620816e0ae6f5d581aff46060efbd6039c44ca1cf3397c
MD5 eacb94c7266f6855ff0ef06c9ea7d0f8
BLAKE2b-256 27d4311c11673cf08e9afd0501942d0407e1510b6741b723f8da735a584a635d

See more details on using hashes here.

Provenance

The following attestation bundles were made for monteplan-0.6.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