Unit 14, lesson 112

Model validation reproducibility and monitoring

How model validation checks a model through financial invariants and numerical convergence tests, how drift monitoring raises alerts after deployment, and what reproducibility and documented model limitations require.

  • Video 112
  • Differentiation, calibration and validation

A pricing library returns a value with ten decimal places for a trade. What would make that number trustworthy for the decision it supports? Several separate things are needed, namely the right mathematical object for the contract, a calculation that converges to that object, evidence that the inputs and assumptions fit the use, and a way to notice when that evidence stops applying. This lesson separates them with a convergence test for trapezoidal quadrature, a put-call parity invariant and a known-variance drift monitor, and then says what reproducibility and documented model limitations add.

Key terms

Model validation

Definition A financial model is the whole specification behind a number, namely the contract and its payoff, the probability measure and information set, the data and conventions, the calibration, the numerical approximation, the implementation and the intended use. Model validation assesses whether that specification is fit for the intended use, and it asks different questions. Conceptual soundness asks whether the defined mathematical object is the right one for the contract and the decision. Numerical verification asks whether the implementation computes that object to a stated accuracy, for example through convergence tests against independent benchmarks and through invariants. Empirical validation asks whether the inputs and assumptions are supported by evidence for the use, and monitoring asks whether that evidence still applies after deployment. Passing one of these checks answers none of the others. An analytic benchmark can confirm that code solves its equation without showing that the equation describes the market, and an exact solution for a different contract is the wrong value for this one. Supervisory model-risk guidance for banks frames expectations of this kind for the institutions within its scope. Such guidance has a stated scope and is not a theorem about any calculation, and the checks on this page certify neither a real model nor regulatory compliance.

In plain words Before trusting a number, check that it answers the right question, that it is computed accurately, and that the assumptions behind it hold for the use you have in mind. These are separate checks, and the first two can pass while the third fails.

Example In a constructed Black-Scholes setting with S0=100S_0 = 100, K=100K = 100, a continuously compounded rate r=0.05r = 0.05, σ=0.2\sigma = 0.2, T=1T = 1 and no dividends, the European put is worth about 5.57355.5735. An implementation that reproduces this number to many digits passes a convergence test against the closed form. If the traded put can be exercised early, the right object is the American put, which a Cox-Ross-Rubinstein binomial tree with 40004000 steps values at about 6.0906.090. The verified number is then about 0.520.52 below the value of the contract actually traded.

Financial invariant

Definition A financial invariant is a relation that holds exactly for every input in a stated class whenever stated hypotheses hold, as a consequence of the model’s definitions or of the law of one price. Examples are state probabilities that are nonnegative and sum to 11, a covariance matrix Σ\Sigma with w⊤Σw≥0w^{\top}\Sigma w \ge 0 for every weight vector ww, cash flows that are conserved when they are split and recombined, and put-call parity. Take a European call and a European put on the same stock with no dividends before TT, with the same strike KK, maturity TT and settlement, in a frictionless market with deterministic rates and discount factor D(0,T)D(0,T). A long call with a short put pays ST−KS_T - K at TT, and so does one share held with a short position in KK zero-coupon bonds paying 11 at TT, so the law of one price gives

C−P=S0−K D(0,T).C - P = S_0 - K\,D(0,T).

With stochastic rates the same argument holds with the bond price P(0,T)P(0,T) in place of D(0,T)D(0,T). An invariant test computes the residual

ϵ=(C−P)−(S0−K D(0,T))\begin{aligned} \epsilon &= (C - P) \\[0.4em] &\quad - \bigl(S_0 - K\,D(0,T)\bigr) \end{aligned}

and flags ∣ϵ∣\lvert \epsilon \rvert above a tolerance chosen for the units and the use. A failure means that the calculation is wrong or that the hypotheses do not match the instrument, for example because of dividends, early exercise, settlement differences or transaction costs. A pass is necessary and not sufficient, because an error that adds the same amount to both option prices leaves parity intact, and every model that prices both options as discounted expectations under a pricing measure consistent with the stock and bond prices satisfies it, whatever volatility it uses.

In plain words Some relations must hold whatever the parameters are, so a violation exposes an error without knowing the right answer. Each relation comes with conditions, and when they fail the relation can fail for a legitimate reason.

