Several articles on this site use interactive components — simulations and calculators — that let you experiment with parameters and see results in real time.

This article is a comprehensive walkthrough of the ten components:

  1. Compound interest — deterministic growth model
  2. Rebalancing visualiser — a single stochastic simulation with four strategies
  3. Monte Carlo simulator — hundreds of parallel simulations with statistics
  4. Optimal rebalance frequency — comparison of six frequencies under taxation
  5. Volatility harvesting simulator — isolates the pure rebalancing bonus with two identical assets
  6. GAK Calculator — deterministic average cost basis calculator
  7. Pension supplement curve — deterministic calculator for Denmark’s pensionstillæg reduction
  8. Account type comparison — deterministic comparison of end wealth across savings account types
  9. Housing: own vs. rent — deterministic comparison of the monthly disposable economy of staying in the house versus selling and renting
  10. Net income in retirement — deterministic calculator for the monthly net income as a retiree across account types

For each component this article covers: what it shows, what settings it has, the maths behind it, and what it cannot tell you.


1. Compound Interest

What it shows

This is the simplest of the three components. It shows a deterministic (non-random) growth path for an investment over time.

There are two curves:

  • Portfolio value — what you have, year by year
  • Invested capital — the flat line showing your starting amount

The difference between them is the accumulated return — the classic illustration of the compound interest effect.

Settings

SettingDefaultRange
Initial capital100,00010,000 – 1,000,000
Annual return7 %1 – 20 %
Years305 – 50

The maths

The calculation is simple exponential growth:

V(t)=K(1+r)tV(t) = K \cdot (1 + r)^t

Where KK is the starting capital, rr is the annual return, and tt is the number of years.

The code applies it recursively year by year, but the result is identical:

V(0) = K
V(t) = V(t−1) · (1 + r)

Limitations

  • No volatility. The return is constant every year. In reality returns fluctuate — up and down.
  • No inflation. All amounts are in nominal currency, not real.
  • No tax. The compound effect looks more impressive than it does in practice, because tax is not deducted along the way.
  • No contributions or withdrawals. Only one starting deposit; no ongoing cash flows.

The component is useful for illustrating the principle of exponential growth — but not for predicting what your portfolio will actually be worth.


2. Rebalancing Visualiser

What it shows

This component runs a single stochastic simulation and displays four curves on the same chart:

  • Stocks (100%) — a pure equity portfolio
  • Bonds (100%) — a pure bond portfolio
  • Rebalanced — before tax — a mixed portfolio continuously brought back to the target allocation, without any tax deduction
  • Rebalanced — after tax — the same strategy, but with a tax charge on realised gains at each rebalance

The key point is that all four curves use identical random market movements. The difference is due solely to the portfolio strategy — not to the random draws.

The “New simulation ↻” button generates a fresh set of random market movements.

Settings

Settings are grouped into three sections:

Market scenario

SettingDefaultWhat it is
Stock return7 %Expected average annual return for equities
Stock volatility18 %Standard deviation of annual equity returns
Bond return3 %Expected average annual return for bonds
Bond volatility6 %Standard deviation of annual bond returns
Correlation0Pearson correlation between stock and bond shocks
Years20Simulation horizon in years

Portfolio setup

SettingDefaultWhat it is
Stock allocation60/40Target weight for equities (bonds fill the rest)
Tax rate27 %Tax rate on realised gains at rebalancing

Rebalancing settings

SettingDefaultWhat it is
FrequencyEvery yearCalendar-based trigger: every 1–10 years, or never
Drift thresholdNoneOnly rebalance if the stock weight has drifted more than X pp from the target

When frequency is set to Never, the after-tax rebalancing curve is hidden (since no rebalancing takes place).

When the drift threshold is set to e.g. ±5 pp, rebalancing only occurs when the calendar trigger fires and the drift exceeds 5 percentage points.

The maths

Geometric Brownian Motion (GBM)

Returns for each year are drawn as log-normal factors based on geometric Brownian motion:

S(t+1)=S(t)exp ⁣((μ12σ2)+σZ),ZN(0,1)S(t+1) = S(t) \cdot \exp\!\bigl((\mu - \tfrac{1}{2}\sigma^2) + \sigma Z\bigr), \quad Z \sim \mathcal{N}(0,1)

This model is standard in financial theory (Black-Scholes) and has two important properties:

  • Prices can never go negative
  • The geometric mean return is correct even though each year’s return varies

The term μ12σ2\mu - \tfrac{1}{2}\sigma^2 is an Itô correction: it ensures that the geometric mean return matches the desired parameter μ\mu, rather than the arithmetic mean.

Box-Muller transform

The standard-normal values ZZ are generated using the Box-Muller transform from two uniformly distributed values u1u_1 and u2u_2:

