✦ Methods

Every model here is checked against something computed a different way.

A calculator that looks right and is wrong is worse than no calculator. So nothing goes up until its output has been reproduced by a second route: a closed-form formula, a numerical derivative, or an identity that has to hold exactly. This page shows the standard, four worked examples, and the mistakes the checks caught.

The standard

One routine agreeing with itself proves nothing. Two independent routes agreeing is evidence. Every model here is put through at least one of these before publishing.

Against a closed form

Where the mathematics has an exact solution, the running model is compared to it. Bond prices, annuity values and Gini coefficients all have one.

Against a numerical derivative

Anything defined as a rate of change is checked by differencing the underlying function. Marginal cost and duration are both derivatives, so both can be tested this way.

Against an accounting identity

Where quantities have to sum, the sum is computed both ways. Welfare areas, surplus transfers and cash flow statements all have to close exactly.

Against a second implementation

For the larger models, the whole calculation is written a second time, separately, and the two are compared across every preset.

At the boundaries

Every input is pushed to both extremes. A surprising share of errors only appear at zero, at a maximum, or exactly on a threshold.

Against the page's own words

Any sentence claiming a specific number is re-run against the live model. Prose drifts away from code more often than code drifts away from itself.

Four worked examples

These are the actual checks, with the actual results. Each one compares the model against something that had to be true independently of it.

Bond duration, against a numerical derivative

Bonds & Yield Curve simulator
Has to be true
Modified duration is defined as the price sensitivity to yield, so it must equal −(dP/dy) / P. The model computes it a completely different way, by weighting each cash flow by its present value.
How it was checked
Bond prices were computed from a separately written closed-form function, a central difference taken around the current yield, and the result compared against the cash-flow figure across six bond configurations.
Result
Agreement to display precision on all six. Two theoretical anchors also held exactly: a zero-coupon bond's Macaulay duration came out at 10.00 years for a 10-year bond, and a 10-year 5% par bond paying semiannually gave 7.99 years, matching the closed form (1+y)/y × [1 − (1+y)⁻ⁿ] to four decimals once its answer in coupon periods is converted to years.

Tariff welfare, against three accounting identities

Tariff simulator
Has to be true
Whatever the tariff, the four areas on the diagram must sum to the loss in consumer surplus, the producer-gain area must equal the change in producer surplus, and the loss to the country must equal the two deadweight triangles.
How it was checked
Each side was computed independently, the areas from their geometry and the surpluses from the surplus formula, at tariffs of 0, 2, 4, 6, 7 and 9.
Result
All three identities closed exactly at every level. The prohibitive case also behaved correctly: at a tariff of 7 imports reached zero, revenue fell to zero, and the domestic price landed on the no-trade price of 15.

The Gini coefficient, against numerical integration

Inequality simulator
Has to be true
The Gini is defined as the area between the Lorenz curve and the line of equality, or 1 − 2∫L(p)dp. For a lognormal distribution there is also a closed form, 2Φ(σ/√2) − 1. The two must match.
How it was checked
The Lorenz curve was integrated numerically over 200,000 slices and compared against the closed form at dispersions from 0.3 to 2.0.
Result
Agreement to roughly one part in ten million throughout. The inverse normal function used to build the curve was tested separately and round-trips to better than one part in ten million across the whole unit interval.

The retirement model, against a hand calculation

Retirement simulator
Has to be true
With volatility set to zero, randomness disappears. Every one of the thousand simulated lives should then be identical, and all of them should match an ordinary deterministic projection.
How it was checked
Volatility was set to zero and the median of a thousand runs compared against a separately written flat-return projection of the same inputs.
Result
All five percentiles collapsed onto the same figure, $2.00M, and the separately written projection landed on it too. The success rate went to 100%, as it has to when no life differs from any other. It also moved monotonically with the withdrawal rate, from 91% at 3% down to 74%, 56%, 35% and 23% at 7%, as it must.

What the checks caught

This is the more useful list. A claim that everything is correct carries no information, because anyone can make it. These are errors the process found before anything was published, which is the only evidence that the process runs at all.