Example Take constructed prices S0=100S_0 = 100, K=100K = 100, D(0,T)=0.97D(0,T) = 0.97, C=8C = 8 and P=5P = 5 in currency units. Both sides of parity equal 33, so ϵ=0\epsilon = 0. Changing only the put to 5.015.01 gives C−P=2.99C - P = 2.99 and ϵ=−0.01\epsilon = -0.01, which any tolerance below 0.010.01 detects. The changed put is a deliberately broken input, not a market observation. Raising both prices by 11, to C=9C = 9 and P=6P = 6, passes the test even though both prices have moved away from the values that were checked.

Numerical convergence test

Definition Let AhA_h approximate an exact value AA, where h>0h > 0 is a resolution parameter such as a step size, and suppose

Ah=A+c hp+o(hp)A_h = A + c\,h^p + o(h^p)

as h→0h \to 0, with c≠0c \ne 0 and p>0p > 0. Then

∣Ah−A∣∣Ah/2−A∣→2p,\frac{\lvert A_h - A \rvert}{\lvert A_{h/2} - A \rvert} \to 2^p,

so the base-2 logarithm of the ratio estimates the order pp. Without the exact value, the ratio of successive differences (Ah−Ah/2)/(Ah/2−Ah/4)(A_h - A_{h/2})/(A_{h/2} - A_{h/4}) has the same limit, and the Richardson combination (2pAh/2−Ah)/(2p−1)(2^p A_{h/2} - A_h)/(2^p - 1) equals A+o(hp)A + o(h^p). A convergence test computes such ratios over a refinement sequence and compares them with the order the method should have. The limit describes the asymptotic regime, and coarse resolutions need not show it yet. Agreement between two implementations that share an assumption or a boundary treatment is weaker evidence than convergence to an independent benchmark. For the composite trapezoidal rule TnT_n with nn intervals of width h=(b−a)/nh = (b - a)/n and an integrand ff with a continuous second derivative on [a,b][a, b],

Tn−∫abf(t) dt=h212(f′(b)−f′(a))+o(h2),\begin{aligned} &T_n - \int_a^b f(t)\,dt \\[0.4em] &\quad = \frac{h^2}{12}\bigl(f'(b) - f'(a)\bigr) \\[0.4em] &\quad\quad + o(h^2), \end{aligned}

so p=2p = 2 whenever f′(b)≠f′(a)f'(b) \ne f'(a). When f′(b)=f′(a)f'(b) = f'(a) the leading term vanishes and the observed order can be higher. Monte Carlo error is a separate component. For nn independent draws with finite variance, the standard error of their mean is the standard deviation of one draw divided by n\sqrt{n}, estimated by the sample standard deviation over n\sqrt{n}. More draws shrink this sampling error but leave the bias from a time step or a truncated domain unchanged, and refining the step does not reduce sampling error. A convergence table and a sampling interval should each say which error they measure.

In plain words One answer cannot show that a method works. Halve the step a few times and check that the error shrinks by the factor the method promises. If it does, the method behaves as designed on this problem. If it does not, something is wrong with the code, with the smoothness of the problem or with the claimed order.

Example For the dimensionless integral of e−te^{-t} over [0,1][0, 1], the antiderivative gives the exact value 1−e−1≈0.63212055881 - e^{-1} \approx 0.6321205588. The trapezoidal estimates with 1010, 2020 and 4040 intervals are about 0.63264723820.6326472382, 0.63225224510.6322522451 and 0.63215348140.6321534814. They lie above the integral because e−te^{-t} is convex, so each chord lies above the curve. The errors are about 5.2668×10−45.2668 \times 10^{-4}, 1.3169×10−41.3169 \times 10^{-4} and 3.2923×10−53.2923 \times 10^{-5}, and the successive ratios are about 3.99953.9995 and 3.99993.9999, so the observed order is 22. The leading term h2(1−e−1)/12h^2(1 - e^{-1})/12 predicts 5.2677×10−45.2677 \times 10^{-4} for h=0.1h = 0.1. The Richardson combination (4T20−T10)/3(4T_{20} - T_{10})/3 has an error of only about 2.2×10−82.2 \times 10^{-8}.

Drift monitoring

Definition Drift monitoring compares quantities observed after deployment, such as inputs, calibration residuals or realized outcomes, with a reference law, using a statistic, a threshold and an action that are all fixed before the new data are seen. For a mean monitor with a known-variance normal reference, assume that under the reference the observations X1,…,XnX_1, \dots, X_n are independent and identically distributed N(μ0,σ02)N(\mu_0, \sigma_0^2) with μ0\mu_0 and σ0\sigma_0 known. Then

Z=X‾−μ0σ0/nZ = \frac{\overline{X} - \mu_0}{\sigma_0/\sqrt{n}}