Z=2lnu1cos(2πu2)Z = \sqrt{-2\ln u_1} \cdot \cos(2\pi u_2)

Correlation via Cholesky decomposition

When the correlation parameter ρ\rho is non-zero, correlated shocks are produced via Cholesky decomposition of the 2×22\times2 correlation matrix:

zstocks=z1,zbonds=ρz1+1ρ2z2z_\text{stocks} = z_1, \qquad z_\text{bonds} = \rho \cdot z_1 + \sqrt{1-\rho^2} \cdot z_2

This gives exactly Corr(zstocks,zbonds)=ρ\operatorname{Corr}(z_\text{stocks},\, z_\text{bonds}) = \rho.

A negative correlation (e.g. −0.3) models the classic flight-to-safety effect, where bonds rise when equities fall.

Tax calculation at rebalancing

When an asset class is sold to bring the portfolio back to its target allocation, tax is calculated on the realised gain:

Sold fraction  = sale amount ÷ current market value
Taxable gain   = (market value − cost basis) × sold fraction
Tax paid       = taxable gain × tax rate  (only if positive)

The cost basis is updated proportionally for the sold fraction.

Limitations

  • One simulation at a time. A single path can look very different from another — click “New simulation” to see the spread.
  • Two asset classes only. The model supports only equities and bonds. Real estate, commodities, currencies, etc. are not included.
  • Constant parameters. Returns and volatility are assumed constant throughout the period. In reality, market regimes shift.
  • Full rebalance to target. Transaction costs (brokerage fees) are not accounted for.
  • Simplified tax model. The model assumes realisation-based taxation. ETFs and pension accounts subject to mark-to-market taxation behave differently.
  • No new contributions. Only one starting deposit.

3. Monte Carlo Simulator

What it shows

The Monte Carlo simulator runs hundreds of independent simulations in parallel and displays the statistical distribution of possible outcomes.

Unlike the rebalancing visualiser, this component compares two strategies:

  • Buy & hold — no rebalancing (deferred tax)
  • Rebalanced — ongoing rebalancing with tax on realised gains

For each strategy the result is displayed either as:

  • Spaghetti chart — all individual simulation paths
  • Fan chart — the median plus the 10th, 25th, 75th and 90th percentiles as shaded bands

Below the charts, histograms show the distribution of final values, along with statistical key figures (10th percentile, median, 90th percentile).

Settings

The settings are the same as in the rebalancing visualiser, with a couple of additions:

SettingDefaultWhat it is
Initial capital100,000Starting amount for all simulations
Stock return7 %Expected average annual return for equities
Stock volatility18 %Standard deviation of annual equity returns
Bond return3 %Expected average annual return for bonds
Bond volatility6 %Standard deviation of annual bond returns
Correlation0Pearson correlation between stock and bond shocks
Stock allocation60/40Target weight for equities
Tax rate27 %Tax rate on realised gains
Years20Simulation horizon
Simulations500Number of independent simulation paths
FrequencyEvery yearRebalancing frequency
Drift thresholdNoneDrift band before rebalancing is triggered

The buy & hold histograms show two series:

  • Deferred tax — portfolio value without deducting tax on accumulated gains (you still own them)
  • After exit tax — as if you sell everything and pay tax on all gains at the end

The maths

The simulations use the same GBM model with Cholesky correlation as the rebalancing visualiser. The difference is that N independent simulations are run instead of one.

Percentile calculation

For each year tt, all NN simulation values are sorted and percentiles are computed via linear interpolation (the same method as NumPy’s default):

i=p100(N1),v^p=vi(1w)+viw,w=iii = \frac{p}{100} \cdot (N-1), \qquad \hat{v}_p = v_{\lfloor i \rfloor}(1-w) + v_{\lceil i \rceil}\,w, \quad w = i - \lfloor i \rfloor

The histogram

The final values from all N simulations are divided into 20 equal-width bins from minimum to maximum. To make the two strategies’ histograms directly comparable, both use the same bin boundaries — otherwise the bar widths would differ and the comparison would be misleading.

Buy & hold with exit taxation

For buy & hold there are no tax payments along the way. But two versions are shown:

  • Deferred tax: the portfolio value is the raw market value
  • Exit taxation: tax is deducted from the final value as if everything is sold: final value − (final value − starting capital) × tax rate (only if a gain)