1 A simulator with no real decision in it. In the business simulator, total demand was fixed, so raising the price only moved customers between two firms and never drove anyone out of the market. Profit therefore climbed all the way to the top of the price slider and the winning strategy was simply to charge the maximum. Giving buyers the option to walk away entirely produced a proper single-peaked curve with a sensible best price.
2 Chart elements drawn outside their own charts, four separate times. Bars on the bond cash-flow chart, a cost line on the externalities diagram, an axis label on the debt payoff chart, and the cumulative interest line on the loan chart all escaped the plot area. The last one had the same cause as the first: the vertical scale was set from one series while a second, larger one was drawn on the same axes, so at a high enough rate the interest line ran off the top. Each looked plausible until every drawn coordinate was tested against the chart's boundaries.
3 A page contradicting its own model. The valuation page claimed the high-growth example carried a larger share of its value in the terminal figure than the steady one. It carries a smaller share, 65% against 78%, because its forecast runs ten years instead of five. The corrected version makes forecast length the actual lesson.
4 A preset that disagreed with its own label. The long-run equilibrium example on the production cost page displayed a one dollar loss while its text said profit was exactly zero, because the price had been typed in by hand rather than solved from the cost curves. It is now solved, so it lands on break-even whatever the other inputs are.
5 A confident answer to a question outside the model. Setting the world price above the no-trade price on the tariff page produced a precise-looking loss figure. In that situation the country would export rather than import and the diagram does not apply at all. It now says so instead.
6 Labels one step out of line. On the inequality page, every example was labeled one band away from the classification the page itself computed for it, so a distribution titled "fairly even" was described underneath as moderately unequal.

What this does not prove

Correct arithmetic is not a correct model

Every check on this page confirms that a model computes its own equations properly. None of them says those equations describe the world well. A flawlessly implemented model of a poor assumption is still a poor model, and no amount of numerical agreement fixes that.

This is why every page here carries a section on what its model leaves out, written to be read rather than buried. The retirement model draws returns from a bell curve, which understates how often extreme years happen. The tariff diagram treats displaced workers as instantly re-employed. The Gini page cannot see wealth or mobility at all. Those are modeling choices, and they are argued about in the open on each page rather than certified away here.

These are teaching models, not advice

The personal finance calculators apply standard formulas correctly, and they still ignore taxes, fees, and the details of whatever product you are actually being sold. The simulators deliberately strip out complications so that one mechanism becomes visible, which is the opposite of what a decision needs.

Use them to build intuition, to sanity-check the shape of an answer, or to understand why a piece of advice you were given might be true. For an actual decision about your own money, talk to somebody qualified who knows your situation.

Things still get through

The list above is not a claim that it is the complete list. Verification reduces mistakes, it does not eliminate them, and the ones that survive are by definition the ones nobody thought to test for.

If you find something that looks wrong, the fastest way to check is usually to push an input to an extreme where you already know the answer. A zero coupon bond must have a duration equal to its maturity. A tariff high enough to stop imports must raise no revenue. If a page violates something that has to be true, it is broken, and I would like to know. The address is on the about page.

Common questions about the models

What does verified mean on this site?

That the model's output has been compared against something computed a different way before the page went up. Usually that means a closed-form formula, a numerical derivative, an accounting identity that has to hold exactly, or a second implementation written separately from the one running on the page. Agreement between two independent routes is evidence. One routine agreeing with itself is not.

Does verification mean the models are right?

No, and the distinction matters. These checks confirm that each model computes its own equations correctly. They say nothing about whether those equations describe the world well. A perfectly implemented model of a bad assumption is still a bad model, which is why every page carries a separate section on what it leaves out rather than resting on the fact that the arithmetic checks out.

Can I use these for a real financial decision?

No. They are teaching models. The personal finance calculators use standard formulas correctly but ignore taxes, fees, and the specifics of any real product, and the simulators deliberately strip out complications to make one mechanism visible. Use them to build intuition and to check the shape of an answer, then talk to somebody qualified about your actual situation.

Why publish the errors instead of just fixing them?

Because a claim that everything is correct carries no information. Anyone can make it, and it is unfalsifiable from the outside. A specific list of mistakes the process caught before publication is evidence the process actually runs, and it tells you what kind of error to look for if you ever find one that got through.