<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Monte Carlo on Home</title><link>/tags/monte-carlo/</link><description>Recent content in Monte Carlo on Home</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 22 Nov 2025 00:00:00 +0000</lastBuildDate><atom:link href="/tags/monte-carlo/" rel="self" type="application/rss+xml"/><item><title>Compound Simulation – Exploring Portfolio Uncertainty</title><link>/2025/compound-simulation-exploring-portfolio-uncertainty/</link><pubDate>Sat, 22 Nov 2025 00:00:00 +0000</pubDate><guid>/2025/compound-simulation-exploring-portfolio-uncertainty/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Financial planning is often built on a deterministic story: &lt;em&gt;“If I invest X € each month at 5 % per year, I’ll have Y € in 20 years.”&lt;/em&gt; But real markets are anything but deterministic. Price fluctuations, volatility, and unexpected shocks can significantly change outcomes.&lt;/p&gt;
&lt;p&gt;This new tool builds on the foundation of the &lt;a href="https://michard.io/2025/compound-simulation-exploring-portfolio-uncertainty/"&gt;Compound Interest Calculator&lt;/a&gt;, which takes a deterministic view of capital growth. This new tool introduces a probabilistic perspective by using Monte Carlo simulation to explore a spectrum of possible portfolio trajectories based on the users assumptions. Instead of a single projected curve, it generates a fan chart that visualizes uncertainty bands, the likelihood of reaching specific targets, and how sensitive outcomes are to your savings rate.&lt;/p&gt;
&lt;p&gt;This is not a crystal ball. It’s a scenario explorer — a way to understand how uncertain markets shape financial trajectories.&lt;/p&gt;
&lt;p&gt;You can try the web tool here:&lt;br&gt;
&lt;a href="https://compound-simulation.michard.io/" target="_blank" rel="noreferrer" class="download"&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentcolor" class="clip" width="13" height="13" style="vertical-align: middle; margin-right: .3rem;"&gt;
&lt;path d="M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V32c0-17.7-14.3-32-32-32H352zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"&gt;&lt;/path&gt;
&lt;/svg&gt;Open the Compound Simulation Tool&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="what-the-tool-does"&gt;What the Tool Does&lt;/h2&gt;
&lt;p&gt;The simulation is based on a small set of input parameters — initial capital, monthly contributions, expected return (μ), volatility (σ), investment horizon, and optionally a target value.&lt;/p&gt;
&lt;p&gt;Using these assumptions, the app runs multiple simulation paths and provides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fan chart of portfolio trajectories – median, expected path, and uncertainty bands (percentiles).&lt;/li&gt;
&lt;li&gt;Distribution of end values – showing the spread of possible outcomes at the horizon.&lt;/li&gt;
&lt;li&gt;Target probability – the likelihood of reaching (or exceeding) your goal.&lt;/li&gt;
&lt;li&gt;Stress test – a downside scenario with halved returns and doubled volatility.&lt;/li&gt;
&lt;li&gt;Savings elasticity – the effect on median outcomes from marginally increasing monthly contributions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This shifts the focus from a single deterministic projection to a probabilistic view of potential futures.&lt;/p&gt;
&lt;h2 id="how-to-use-it-online"&gt;How to Use It Online&lt;/h2&gt;
&lt;p&gt;Running the hosted app is straightforward:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the simulation tool.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter your core parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initial Capital [€]&lt;/li&gt;
&lt;li&gt;Monthly Savings [€]&lt;/li&gt;
&lt;li&gt;Annual Return μ&lt;/li&gt;
&lt;li&gt;Volatility σ&lt;/li&gt;
&lt;li&gt;Time Horizon (years)&lt;/li&gt;
&lt;li&gt;(Optional) Define a target and target date.&lt;/li&gt;
&lt;li&gt;(Optional) Enable the Stress Test to explore adverse scenarios.&lt;/li&gt;
&lt;li&gt;(Optional) Add a Savings Elasticity Increment (e.g. +€50/month) to assess sensitivity.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The output includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A fan chart showing uncertainty over time.&lt;/li&gt;
&lt;li&gt;A distribution histogram of end values.&lt;/li&gt;
&lt;li&gt;A target probability indicator.&lt;/li&gt;
&lt;li&gt;A sensitivity summary for additional contributions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="run-locally"&gt;Run Locally&lt;/h2&gt;
&lt;p&gt;If you want to host or modify the simulation app yourself:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clone the repository&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/smichard/compound_simulation
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="2"&gt;
&lt;li&gt;Navigate to the project directory&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; compound_simulation
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="3"&gt;
&lt;li&gt;Build the container image
Run the following command to build an image named compound_simulation_app (or choose any name you prefer):&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;podman build -t compound_simulation_app -f Containerfile .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command uses the provided Containerfile to set up the environment, including all required R packages for running the Shiny app.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Start the app locally&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;podman run --rm -p 3838:3838 compound_simulation_app
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This launches a container and maps port 3838 inside the container to the same port on your host system.&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;Access the app in your browser&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;http://localhost:3838/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should now see the Compound Simulation app running locally.&lt;/p&gt;
&lt;h2 id="why-this-matters"&gt;Why This Matters&lt;/h2&gt;
&lt;p&gt;Uncertainty is real — any deterministic projection hides the range of plausible outcomes. Markets fluctuate, assumptions shift, and unexpected events can have a lasting impact. Probabilistic thinking helps make better decisions by accounting for both upside and downside scenarios instead of focusing on a single expected path.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Goal probability provides a tangible measure: “What are the chances I’ll reach €X by year Y?”&lt;/li&gt;
&lt;li&gt;Savings elasticity reveals whether increasing contributions might be more effective than simply chasing higher returns.&lt;/li&gt;
&lt;li&gt;For investors, educators, or anyone exploring financial planning under uncertainty, this tool complements the &lt;a href="https://michard.io/2025/compound-simulation-exploring-portfolio-uncertainty/"&gt;Compound Interest Calculator&lt;/a&gt; by adding a probabilistic layer to previously deterministic projections.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;Compound Simulation brings uncertainty to the forefront. By combining Monte Carlo simulation, sensitivity analysis, and clear visualizations, it highlights that financial projections aren’t fixed—they’re distributions. The tool helps explore not only expected growth but also the range of potential outcomes and their probabilities.&lt;/p&gt;
&lt;p&gt;It can be used as a teaching aid, a scenario testing environment, or a personal planning companion. And since it’s open source, you can easily adapt it to your own assumptions, risk parameters, or visualization preferences.&lt;/p&gt;
&lt;h2 id="references"&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Related Post - Compound Interest Calculator - &lt;a href="https://michard.io/2025/compound-simulation-exploring-portfolio-uncertainty/"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Web App - &lt;a href="https://compound-simulation.michard.io/"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GitHub Repository - &lt;a href="https://github.com/smichard/compound_simulation"&gt;link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>