Limitations

  • Stochastic, not predictive. The Monte Carlo simulation shows a probability distribution of possible outcomes — not a forecast of the future.
  • Independent years. The model assumes each year’s return is independent of previous years. Autocorrelation and mean reversion (which some empirical studies suggest) are not modelled.
  • Log-normal distribution. Returns are assumed log-normal (thinner tails than reality). Extreme events such as financial crises are under-represented.
  • Constant parameters. Volatility is constant — there is no volatility clustering (where periods of high turbulence tend to be followed by more high turbulence).
  • Two asset classes. The same limitation as the rebalancing visualiser.
  • No transaction costs.
  • Number of simulations vs. precision. 500 simulations gives reasonable statistical stability for illustrative purposes, but extreme percentiles (e.g. 5th and 95th) are less reliable than the median and 10th/90th percentiles.

4. Optimal Rebalance Frequency

What it shows

This component asks the question: which rebalancing frequency produces the best outcome under taxation?

It runs Monte Carlo simulations for six fixed rebalancing frequencies and plots the median final portfolio value for each as a line:

X-axis labelFrequency
NeverNo rebalancing (buy & hold)
10yRebalance every 10 years
5yRebalance every 5 years
3yRebalance every 3 years
2yRebalance every 2 years
1yRebalance every year

The point on the line with the highest median final value is highlighted with a marker and the text “Optimal” above it. A caption below the chart names the optimal frequency in plain text.

The purpose is not to give a definitive answer, but to illustrate how taxation shifts the optimal frequency: because rebalancing triggers tax on realised gains, there is a trade-off — rebalancing too often costs too much in tax, while rebalancing too rarely lets the portfolio drift far from its target allocation.

Settings

The component has no sliders for rebalance frequency or drift threshold — those are the x-axis of the chart. Instead, you can adjust all the parameters that determine what the optimal frequency is:

SettingDefaultWhat it is
Stock return7 %Expected average annual return for equities
Stock volatility18 %Standard deviation of annual equity returns
Bond return3 %Expected average annual return for bonds
Bond volatility6 %Standard deviation of annual bond returns
Correlation0Pearson correlation between stock and bond shocks
Years20Simulation horizon
Simulations300Number of independent simulation paths per frequency
Tax rate27 %Tax rate on realised gains at rebalancing
Drift thresholdNoneOnly rebalance if the stock weight has drifted more than X pp from the target

The maths

The component uses exactly the same GBM simulation engine as the Monte Carlo simulator. For each of the six frequencies:

  1. N sets of random market movements are generated (one set per simulation)
  2. All six frequencies are simulated using the same random draws
  3. The median final value is computed across the N simulations

Sharing identical random draws across all six frequencies is essential: it ensures that differences in median final value are due solely to the rebalancing strategy — not to the composition of the random numbers in a given run.

Tax as a brake on frequent rebalancing

The effect is intuitively understandable: rebalancing is a form of volatility harvesting — selling what has risen and buying what has fallen, capturing the benefit of ongoing price fluctuations. But under a realisation-based tax regime, every sale costs tax on the gain. This reduces the capital base that subsequently grows exponentially. The more frequently you rebalance, the more tax you pay, and the less capital remains to compound.

The optimal point is where the marginal benefit from additional rebalancing is exactly offset by the marginal tax cost.

Limitations

  • Median is not the only criterion. The component uses median final value. A risk-averse criterion (e.g. the 10th percentile) may give a different optimum.
  • Stochastic variation. With 300 simulations per frequency, the median is reasonably stable, but click “New simulation” to see how much the optimum can vary between runs.
  • Same limitations as the Monte Carlo simulator otherwise: no new contributions, constant parameters, log-normal distribution, two asset classes only.

5. Volatility Harvesting Simulator

What it shows

This component isolates the pure rebalancing bonus by removing any return difference between the two assets. Both assets have identical expected return and identical volatility — the only thing that varies is the correlation between them.

Two strategies are compared:

  • Single asset (buy & hold) — 100 % invested in one asset, never rebalanced
  • Rebalanced 50/50 (no tax) — both assets held in equal weight, rebalanced annually, no tax

Because the assets are identical, any difference in outcome is entirely due to the rebalancing mechanism itself — not to any expected-return premium from holding one asset over another.

The chart shows fan bands (10th–90th percentile range) and median lines for both strategies. Below the chart, two statistics are displayed:

  • Theoretical premium (p.a.) — calculated directly from the formula σ24(1ρ)\frac{\sigma^2}{4}(1-\rho)
  • Simulated premium (p.a.) — the annualised ratio of the two median final values

Settings

SettingDefaultRange
Asset return7 %−5 % to 20 %
Asset volatility20 %5 % to 50 %
Correlation0−0.9 to +0.9
Years205–40
Simulations300100–1000

Note: “Asset return” and “Asset volatility” apply to both assets identically. There is no separate stock/bond distinction in this component.

The maths

The simulation uses the same GBM engine with Cholesky correlation as the other components. Both assets are generated with the same parameters; their shocks are coupled at the specified correlation.

