QuantCalc Methodology
Technical Documentation v1.0 · Last updated: February 2025
- Introduction
- Monte Carlo Overview
- Asset Return Modeling
- Generating Correlated Returns
- Capital Market Expectations
- Portfolio Return Calculation
- Cash Flow Modeling
- Simulation Execution
- Success Rate and Statistics
- Quasi-Monte Carlo Methods
- Optimization Problem Formulation
- Objective Functions
- Constraints
- Sequential Quadratic Programming
- Multi-Period Optimization
- Initial Point Selection
- Convergence and Termination
- Practical Considerations
1. Introduction
QuantCalc uses Monte Carlo simulation to model the uncertainty inherent in retirement planning. Unlike deterministic calculators that assume fixed returns, Monte Carlo methods generate thousands of possible future scenarios based on the statistical properties of financial markets.
The fundamental question we answer is: Given your savings, contributions, spending needs, and asset allocation, what is the probability that your portfolio will sustain your retirement?
2. Monte Carlo Simulation Overview
Monte Carlo simulation is a computational technique that uses repeated random sampling to obtain numerical results. For retirement planning, we simulate many possible "paths" that a portfolio might take over time.
The Basic Algorithm
For each simulation s = 1, 2, ..., N:
Initialize portfolio value V₀
For each time period t = 1, 2, ..., T:
Generate random asset returns
Update portfolio value based on returns and cash flows
Record portfolio value Vₜ
Record final outcome (success or failure)
Calculate statistics across all N simulations
With N = 1,000 to 10,000 simulations, we obtain a distribution of outcomes that reflects the range of possibilities given market uncertainty.
3. Asset Return Modeling
Log-Normal Returns
Financial returns are commonly modeled as log-normally distributed. If $P_t$ is the price of an asset at time $t$, the continuously compounded return over one period is:
We assume these log-returns follow a normal distribution:
where $\mu$ is the expected (mean) return per period and $\sigma$ is the volatility (standard deviation) per period.
Converting Annual to Monthly Parameters
Capital Market Expectations are typically quoted as annual figures. For monthly simulation:
The division by $\sqrt{12}$ for volatility follows from the property that variance scales linearly with time for independent returns.
Growth Factor
Given a monthly return $r_t$, the portfolio growth factor is:
4. Generating Correlated Returns
The Challenge
Real asset classes don't move independently. Stocks tend to move together, bonds often move inversely to stocks during crises, etc. We must generate returns that respect these correlations.
Correlation Matrix
For $n$ asset classes, the correlation matrix $\mathbf{R}$ is an $n \times n$ symmetric matrix where $R_{ij}$ is the correlation between assets $i$ and $j$:
Covariance Matrix
The covariance matrix $\mathbf{\Sigma}$ combines volatilities and correlations:
Or in matrix form: $\mathbf{\Sigma} = \mathbf{D} \cdot \mathbf{R} \cdot \mathbf{D}$, where $\mathbf{D} = \text{diag}(\sigma_1, \sigma_2, \ldots, \sigma_n)$.
Cholesky Decomposition
To generate correlated random variables, we use the Cholesky decomposition. Any positive-definite covariance matrix can be factored as:
where $\mathbf{L}$ is a lower triangular matrix.
- Generate $n$ independent standard normal variables: $\mathbf{z} = (z_1, z_2, \ldots, z_n)^T$ where $z_i \sim \mathcal{N}(0, 1)$
- Transform using Cholesky factor: $\mathbf{x} = \mathbf{L} \cdot \mathbf{z}$
- The resulting vector $\mathbf{x}$ has covariance matrix $\mathbf{\Sigma}$
- Add means to get final returns: $r_i = \mu_i + x_i$
5. Capital Market Expectations
Capital Market Expectations (CME) are forward-looking estimates of expected returns, volatilities, and correlations for each asset class. Major financial institutions publish CMEs annually, including BlackRock, JPMorgan, Vanguard, and GMO.
QuantCalc's Asset Classes
| Asset Class | Description |
|---|---|
| US Stocks | Large-cap US equities (S&P 500-like) |
| International Stocks | Developed market ex-US equities |
| Bonds | Investment-grade fixed income |
| Real Estate | REITs / Real estate securities |
| Cash | Money market / Short-term treasuries |
Example CME Data (Illustrative)
| Asset | Expected Return | Volatility |
|---|---|---|
| US Stocks | 6.5% | 16.5% |
| Intl Stocks | 7.2% | 17.5% |
| Bonds | 4.6% | 5.5% |
| Real Estate | 6.8% | 14.0% |
| Cash | 3.1% | 1.0% |
CME Sources
QuantCalc aggregates Capital Market Expectations from four leading institutional sources, each with distinct methodological approaches:
BlackRock Investment Institute
Publication: Capital Market Assumptions (Annual)
BlackRock's CMAs use a building-block approach combining current yields, expected growth, and valuation adjustments. Their methodology emphasizes regime-based analysis and incorporates macro factors including demographic trends, productivity growth, and monetary policy normalization.
J.P. Morgan Asset Management
Publication: Long-Term Capital Market Assumptions (Annual)
JPMorgan's LTCMAs provide 10-15 year forecasts using equilibrium models adjusted for current valuations. Their framework integrates global macro research with quantitative factor models, producing return estimates that account for mean reversion in valuations and yields.
Vanguard Investment Strategy Group
Publication: Vanguard Economic and Market Outlook (Annual)
Vanguard employs the Vanguard Capital Markets Model (VCMM), a proprietary Monte Carlo simulation tool. VCMM generates 10,000 simulations based on historical relationships, current market conditions, and forward-looking yield curves to produce return distributions rather than point estimates.
GMO (Grantham, Mayo, Van Otterloo)
Publication: 7-Year Asset Class Forecasts (Quarterly)
GMO's forecasts are explicitly mean-reverting, assuming asset prices return to historical fair value over a 7-year horizon. Their methodology adjusts current prices for profit margins, valuations (P/E, Shiller CAPE), and dividend yields relative to long-term averages, producing forecasts that often diverge significantly from consensus.
6. Portfolio Return Calculation
Weighted Portfolio Return
Given asset allocation weights $w_1, w_2, \ldots, w_n$ (summing to 1) and individual asset returns $r_1, r_2, \ldots, r_n$, the portfolio return is:
Portfolio Statistics
The expected portfolio return: $\mathbb{E}[r_p] = \sum_{i=1}^{n} w_i \cdot \mu_i$
The portfolio variance:
7. Cash Flow Modeling
Time Periods
QuantCalc simulates on a monthly basis from current age to end of plan. Total months:
Cash Flow Components
At each month $t$, the net cash flow $C_t$ consists of:
Pre-Retirement Phase
Before retirement (month $t < t_{\text{retire}}$): $C_t = M_{\text{contribution}} \times I_t$
Post-Retirement Phase
After retirement (month $t \geq t_{\text{retire}}$):
Social Security and Pension
Social Security begins at the specified claiming age:
Inflation Adjustment
Cash flows are adjusted for inflation to maintain purchasing power:
8. Simulation Execution
Portfolio Evolution
The portfolio value evolves according to:
where $V_t$ is portfolio value, $G_t = 1 + r_{p,t}$ is the growth factor, and $C_t$ is net cash flow.
Handling Ruin
If the portfolio value goes negative, it is floored at zero:
Once $V_t = 0$ during retirement, the simulation is marked as a "failure" (ruin).
9. Success Rate and Statistics
Success Rate
A simulation is "successful" if the portfolio never hits zero during retirement:
Percentiles
- 10th percentile: "Pessimistic" outcome (90% did better)
- 50th percentile (median): "Typical" outcome
- 90th percentile: "Optimistic" outcome
Confidence Interval
The standard error of the success rate estimate is:
For $p = 0.95$ and $N = 1000$: $SE \approx 0.007$, so the 95% CI is approximately $\pm 1.4\%$.
10. Quasi-Monte Carlo Methods
Sobol Sequences
Standard Monte Carlo uses pseudo-random numbers which can exhibit clustering. Quasi-Monte Carlo (QMC) methods use deterministic low-discrepancy sequences designed to fill the sample space more uniformly.
QuantCalc uses Sobol sequences, which provide:
- Deterministic, reproducible results
- Better space coverage than pseudo-random
- Faster convergence: $O(1/N)$ vs $O(1/\sqrt{N})$
Transformation to Normal
Sobol points $u \in [0,1]$ are transformed to standard normal via the inverse CDF:
11. Optimization Problem Formulation
QuantCalc's portfolio optimizer finds the asset allocation that maximizes retirement success probability (or other objectives) subject to real-world constraints. Unlike simple mean-variance optimization, our approach directly optimizes the Monte Carlo simulation output—accounting for sequence-of-returns risk, cash flows, and the full distribution of outcomes.
General Form
Decision Variables
Single-period: $\mathbf{w} = (w_{\text{US}}, w_{\text{Intl}}, w_{\text{Bonds}}, w_{\text{RE}}, w_{\text{Cash}})^T$ — 5 variables
Multi-period (glide path): For $k$ periods, we optimize $k \times n$ weights:
| Periods | Variables | Description |
|---|---|---|
| 1 | 5 | Static allocation |
| 2 | 10 | Two-phase (accumulation/retirement) |
| 3 | 15 | Three-phase glide path |
12. Objective Functions
Maximize Success Rate
Maximize Median Final Value
13. Constraints
Equality: For each period $p$: $\sum_{i=1}^{n} w_{p,i} = 1$
Bounds: $0 \leq w_{p,i} \leq 1$ for all weights (no short selling)
14. Sequential Quadratic Programming (SLSQP)
We use SLSQP because it handles exactly the constraint structure we need: equality constraints (weights sum to 1), bound constraints (0–100% per asset), and a smooth but simulation-derived objective.
The Quadratic Subproblem
At each iteration $k$:
Gradient Estimation
We estimate gradients numerically using finite differences:
A fixed random seed is used for all objective evaluations to eliminate stochastic noise.
BFGS Hessian Update
15. Multi-Period Optimization
For $k$ periods, we flatten the weight matrix into a single decision vector:
| Periods | Variables | Equality Constraints | Gradient Evaluations |
|---|---|---|---|
| 1 | 5 | 1 | 6 |
| 2 | 10 | 2 | 11 |
| 3 | 15 | 3 | 16 |
16. Initial Point Selection
Strategy 1: User's current allocation extended to all periods
Strategy 2: Balanced portfolio: $w_{p,i}^{(0)} = 1/n$ (20% each)
Strategy 3: Age-based heuristic: $w_{\text{stocks}}^{(0)} = 1 - \text{age}/100$
17. Convergence and Termination
The optimization terminates when any condition is met:
- Gradient tolerance: $\|\nabla f\| < 10^{-4}$
- Step tolerance: $\|\mathbf{w}^{(k+1)} - \mathbf{w}^{(k)}\| < 10^{-6}$
- Function tolerance: $|f^{(k+1)} - f^{(k)}| < 10^{-6}$
- Maximum iterations: $k > 100$
18. Practical Considerations
Simulation Noise
A fixed random seed is used for all objective evaluations within the optimization loop. The final optimized allocation is then validated with a fresh simulation run.
Computational Cost
Flat Regions
When success rate is very high (>95%) or very low (<5%), the objective surface becomes flat. Switching to median value objective can help.
19. Tax-Aware Withdrawal Optimization
QuantCalc's Tax-Aware Mode optimizes retirement withdrawals across multiple account types to minimize lifetime tax costs. Unlike naive withdrawal strategies that draw from accounts proportionally or in a fixed sequence, the tax-aware optimizer evaluates hundreds of withdrawal combinations each year to find the mix that minimizes total tax burden while meeting spending needs.
The Tax Problem in Retirement
Retirees typically hold assets across three account types, each with different tax treatment:
| Account Type | Contributions | Growth | Withdrawals |
|---|---|---|---|
| Traditional IRA/401k | Pre-tax (deductible) | Tax-deferred | Fully taxable as ordinary income |
| Roth IRA/401k | After-tax (non-deductible) | Tax-free | Tax-free (qualified distributions) |
| Taxable Brokerage | After-tax | Taxed annually (dividends, interest) | Long-term capital gains rate on appreciation |
Choosing which accounts to withdraw from—and in what amounts—directly impacts:
- Federal income tax (10% to 37% marginal rates)
- Capital gains tax (0%, 15%, or 20% depending on income)
- IRMAA surcharges (Medicare Part B/D premium increases based on MAGI)
- ACA subsidy eligibility (for early retirees under age 65)
- Early withdrawal penalties (10% penalty if withdrawing before age 59½ from traditional accounts)
A naive strategy—such as "withdraw from taxable first, then traditional, then Roth"—can cost tens of thousands of dollars in unnecessary taxes over a 30-year retirement.
Account Structure
The optimizer tracks three account balances:
For the taxable account, we also track the cost basis ratio:
This determines what fraction of a taxable withdrawal is principal (not taxed) versus capital gains (taxed at preferential rates).
Withdrawal Decision Variables
In each year, the optimizer chooses amounts to withdraw from each account:
where $W_t$ is the target withdrawal amount needed to cover spending for year $t$.
Tax Cost Function
The total tax cost for a given withdrawal mix is:
Income Tax Component
Ordinary income includes traditional IRA withdrawals, Social Security (if applicable), pensions, and interest/dividends from the taxable account:
Federal income tax is computed using the progressive bracket structure. For married filing jointly in 2026 (indexed for inflation):
| Taxable Income | Marginal Rate |
|---|---|
| $0 – $23,200 | 10% |
| $23,200 – $94,300 | 12% |
| $94,300 – $201,050 | 22% |
| $201,050 – $383,900 | 24% |
| $383,900 – $487,450 | 32% |
| $487,450 – $731,200 | 35% |
| Over $731,200 | 37% |
Capital Gains Component
When withdrawing from a taxable account, only the appreciated portion is subject to capital gains tax:
Long-term capital gains rates (for assets held >1 year) are preferential:
| Taxable Income | LTCG Rate |
|---|---|
| $0 – $94,050 (MFJ) | 0% |
| $94,050 – $583,750 | 15% |
| Over $583,750 | 20% |
Notably, the 0% capital gains bracket creates an opportunity: if ordinary income is low enough, retirees can sell appreciated assets and pay zero tax on the gains.
IRMAA Surcharges
Medicare Part B and Part D premiums increase for high-income beneficiaries based on Modified Adjusted Gross Income (MAGI) from two years prior. For 2026 (based on 2024 MAGI):
| MAGI (MFJ) | Part B Surcharge | Part D Surcharge | Total Annual |
|---|---|---|---|
| Under $206,000 | $0 | $0 | $0 |
| $206,000 – $258,000 | +$70/mo | +$12/mo | +$1,968/yr |
| $258,000 – $322,000 | +$175/mo | +$31/mo | +$4,944/yr |
| $322,000 – $386,000 | +$280/mo | +$50/mo | +$7,920/yr |
| $386,000 – $750,000 | +$385/mo | +$69/mo | +$10,896/yr |
| Over $750,000 | +$420/mo | +$77/mo | +$11,928/yr |
IRMAA creates income cliffs: earning $1 over a threshold can cost thousands in additional premiums.
Early Withdrawal Penalty
Traditional IRA/401k withdrawals before age 59½ incur a 10% penalty (with certain exceptions like Rule 72(t) SEPP):
Required Minimum Distributions (RMDs)
Starting at age 73 (for those born 1951-1959), the IRS requires minimum annual withdrawals from traditional accounts based on the Uniform Lifetime Table:
The optimizer enforces: $w_{\text{trad}} \geq \text{RMD}_t$ when RMDs apply. Failing to take RMDs results in a 25% penalty on the shortfall (recently reduced from 50%).
Optimization Algorithm: Grid Search
QuantCalc uses a brute-force grid search over possible withdrawal mixes. For computational efficiency, we discretize the search space:
- Divide total withdrawal $W_t$ into increments of 10%
- Enumerate all combinations: $(w_{\text{trad}}, w_{\text{roth}}, w_{\text{tax}})$ where each is a multiple of $0.1 \times W_t$
- Subject to: $w_{\text{trad}} + w_{\text{roth}} + w_{\text{tax}} = W_t$ and $w_{\text{trad}} \geq \text{RMD}_t$
This produces 66 unique combinations per year. For each combination, we compute total tax cost $C(\mathbf{w}_t)$ and select the minimum.
- Tax brackets create a non-smooth objective with discontinuities
- IRMAA thresholds introduce sharp cliffs
- The search space is small (66 points) and evaluation is fast
- Global optimum is guaranteed (no local minima trap)
Multi-Year Simulation
Each Monte Carlo simulation path now includes yearly tax optimization:
For each simulation s = 1, 2, ..., N:
Initialize accounts: A₀ = (B_trad, B_roth, B_tax)
For each year t = 1, 2, ..., T:
Generate portfolio returns
Apply returns to all accounts
Determine target withdrawal W_t (spending need)
Compute RMD_t if age ≥ 73
Run grid search over withdrawal mixes
Select mix w_t* that minimizes C(w_t)
Deduct withdrawals from accounts
Record tax cost, account balances
Calculate success rate and tax metrics
Metrics Reported
Tax-Aware Mode adds these outputs:
- Lifetime tax cost: Total taxes paid (income + CG + IRMAA + penalties) across all years
- Effective tax rate: Total taxes / Total withdrawals
- Tax savings vs. naive: Comparison against a "taxable-first" strategy
- IRMAA exposure: Years spent in IRMAA brackets
- Account depletion sequence: Which accounts run out first
Practical Impact
For a typical retiree with $2M split across account types, tax-aware optimization can save $100,000 to $300,000+ over a 30-year retirement compared to naive strategies. The savings come from:
- Staying in lower tax brackets by mixing Roth withdrawals
- Harvesting capital gains at 0% when income allows
- Avoiding IRMAA cliffs
- Strategic Roth conversions in low-income years
20. ACA Subsidy Cliff Management
For early retirees (ages 55-64, before Medicare eligibility), the Affordable Care Act (ACA) subsidy cliff represents one of the most significant financial risks in retirement planning. The cliff creates a scenario where earning just $1 of additional income can eliminate $15,000 to $30,000 in annual health insurance subsidies—an effective marginal tax rate exceeding 1,000%.
QuantCalc's Tax-Aware Mode includes ACA cliff detection and optimization to help early retirees navigate this challenge.
What is the ACA Subsidy Cliff?
The ACA provides premium tax credits (subsidies) to reduce the cost of marketplace health insurance for individuals and families below certain income thresholds. Prior to 2026, enhanced subsidies phased out gradually. Starting in 2026, the subsidies revert to the original ACA structure with a hard cutoff at 400% of the Federal Poverty Level (FPL).
For 2026, the cliff occurs at:
| Household Size | 400% FPL (MAGI Threshold) |
|---|---|
| 1 (Single) | $60,240 |
| 2 (Married) | $81,760 |
| 3 | $102,400 |
| 4 | $123,040 |
| +1 per additional | +$20,880 |
If Modified Adjusted Gross Income (MAGI) exceeds the threshold by even $1, the entire subsidy disappears. There is no gradual phase-out.
Subsidy Calculation
ACA subsidies are calculated as the difference between the "benchmark plan" premium (second-lowest-cost Silver plan in your area) and a capped percentage of your income:
where $r_{\text{cap}}$ is the income-based cap percentage:
| MAGI as % of FPL | Cap (% of MAGI) |
|---|---|
| 100% – 133% | 2.0% |
| 133% – 150% | 3.0 – 4.0% |
| 150% – 200% | 4.0 – 6.5% |
| 200% – 250% | 6.5 – 8.5% |
| 250% – 300% | 8.5 – 9.5% |
| 300% – 400% | 9.5% |
| Over 400% | No subsidy |
Example: The $1 Cliff
Consider a 62-year-old married couple in Denver, Colorado:
Scenario A: MAGI = $81,000 (below 400% FPL)
- Benchmark Silver plan premium: $24,000/year
- Income cap (9.5% of MAGI): $7,695
- ACA subsidy: $24,000 - $7,695 = $16,305
- Out-of-pocket: $7,695/year
Scenario B: MAGI = $82,000 (above 400% FPL by $240)
- Benchmark Silver plan premium: $24,000/year
- ACA subsidy: $0 (cliff)
- Out-of-pocket: $24,000/year
Result: Earning an extra $1,000 cost this couple $16,305 in lost subsidies—a 1,631% marginal tax rate.
MAGI for ACA Purposes
ACA subsidies are based on Modified Adjusted Gross Income (MAGI), which is AGI plus certain add-backs. Critically, not all retirement income counts toward MAGI.
Income that COUNTS toward ACA MAGI:
- Traditional IRA/401k withdrawals
- Wages and self-employment income
- Taxable interest and dividends
- Capital gains (including from portfolio rebalancing)
- Rental income (net of expenses)
- Pension income
- Taxable Social Security benefits (if applicable)
Income that DOES NOT count toward ACA MAGI:
- Roth IRA withdrawals (contributions or earnings)
- Municipal bond interest
- HSA withdrawals for qualified medical expenses
- Qualified Charitable Distributions (QCDs) from IRAs
- Return of principal from non-qualified annuities
- Borrowed money (home equity lines of credit, margin loans)
QuantCalc's ACA Cliff Detection
When Tax-Aware Mode is enabled and the user's age is under 65, QuantCalc checks for ACA cliff risk:
- Determine household size from inputs
- Calculate 400% FPL threshold for the applicable year
- Monitor projected MAGI each year during simulation
- Flag cliff proximity: if MAGI is within 5% of the threshold, mark as "cliff risk"
Optimization Strategy
When the ACA cliff is detected, the withdrawal optimizer adjusts its strategy:
Priority 1: Maximize Roth Withdrawals
Since Roth withdrawals don't count toward MAGI, the optimizer prioritizes Roth over traditional accounts when ACA subsidies are at stake:
Priority 2: Harvest Taxable Gains at 0%
If MAGI is low enough to stay in the 0% long-term capital gains bracket (under ~$94,000 for married couples), the optimizer may recommend withdrawing from taxable accounts to "harvest" gains tax-free while staying under the ACA cliff.
Priority 3: Avoid Traditional Withdrawals
Traditional IRA withdrawals add dollar-for-dollar to MAGI. The optimizer minimizes traditional withdrawals except when:
- RMDs require them (age 73+)
- Roth and taxable accounts are depleted
- The cliff is unavoidable (e.g., large RMDs push MAGI over regardless)
Priority 4: Reduce Spending if Necessary
If reducing traditional withdrawals would keep MAGI under the cliff and the subsidy value exceeds the foregone spending, the optimizer may recommend reducing withdrawals (and thus spending) in that year.
Example: If crossing the cliff costs $18,000 in subsidies, it's better to spend $15,000 less that year (living on Roth or reducing discretionary expenses) than to lose $18,000 in subsidies.
Multi-Year Considerations
The ACA cliff is a multi-year optimization problem. Spending down Roth balances aggressively in early retirement (ages 55-64) preserves ACA subsidies but leaves less tax-free money for later years. The optimizer balances:
- Near-term subsidy preservation (Roth-heavy withdrawals during ACA years)
- Long-term tax efficiency (preserving Roth for high-tax years in late retirement)
Cliff Avoidance Tactics
QuantCalc models several advanced tactics automatically or via user configuration:
1. Roth Conversion Ladder (Pre-Retirement)
Convert traditional IRA funds to Roth IRA in low-income years (ages 50-54, or immediately post-retirement). This builds a Roth "cushion" for the ACA years.
2. Tax-Loss Harvesting (Taxable Accounts)
Sell losing positions to offset capital gains from winners, keeping net realized gains (and thus MAGI) low.
3. Bunching Income into Non-ACA Years
If a large income event is unavoidable (stock options vesting, real estate sale), time it for:
- Before retirement (still on employer insurance)
- After age 65 (on Medicare, ACA no longer applies)
4. Spending Flexibility
Model variable spending: reduce discretionary expenses during ACA years to stay under the cliff, then increase spending after Medicare eligibility.
Metrics Reported
When ACA cliff logic is active, QuantCalc reports:
- ACA cliff exposure: Number of years projected MAGI exceeds 400% FPL
- Subsidy value at risk: Total dollar value of subsidies lost due to cliff crossings
- Optimal withdrawal sequence: Recommended mix of Roth, traditional, and taxable withdrawals each year
- MAGI trajectory: Year-by-year projected MAGI relative to the cliff threshold
- Break-even analysis: Trade-off between spending less vs. losing subsidies
Limitations and Assumptions
QuantCalc's ACA cliff modeling assumes:
- Cliff remains at 400% FPL: If Congress restores enhanced subsidies, the cliff may be eliminated or softened
- Benchmark premium estimates: Actual premiums vary by location, age, and plan design
- No mid-year income changes: ACA subsidies are reconciled annually; mid-year income spikes require estimated tax payments
References and Further Reading
For detailed guidance on ACA subsidy optimization, see QuantCalc's ACA Subsidy Cliff 2026 blog post and the ACA Subsidy Calculator.
21. Implementation Notes
For $N$ simulations over $T$ months with $n$ assets, random numbers needed: $N \times T \times n$. For 10,000 sims × 720 months × 5 assets = 36 million random numbers.
Optimizations: Pre-generate random numbers in batch, vectorized operations, pre-compute Cholesky factor, fixed seed during optimization.
22. References
- Glasserman, P. (2003). Monte Carlo Methods in Financial Engineering. Springer.
- Jorion, P. (2006). Value at Risk. McGraw-Hill.
- Nocedal, J. & Wright, S. (2006). Numerical Optimization. Springer.
- Kraft, D. (1988). "A software package for sequential quadratic programming." DFVLR-FB 88-28.
- Sobol, I.M. (1967). "On the distribution of points in a cube." USSR Comp. Math. & Math. Phys.
Ready to run your own simulation?
QuantCalc runs this entire methodology in your browser — no account, no data collection.
Open QuantCalc →