is exactly standard normal under the reference, and the rule that alerts when ∣Z∣>z∗\lvert Z \rvert > z_{*} raises a false alarm with probability 2(1−Φ(z∗))2(1 - \Phi(z_{*})) per check, about 0.00270.0027 for z∗=3z_{*} = 3. If the observations are dependent, the variance of X‾\overline{X} is not σ02/n\sigma_0^2/n. If the variance is estimated, the statistic with the sample standard deviation in place of σ0\sigma_0 has a Student t distribution with n−1n - 1 degrees of freedom under a normal reference. In both cases the reference calculation has to change. Repeated checks and many monitored quantities raise the chance of at least one false alarm. For KK checks at level α\alpha each, that chance is at most KαK\alpha by the union bound, and it equals 1−(1−α)K1 - (1 - \alpha)^K when the checks are independent. An alert says that the new data are unusual under the reference, not which part of the model is wrong, and the absence of an alert does not show that nothing changed.

In plain words Decide in advance what to watch, what counts as unusual and what you will do about it. Then measure how far the new data sit from the reference in units of their standard error. The threshold sets how often you are alarmed by chance, and that rate grows with the number of things you watch.

Example Take the constructed reference N(0,1)N(0, 1) and samples of n=100n = 100 independent observations, so the standard error of the mean is 1/100=0.11/\sqrt{100} = 0.1. A new sample mean of 0.350.35 gives Z=3.5Z = 3.5, which exceeds the prespecified threshold 33 and triggers an alert. A mean of 0.10.1 gives Z=1Z = 1 and no alert. If the true mean had moved to 0.350.35, the rule would alert with probability Φ(0.5)+Φ(−6.5)≈0.69\Phi(0.5) + \Phi(-6.5) \approx 0.69, so a real shift of that size goes unnoticed with probability about 0.310.31. Watching 10001000 independent quantities with the same rule gives at least one false alarm with probability 1−(1−0.0027)1000≈0.931 - (1 - 0.0027)^{1000} \approx 0.93, and at the level 0.050.05 per check that probability is essentially 11.

Reproducibility

Definition A calculation is reproducible when its record is enough to regenerate the reported result within a stated tolerance. The record covers the input data with their definitions, timestamps, units and conventions, the parameters, the model and code version, the numerical settings such as grids, tolerances and sample counts, the software environment, and the random number generator with its seeds. A seed fixes the output only together with the same generator, the same assignment of random numbers to paths and the same order of floating-point operations, and parallel execution or a software change can alter the last two. Reproducibility is not correctness. Rerunning a calculation exactly reproduces its mistakes exactly, so it is paired with independent challenge, a review of whether the contract, the data, the derivation and the numerical method fit the intended use.

In plain words Write down everything needed to get the same number again, so that any disagreement can be traced to a specific input, setting or code change. Getting the same number twice shows that the record is complete, not that the number is right.

Example In double-precision arithmetic, (0.1+0.2)+0.3(0.1 + 0.2) + 0.3 evaluates to 0.60000000000000010.6000000000000001 while 0.1+(0.2+0.3)0.1 + (0.2 + 0.3) evaluates to 0.60.6. A parallel sum of Monte Carlo payoffs whose order depends on the number of threads can therefore change in its last digits with the seed held fixed, so the record should state a tolerance as well as a seed. In the other direction, a pricing run that leaves out a dividend reproduces the same wrong price on every rerun, and only a review of the assumptions finds the error.

Model limitations

Definition The model limitations are the documented boundaries of the evidence for a model’s use. They state the hypotheses under which the outputs hold, the range of inputs and instruments the validation covered, the numerical accuracy achieved and the conditions under which it was shown, known weaknesses of the data, known failure modes, and the monitoring signals and actions that apply near those boundaries. Each check supports the use only where its hypotheses hold, so each hypothesis of a passed check is a candidate limitation.

In plain words Every test on this page passed under conditions. Writing those conditions down tells a user where the evidence stops, so that the model is not quietly applied to cases nobody checked.

Example The second-order behavior of the trapezoidal rule rests on a continuous second derivative. For the digital integrand 1{t>1/3}\mathbf{1}_{\{t > 1/3\}} on [0,1][0, 1], whose exact integral is 2/32/3, the estimates with 1010, 2020 and 4040 intervals have errors −1/60-1/60, 1/1201/120 and −1/240-1/240, about −0.01667-0.01667, 0.008330.00833 and −0.00417-0.00417. The absolute error only halves at each refinement, so the observed order is 11, and the sign alternates. A tolerance justified by the smooth test does not carry over to a digital payoff. In the same way, the parity check covers European options without dividends before maturity, and for American options only inequalities remain.