For the single-asset strategy, the portfolio simply tracks one asset’s cumulative return factor. For the rebalanced strategy, simulatePortfolio is called with stockAllocation = 0.5, rebalanceFrequency = 1, and taxRate = 0.

The theoretical premium

For two equal-weight assets with identical volatility σ\sigma and correlation ρ\rho:

  • Portfolio variance: σp2=σ22(1+ρ)\sigma_p^2 = \frac{\sigma^2}{2}(1+\rho)
  • Single-asset variance: σ2\sigma^2
  • Arithmetic–geometric gap saved by rebalancing: σ22σ24(1+ρ)=σ24(1ρ)\frac{\sigma^2}{2} - \frac{\sigma^2}{4}(1+\rho) = \frac{\sigma^2}{4}(1-\rho)

The annual rebalancing premium is therefore:

premiumσ24(1ρ)\text{premium} \approx \frac{\sigma^2}{4}(1-\rho)

This premium exists because the rebalanced portfolio has lower variance than either single asset, and lower variance means a smaller drag on compounded returns.

The simulated premium

The simulated premium is computed from the median paths:

simulated premium=(median final value (rebalanced)median final value (single asset))1/T1\text{simulated premium} = \left(\frac{\text{median final value (rebalanced)}}{\text{median final value (single asset)}}\right)^{1/T} - 1

This should converge to the theoretical value as the number of simulations increases.

Limitations

  • Tax-free only. The rebalanced strategy assumes no tax on realised gains. In taxable accounts the rebalancing premium must be weighed against the tax cost — see Rebalancing vs. Danish Taxation.
  • Identical assets. The component deliberately uses two identical assets to isolate the rebalancing effect. A real portfolio has assets with different expected returns, which introduces additional dynamics not shown here.
  • Annual rebalancing only. The rebalancing frequency is fixed at once per year. More or less frequent rebalancing would give different results.
  • All the standard Monte Carlo limitations apply: no new contributions, constant parameters, log-normal distribution, independent years.

6. GAK Calculator

What it shows

The GAK Calculator is a deterministic calculator, not a simulation. It demonstrates how the average cost basis — gennemsnitlig anskaffelseskurs (GAK) — is calculated when you hold the same security across multiple broker accounts.

The core point: under Danish tax law, GAK is calculated per person and per security — not per account. Purchases across Saxo and Nordnet are pooled into a single average. The calculator makes this visible: the result table shows the running GAK after each transaction, and the realised gain or loss on each sell.

See What is GAK? for a full explanation of the tax rules.

Inputs

ColumnWhat it is
DateTrade date
TypeBuy or Sell
AccountSaxo or Nordnet
QtyNumber of shares
PricePrice per share in DKK

The maths

On a buy, the average is updated:

GAKnew=total cost+qty×pricetotal shares+qty\text{GAK}_\text{new} = \frac{\text{total cost} + \text{qty} \times \text{price}}{\text{total shares} + \text{qty}}

On a sell, the current GAK is used as cost basis. The GAK itself does not change — only total cost and total shares are reduced proportionally:

Gain=(priceGAK)×qty sold\text{Gain} = (\text{price} - \text{GAK}) \times \text{qty sold}

total costnew=total costGAK×qty sold\text{total cost}_\text{new} = \text{total cost} - \text{GAK} \times \text{qty sold}

Limitations

  • Two accounts only. Real-world GAK applies across every account at every broker where a person holds the same security. The calculator uses Saxo and Nordnet as illustrative examples only.
  • No brokerage commissions. The acquisition cost should include trading fees; the calculator uses the raw price only.
  • No currency conversion. Foreign-currency purchases must be converted to DKK at the trade-date exchange rate. The calculator assumes all prices are already in DKK.
  • No corporate actions. Stock splits, reverse splits, spinoffs, and mergers all affect GAK in specific ways not handled here.
  • No historical opening prices. Special transitional rules apply to shares held before 2006.

7. The Pension Supplement Curve

What it shows

The pension supplement curve is a deterministic calculator — no random elements, no simulation. For a given level of other income, it calculates the total monthly net income for a single Danish retiree in 2026 after income tax and after the pensionstillæg reduction (hereafter PT) is applied.

Two curves are shown on the same chart:

  • Actual net income (blue, solid) — basic folkepension + actual pension supplement (reduced) + other income, after income tax
  • Without PT reduction (grey, dashed) — hypothetical income if the supplement were always at its maximum (DKK 8,729/month), regardless of other income

The yellow background marks the reduction interval from DKK 99,200 to DKK 438,200 per year. The shaded area between the two curves is the monthly net loss due to the supplement reduction.

The effect is clear: the two curves start overlapping, diverge linearly within the reduction zone, and then remain parallel with a permanent gap. That gap represents the accumulated net cost of having income in the reduction zone.

Settings

SettingDefaultRange
Marginal tax rate37.0%30.0% – 45.0%

The tax setting reflects the total marginal income tax rate for retirees, including local and church tax. The typical rate for basic-rate taxpaying retirees is around 37–40% depending on municipality. Moving the slider updates both curves and all key figures in real time.

The maths

Pension supplement (2026, single retirees)

The supplement is calculated as:

PT(x)=max ⁣(0, 104,7480.309×max(0, x99,200))\text{PT}(x) = \max\!\bigl(0,\ 104{,}748 - 0{.}309 \times \max(0,\ x - 99{,}200)\bigr)

Where xx is total other income per year in DKK. The reduction rate 0.3090.309 (30.9%) is set by law.

Total monthly net income

net(x)=(90,528+PT(x)+x)×(1t)12\text{net}(x) = \frac{\bigl(90{,}528 + \text{PT}(x) + x\bigr) \times (1 - t)}{12}

Where tt is the flat marginal tax rate. The folkepension basic amount (DKK 90,528/year) is included in all calculations.

Effective marginal rate in the reduction zone

For xx in the interval [99,200; 438,200][99{,}200;\ 438{,}200], the marginal net income per extra krone is:

d(net)dx=(10.309)×(1t)12=0.691×(1t)12\frac{d(\text{net})}{dx} = \frac{(1 - 0{.}309) \times (1 - t)}{12} = \frac{0{.}691 \times (1 - t)}{12}

The effective marginal rate is therefore:

eff. marginal rate=t+0.309×(1t)\text{eff. marginal rate} = t + 0{.}309 \times (1 - t)

At t=37%t = 37\,\%: 0.37+0.309×0.63=0.37+0.195=56.5%0.37 + 0.309 \times 0.63 = 0.37 + 0.195 = 56.5\,\%.

Outside the reduction zone the effective marginal rate is simply tt — normal income tax.

The permanent monthly loss

For x>438,200x > 438{,}200 the supplement is zero. The permanent monthly net loss compared to the “no reduction” scenario is:

loss=PT_MAX×(1t)12=104,748×(1t)12\text{loss} = \frac{\text{PT\_MAX} \times (1 - t)}{12} = \frac{104{,}748 \times (1 - t)}{12}

At t=37%t = 37\,\%: 104,748×0.63/12DKK 5,500/month104{,}748 \times 0.63 / 12 \approx \text{DKK }5{,}500\text{/month}.

Limitations

  • Flat tax rate. The model uses a single flat marginal rate for all income. The actual Danish tax calculation is progressive and depends on local tax, church tax, the personal allowance, and possible top-bracket tax. The calculator is a good approximation but not a precise tax calculation.
  • Single retirees only. The rates and thresholds apply to single folkepension recipients in 2026. Different thresholds and a joint income basis apply to married and cohabiting couples.
  • No progression effects. In practice, total income tax also rises with higher other income (basic rate, top rate, etc.). The model does not capture this.
  • Year. Thresholds and rates apply to 2026. The amounts are adjusted annually.
  • No ældrecheck. The ældrecheck (senior supplement) is a separate benefit with its own rules and is not included in the calculation.

8. The Account Type Comparison

What it shows

The account type comparison is a deterministic calculator — no random elements. It calculates the end wealth after all Danish taxes for the same monthly amount of salary (after AM-bidrag, the 8% labour market contribution), placed in seven different ways:

  • Aldersopsparing — 15.3% PAL tax along the way, no tax at payout
  • Ratepension under three payout scenarios: 37% (bottom bracket), 42%, and the pension supplement reduction zone (~56% effective)
  • Stock savings account (ASK) — 17% mark-to-market taxation
  • Taxable account, individual shares — untaxed growth, 27% of the gain at sale
  • Taxable account, ETF — 27% annual mark-to-market taxation

The bars are sorted by end wealth with the highest on top. The component is used in the article Ratepension or taxable account?.

Settings

SettingDefaultRange
Monthly amount (of salary)DKK 3,000500 – 10,000
Number of years255 – 40
Expected annual return7%1 – 12%
Marginal tax at contribution37%30 – 56%

The marginal tax at contribution has a double effect: it determines how much is left to invest in the free accounts (the amount is taxed first), and it determines the deduction value for the ratepension (which receives the full gross amount). The payout tax for ratepension is fixed in the three scenarios — that is precisely the point: contribution and payout rates can differ.

The maths behind it

All accounts are modelled with annual deposits at the start of each year (annuity due):