Check yourself

  1. A pricing library returns C=3.10C = 3.10 and P=4.00P = 4.00 for a European call and put on a stock without dividends, with S0=50S_0 = 50, K=52K = 52, a common maturity and D(0,T)=0.98D(0,T) = 0.98, in constructed currency units. Compute the parity residual. Does it say which price is wrong, and would a residual of zero show that both are right?
Show the answer

The right side of parity is 50−52⋅0.98=50−50.96=−0.9650 - 52 \cdot 0.98 = 50 - 50.96 = -0.96, and the left side is 3.10−4.00=−0.903.10 - 4.00 = -0.90, so the residual is ϵ=−0.90−(−0.96)=0.06\epsilon = -0.90 - (-0.96) = 0.06. It shows that the two prices are inconsistent with each other under the stated hypotheses, or that the hypotheses do not fit the instruments. It does not say which price is off, since lowering the call by 0.060.06 and raising the put by 0.060.06 would each remove it. A zero residual would not show that both prices are right, because adding the same amount to both leaves C−PC - P unchanged. If the stock paid a dividend before maturity, the relation itself would change, and a nonzero residual against the formula without dividends would not by itself indicate an error.

  1. A deterministic lattice pricer gives 10.2610.26, 10.12510.125 and 10.0612510.06125 with 5050, 100100 and 200200 time steps, in constructed currency units. Estimate the observed order without an exact value and form a Richardson estimate. Separately, a Monte Carlo pricer with a fixed time step is run with 10,00010{,}000 and then 40,00040{,}000 paths, and its standard error halves. Does its time-step error shrink?
Show the answer

The successive differences are 10.26−10.125=0.13510.26 - 10.125 = 0.135 and 10.125−10.06125=0.0637510.125 - 10.06125 = 0.06375, with ratio about 2.1182.118, so the observed order is about log⁡22.118≈1.08\log_2 2.118 \approx 1.08, close to first order. With p=1p = 1 the Richardson estimate is 2⋅10.06125−10.125=9.99752 \cdot 10.06125 - 10.125 = 9.9975. Four times as many paths halve the standard error, since 1/4=1/21/\sqrt{4} = 1/2, but they leave the bias of the time step unchanged, because that bias belongs to the discretized model and not to the sample. Only refining the time step, or extrapolating in it, reduces that bias, and a report should give both error components.

  1. A drift monitor uses the reference N(0,1)N(0, 1) with known variance, samples of n=64n = 64 observations and the threshold ∣Z∣>3\lvert Z \rvert > 3. A new sample has mean 0.40.4. Compute the statistic and decide. Then suppose the observations actually follow a stationary Gaussian autoregression with marginal variance 11 and correlation ρk\rho^k at lag kk, where ρ=0.5\rho = 0.5. Is the alert still justified, and what is the false alarm rate of the original rule?
Show the answer

The standard error under the reference is 1/64=0.1251/\sqrt{64} = 0.125, so Z=0.4/0.125=3.2Z = 0.4/0.125 = 3.2, which exceeds 33 and triggers an alert under the independent reference. Under the autoregression,

Var⁡(X‾)=vnn,vn=1+2∑k=1n−1(1−kn)ρk,\begin{gathered} \operatorname{Var}(\overline{X}) = \frac{v_n}{n}, \\[0.4em] v_n = 1 + 2\sum_{k=1}^{n-1}\Bigl(1 - \frac{k}{n}\Bigr)\rho^k, \end{gathered}

and for n=64n = 64 and ρ=0.5\rho = 0.5 the factor is v64≈2.9375v_{64} \approx 2.9375, close to the large-sample value (1+ρ)/(1−ρ)=3(1 + \rho)/(1 - \rho) = 3. The correct standard error is about 2.9375/64≈0.214\sqrt{2.9375/64} \approx 0.214, and the correctly standardized mean is about 1.871.87, below the threshold. The alert came from the wrong reference rather than from evidence of drift. Under this dependence the original statistic has variance v64v_{64}, so the original rule raises a false alarm with probability 2(1−Φ(3/2.9375))≈0.0802\bigl(1 - \Phi(3/\sqrt{2.9375})\bigr) \approx 0.080 per check instead of 0.00270.0027.

How this lesson connects