FV=D(1+r)N1r(1+r)FV = D \cdot \frac{(1+r)^N - 1}{r} \cdot (1+r)

Where DD is the annual deposit, rr is the effective annual return and NN is the number of years.

Mark-to-market accounts (aldersopsparing, ratepension, ASK, ETF) are modelled with an effective return r=rgross(1s)r = r_{\text{gross}} \cdot (1 - s), where ss is the account’s tax rate on returns (15.3%, 17% or 27%). This corresponds to the tax being paid each year out of that year’s return.

Realisation-taxed individual shares grow untaxed to FVgrossFV_{\text{gross}}, after which the gain is taxed at exit:

FVnet=FVgross0.27max(0, FVgrossDN)FV_{\text{net}} = FV_{\text{gross}} - 0.27 \cdot \max(0,\ FV_{\text{gross}} - D \cdot N)

Ratepension deposits the gross amount D=12monthly amountD = 12 \cdot \text{monthly amount} and is multiplied at payout by (1tout)(1 - t_{\text{out}}). In the reduction zone scenario the effective payout rate is:

tout=0.37+0.309(10.37)56.5%t_{\text{out}} = 0.37 + 0.309 \cdot (1 - 0.37) \approx 56.5\,\%

— normal income tax plus the net effect of the pension supplement’s 30.9% reduction.

The free accounts deposit the net amount D=12monthly amount(1tin)D = 12 \cdot \text{monthly amount} \cdot (1 - t_{\text{in}}).

A central property of the model: when tin=toutt_{\text{in}} = t_{\text{out}}, aldersopsparing and ratepension are identical to the last krone, because Dv(1t)D \cdot v \cdot (1-t) and D(1t)vD \cdot (1-t) \cdot v are the same product. The difference between the two arises solely when the rates diverge.

Limitations

  • Deposit ceilings are not enforced. Aldersopsparing (DKK 9,900/year in 2026, DKK 64,200 within 7 years of pension age), the stock savings account (DKK 174,200 in 2026) and the ratepension deduction ceiling (DKK 68,700 in 2026) are exceeded freely in the model. The bars show each account type’s tax profile — not necessarily realistic single scenarios at high amounts.
  • Flat rates. The progression in stock income tax (27%/42% above DKK 79,400 in 2026) is simplified to 27% for both ETF and individual shares. Large annual gains or a single-shot exit would trigger 42% on part of the gain.
  • Deterministic returns. No volatility, no sequence risk — just a constant annual growth rate.
  • The extra pension deduction is not included. The additional allowance of 12%/32% of pension contributions (up to DKK 87,800 in 2026) would improve the ratepension result by a few percentage points.
  • No inflation, fees or costs. All amounts are nominal, and trading and custody costs are left out.
  • The pension supplement scenario is an extreme. It assumes the entire payout falls inside the reduction zone. In practice, typically only part of the payout will.

9. Housing: own vs. rent

What it shows

The housing comparison is a deterministic calculator — no random elements. It compares the monthly disposable economy over 20 years for two choices a retiree often faces: staying in an owner-occupied home, or selling it and renting instead.

What is plotted is the monthly net cash flow from the housing choice itself — that is, what the home costs or gives each month, held separate from the rest of the household’s finances. Negative numbers mean the home is a net expense that month (which it almost always is). What is interesting is the distance between the two curves, and whether — and when — they cross.

Two curves are shown:

  • Stay in the house (blue) — the negative cash flow from the ownership costs, while the equity remains locked in the home
  • Sell and rent (green) — the after-tax return on the invested equity, minus rent

The component is used in the article Own, rent or invest.

Settings

SettingDefaultRange
Home valueDKK 3,000,0001,000,000 – 8,000,000
EquityDKK 2,000,0000 – 8,000,000
RentDKK 12,000/mo.4,000 – 25,000
Expected investment return5 %1 – 10 %
Tax rate on returns27 %17 – 42 %

Equity is internally capped at no more than the home value (equity cannot exceed the home’s value). The difference between home value and equity is interpreted as remaining debt, which in the “stay” scenario triggers interest costs, and which in the “sell and rent” scenario is paid off at the sale.

The maths behind it

Ownership costs (“stay in the house”)

The annual ownership costs in year 1 consist of four terms:

pvt=0.0051×0.80×home value\text{pvt} = 0{.}0051 \times 0{.}80 \times \text{home value} land tax=0.0074×0.80×land value\text{land tax} = 0{.}0074 \times 0{.}80 \times \text{land value} maintenance=0.01×home value\text{maintenance} = 0{.}01 \times \text{home value} interest=remaining debt×0.03\text{interest} = \text{remaining debt} \times 0{.}03

Property value tax (5.1 ‰) and land tax (national average 7.4 ‰) are calculated on 80% of the assessment (the caution principle). The land value is assumed to be 40% of the home value. Maintenance is set at 1% of the home value per year (a rule of thumb). The remaining debt is home value minus equity, and its effective loan rate is set at 3% — corresponding to about 4% nominal interest after an interest deduction of about 25.6%.

The monthly cash flow in year tt (1-indexed) is negative and is grown with inflation:

stay(t)=(pvt+land tax+maintenance+interest)×1.02t112\text{stay}(t) = -\frac{(\text{pvt} + \text{land tax} + \text{maintenance} + \text{interest}) \times 1{.}02^{\,t-1}}{12}

Sell and rent

At the sale the equity is freed up and invested. The after-tax return is constant in nominal terms (the capital is preserved, the return consumed):

return=equity×r×(1s)\text{return} = \text{equity} \times r \times (1 - s)

where rr is the expected return and ss is the tax rate. The rent is grown with inflation. The monthly cash flow in year tt is:

sell(t)=returnrentyear×1.02t112\text{sell}(t) = \frac{\text{return} - \text{rent}_\text{year} \times 1{.}02^{\,t-1}}{12}

Key figures

The component shows four key figures: the sell+rent advantage in year 1 (the difference between the two curves at the start), the average of each curve over the 20 years, and the crossover year — the first year in which “stay in the house” gives a better (less negative) cash flow than “sell and rent”, or “none” if it does not happen within the period.

Limitations

  • Inflation hits only one side. Rent and ownership costs are grown by 2% per year, while the investment return is held nominally constant. This is a deliberate, transparent assumption (you consume the return and preserve the capital), but it makes the rent scenario look gradually worse over time. If you chose to reinvest part of the return, the picture would be different.
  • Land value and loan rate are fixed assumptions. The land value is set at 40% of the home value, and the effective loan rate at 3%. Both vary considerably in reality from home to home and from municipality to municipality.
  • Appreciation and wealth are not in the curves. The model plots only running cash flow. That the owner keeps a home that typically rises tax-free in value, while the tenant keeps liquid, invested capital, does not appear in the charts — it is a separate wealth dimension that the article treats in the text.
  • No pensioner rebate. Any rebate in the property value tax for pensioners is not deducted.
  • No transaction costs. Estate agent, lawyer and moving at a sale are not included, even though they can amount to several hundred thousand kroner.
  • No pension supplement effect. The return on invested equity can affect the pension supplement depending on the account type — that is not modelled here.
  • Flat tax rate and fixed 2026 rates. The progression in stock income tax (27%/42%) is simplified to a single rate, and all tax rates are at 2026 level and are adjusted annually.

10. Net income in retirement

What it shows

The net-income-in-retirement calculator is a deterministic calculator — no random elements. It estimates what a single state pensioner will have in monthly net income (after tax and after the pension supplement reduction) once personal savings are added on top of the state pension, ATP and any occupational pension.

It gathers all the mechanisms the rest of the pension series treats separately — the pension supplement reduction, the different taxation of the account types, and the distinction between what counts as “other income” and what does not — into a single figure. The bars show the estimated net income for each of the four account types (ratepension, aldersopsparing, stock savings account, taxable account) with the chosen settings, so the effect of the account choice becomes directly visible. The buttons select which account type the key figures below apply to. The component is used in the article What should you save for retirement?.

Settings

SettingDefaultRange
Your age now40 yrs25 – 66 yrs
Retirement age68 yrs65 – 75 yrs
Current savingsDKK 200,0000 – 3,000,000
Monthly savingDKK 3,0000 – 15,000
Expected annual return6 %1 – 10 %
Other lifelong pension/yrDKK 77,0000 – 300,000
Marginal tax as pensioner37 %30 – 45 %
Account typeRatepensionFour buttons

“Other lifelong pension” covers ATP and occupational pension added together; both count in full in the pension supplement calculation. The account-type buttons select which bar the key figures (net income, other income, pension supplement and savings at retirement) refer to.

The maths behind it

Accumulation up to retirement

The number of years to retirement is N=max(0, retirement ageage)N = \max(0,\ \text{retirement age} - \text{age}). Savings grow at an effective return reff=r(1saccum)r_\text{eff} = r \cdot (1 - s_\text{accum}), where saccums_\text{accum} is the account’s ongoing return tax: 15.3% for aldersopsparing and ratepension (PAL), 17% for the stock savings account, and 0% for the taxable account (realisation — deferred until sale).

Current savings compound over NN years, and the monthly contributions (converted to an annual amount) are treated as an annuity due:

K=K0(1+reff)N+D(1+reff)N1reff(1+reff)K = K_0 \cdot (1 + r_\text{eff})^N + D \cdot \frac{(1+r_\text{eff})^N - 1}{r_\text{eff}} \cdot (1 + r_\text{eff})

Withdrawal

The capital KK is drawn down evenly from retirement age to 85 (payout period Y=85retirement ageY = 85 - \text{retirement age}) with continued growth reffr_\text{eff}. The annual withdrawal is an annuity payment:

W=Kreff1(1+reff)YW = \frac{K \cdot r_\text{eff}}{1 - (1 + r_\text{eff})^{-Y}}

For the taxable account a gain fraction g=max(0, (Kcontributions)/K)g = \max(0,\ (K - \text{contributions})/K) is calculated, used to determine the taxable part of each withdrawal.

Pension supplement and tax

How much of the withdrawal counts towards the pension supplement depends on the account type: ratepension counts in full (all of WW), the taxable account counts the gain fraction (WgW \cdot g), while aldersopsparing and the stock savings account do not count. Other income AA is the other lifelong pension plus the counting part of the withdrawal, and the supplement is calculated with the same stepped formula as in component 7:

PT(A)=max ⁣(0, 104,7480.309×max(0, A99,200))\text{PT}(A) = \max\!\bigl(0,\ 104{,}748 - 0{.}309 \times \max(0,\ A - 99{,}200)\bigr)

Personal income (folkepension basic amount + PT + other pension + any ratepension payout) is taxed at the flat marginal rate tt. Aldersopsparing and the stock savings account are added net (already taxed along the way), and the taxable account is added net of 27% stock income tax on the gain fraction. The sum is divided by 12 for the monthly net income.

Limitations

  • The deduction asymmetry is not modelled. The monthly amount is assumed paid straight onto the account. In reality a ratepension contribution costs less after tax than a contribution to a free account, because the deduction cancels the income tax at contribution. The model treats all account types identically on the contribution side, which understates ratepension’s relative advantage.
  • Flat marginal tax. One rate is used for all personal income. Real tax is progressive and depends on local tax, personal allowance and any top-bracket tax.
  • Single retirees, 2026 rates. Thresholds and rates apply to single state pensioners in 2026 and are adjusted annually. Married and cohabiting couples have different thresholds and a combined income basis.
  • Simplified taxable account. The taxable account is assumed to grow untaxed and is taxed at 27% of a fixed gain fraction on withdrawal. Mark-to-market ETFs, progression to 42% and dividend withholding are not modelled separately.
  • Fixed payout horizon. Savings are drawn down to age 85 regardless of account type. A real ratepension has statutory payout periods (at least 10 years), and other accounts can be drawn entirely freely.
  • Deterministic return. Constant annual growth, no volatility and no sequence risk. No inflation, costs or ongoing charges.
  • No old-age cheque or other supplements. Only folkepension, pension supplement and personal savings are included.

Common to all ten components

What they can do

  • Illustrate mathematical principles — compound interest, volatility harvesting, tax effects
  • Build intuition for magnitudes and relative differences
  • Let you experiment with parameters and see the immediate effect

What they cannot do

  • Predict the future. No financial model can.
  • Account for your specific situation — account type, tax circumstances, investment horizon, risk tolerance.
  • Model all asset classes. Real estate, gold, private equity, currencies etc. are not included.
  • Include behavioural risk — the risk that you sell in panic during a market downturn.
  • Replace personal advice from a financial adviser or tax specialist.

Technical details

Random number generator

JavaScript’s Math.random() is a pseudo-random number generator — not cryptographically secure, but sufficient for financial simulations for illustrative purposes.

Debouncing

To avoid running hundreds of simulations for every single slider movement, debouncing is used: the calculation is only triggered 300 ms after you stop adjusting. This gives a responsive interface without overloading the browser.

Freezing random draws

In the rebalancing visualiser, the random market movements are generated once, and all four strategies are then simulated using the same draws. This ensures that differences between the curves are due solely to the strategy — not to the random numbers.

In the Monte Carlo simulator, the same principle is applied to the buy & hold vs. rebalancing comparison: each pair of simulations (BH and RB) uses identical market movements.

In the optimal rebalance frequency component, the principle is extended further: all six frequencies share the same set of random draws. This means the line in the chart is a pure function of the rebalancing strategy — not of the particular random numbers drawn in that run.

In the volatility harvesting simulator, the same freeze is applied: both the single-asset strategy and the rebalanced strategy use identical draws for each simulation path. This means the gap between the two median lines is attributable purely to the rebalancing mechanism.

The pension supplement curve (component 7), the account type comparison (component 8), the housing comparison (component 9) and the net-income-in-retirement calculator (component 10) are entirely deterministic: there are no random draws at all. The results are calculated directly from the 2026 rules and update in real time when the settings change.