QQuant, Built

Act VII · The System

Part 40 of 43

Measuring Risk

Undergraduatestarts at this level59 min of film 13 chaptersprerequisites: Part 7, Part 20

A bank reports that it will lose more than ten million dollars on one day in a hundred. How would you check a number like that?

A risk measure is a forecast, and forecasts can be scored. Value at risk is computed three ways (a normal assumption, history, a volatility-filtered history) and each is backtested: do exceptions happen as often as promised, and do they come alone or in clusters? Expected shortfall is what you lose when the bad day comes; it is coherent where VaR is not, and harder to backtest. Extreme value theory fits the tail beyond the data, copulas describe losses that arrive together, stress tests ask the question history has not asked yet. The regulatory chapter follows these ideas into the Basel rules.

What you need. Parts 7 and 20.

What you will be able to do

Undergraduate

  • Define value at risk and expected shortfall and compute both from a sample of returns.
  • Explain why diversification can fail to reduce VaR, and what a stress test is for.

Master's

  • Forecast VaR by historical, filtered-historical and parametric methods and backtest with Kupiec's and Christoffersen's tests.
  • Fit a generalized Pareto tail; measure tail dependence; fit a quantile model by pinball loss.

PhD

  • Explain elicitability: why VaR has a consistent scoring function, expected shortfall alone has none, and the pair has one (Fissler and Ziegel); bound VaR under dependence uncertainty.

Industry

  • Explain the Basel traffic light, the move from VaR to expected shortfall, and liquidity horizons.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 21 min · Master's 48 min · PhD 59 min · Industry 29 min.

  1. 0Ten-day VaR from one-dayUndergraduate3 min
  2. 1Value at risk, three waysUndergraduate6 min
  3. 2Coherent risk measuresUndergraduate4 min
  4. 3BacktestingMaster's5 min
  5. 4Extreme value theoryMaster's5 min
  6. 5Dependence and copulasMaster's4 min
  7. 6Stress testsUndergraduate4 min
  8. 7Model uncertaintyPhD4 min
  9. 8Learned riskMaster's4 min
  10. 9Regulation and liquidityIndustry4 min
  11. 10Rule 40: a risk number is a forecastIndustry3 min
  12. For the researcher: what can be backtested?PhD8 min
  13. Recap, desk questions, problemsAll tracks4 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.

Ten-day VaR from one-dayUndergraduate3 min

Part forty. Measuring risk: the numbers a firm uses to say how much it could lose, how to make them, how to check them, and what they cannot see. The first part of Act seven, the system.

A desk question. Your ninety-nine percent one-day value at risk is ten million dollars. A chosen horizon exercise asks for ten days. Root ten gives about thirty-two million only for zero-mean independent Gaussian additive daily losses with constant variance. A nonzero mean adds linearly. The cached historical exercise sums ten simple daily returns, rather than compounding wealth; its ratio is 3.4. That descriptive comparison neither identifies clustering as the sole cause nor certifies a regulatory capital number.

What this part measures. The normal forecast has 2.24 percent exceptions against one percent. Selected GJR-filtered tests do not reject, but filtering initialization uses part of each refit segment, so this is not a fully past-measurable forecasting certificate. Expected shortfall is not elicitable alone on the class shown: no strictly consistent standalone score exists. That is different from being impossible to backtest; joint scores and calibration tests answer different questions. A finite-grid Pareto rearrangement estimate is 1.7 times the sum of individual VaRs, showing dependence sensitivity without certifying a global optimum.

Why it matters. Risk numbers set capital: banks' trading capital, clearing houses' margins, funds' limits. Wrong one way and the firm is fragile, wrong the other and it is idle. They failed in public in twenty oh seven and oh eight, with exceptions in clusters and losses many times the stated VaR, as reported. And every desk the House has built now needs a limit, which is a risk number someone must defend.

Three things a risk number is not. It is not a worst-case bound: a correctly calibrated continuous ninety-nine percent VaR has one percent exceedance probability, with no promised maximum severity. Atoms can make strict exceedance less frequent. It depends on positions, horizon, valuation and the forecast distribution; another model or window can give a different number. One market-risk quantile does not exhaust liquidity, custody, legal or systemic risks.

Where this sits. Act six built every trading desk. Act seven steps back to the system: this part measures risk, Part forty-one follows leverage and liquidity into crises, Part forty-two lets machines into the market, and Part forty-three asks whether any of it beats the market.

Seventy years. Andrew Roy's safety-first rule of nineteen fifty-two; the extreme-value theorems of the seventies; Kent Osband's thesis on eliciting; and J.P. Morgan's RiskMetrics. Then Basel's VaR, coherent risk measures, McNeil and Frey's GARCH with an extreme tail, and CAViaR. Then the crisis, Gneiting's elicitability, the move to expected shortfall in FRTB with Fissler and Ziegel's joint score, and its practical form.

The plan: value at risk three ways; coherence and expected shortfall; backtests; tails and dependence; stress tests and model uncertainty; learned risk models; regulation and liquidity; and the theory of what can be backtested, proved.

In the House, the risk function takes over the evening report for every desk, and starts by asking how it would know if its own numbers were wrong.

1Value at risk, three waysUndergraduate6 min

Since the nineteen nineties, banks have summarised market risk in one number: the loss they do not expect to exceed, on a given day, with a given confidence. This chapter defines it, estimates it three ways, and shows where the estimates disagree.

The definitions. Work in losses, L equals minus the modeled return, or a dollar loss after valuation. VaR is the generalized alpha quantile, with strict exceedance probability at most one minus alpha. Equality needs appropriate continuity. Expected shortfall averages upper-tail quantiles. For continuous losses it equals the tail conditional mean; at an atom one takes only the probability mass needed to complete the tail. Thus a correct continuous ninety-nine percent VaR has one percent exceedance probability, not a guaranteed calendar count.

A Student t illustration with four degrees of freedom and unit scale; its standard deviation is root two, not one. The ninety-nine percent quantile is 3.75. The axis shows a finite range, so the shading displays only the visible part of an unbounded tail. Expected shortfall of the complete modeled tail is 5.22; it is not the center of mass of just the truncated shaded segment. The location can change with tail shape even when the selected quantile is held fixed.

RiskMetrics launched in nineteen ninety-four, with a J.P. Morgan and Reuters technical document in nineteen ninety-six. Its daily EWMA variance illustration uses lambda nought point nine four and yesterday's squared return. With a zero-mean normal return and a compatible linear dollar exposure, ninety-nine percent loss VaR is about two point three three standard deviations times position. A nonzero mean adds a separate location term. The historical Basel market-risk framework allowed eligible internal models under additional approval, testing and capital conditions; this formula alone does not establish compliance.

Three estimators. A parametric model fits a distribution and reads its quantile. Historical simulation applies a selected window of returns to today's exposure and interpolates a sample quantile; it is not literally the fifth worst observation here. Its empirical distribution and window are assumptions. Monte Carlo approximates a model's loss distribution, useful for nonlinear valuation, but neither simulation nor a larger draw count removes model error.

A hundred million dollars in the American stock market at the end of twenty oh seven, from the five hundred days before. The normal says a VaR of 1.9 million; historical simulation, 2.5. A fitted Student t, whose degrees of freedom come out near 3, and its Monte Carlo agree on VaR with history but put expected shortfall far higher, 3.6 million. And RiskMetrics, reacting to the volatility of that autumn, says 2.8. Five honest methods, and a spread of almost half the number.

The same position on the fifteenth of October twenty oh eight. The five-hundred-day methods still see mostly calm: a normal VaR of 3.4 million, history 4.2. RiskMetrics, with volatility at 68 percent a year, says 10.0. That day the market lost 8.8 percent: 8.8 million on the position. Only the method that forgets the past quickly came close.

The horizon exercise. Root-ten scaling is exact for zero-mean independent Gaussian additive daily losses with constant variance. With daily mean mu and standard deviation sigma, ten-day loss VaR is minus ten mu plus root ten times sigma times the normal quantile. The one-day empirical VaR is 3.07 percent, whose root-ten scale is 9.71. The cached overlapping ten-day arithmetic-sum quantile is 10.46. This omits compounding and uncertainty bands; the gap alone does not identify volatility clustering or a structural cause.

The ratio changes across selected decades. The nineteen-seventies arithmetic-sum quantile is 1.34 times its root-ten scale. The nineties ratio is 0.89. These descriptive values mix sampling error, marginal tails and dependence. We have not computed an autocorrelation decomposition or a counterfactual that attributes the gap to rebounds or clustering. Root-time scaling can overstate as well as understate a chosen empirical horizon quantile.

A chosen short-straddle example. One thousand at-the-money straddles are initially delta hedged, making the linear spot-only VaR zero. The quadratic spot term gives 729 dollars. Full Black--Scholes revaluation gives 615, but also includes a day of maturity decay that the quadratic approximation omits. Their difference is not solely a gamma-approximation error. Raising implied volatility by five points on every simulated path gives 1,601. This is a chosen stress, not a fitted joint spot-volatility forecast or an executable loss guarantee.

What the number is. It says that on ninety-nine days in a hundred, under the model, the loss will be smaller. It does not say how large the hundredth day's loss will be, whether the model is right, or what happens if the position cannot be sold in a day. It lasted because it is one number that a board can read and that can be checked against the days that follow. The next two chapters ask whether it should be added up, and how to check it.

Pause and predict. Two bonds each lose a hundred dollars with probability four percent, independently, and nothing otherwise. Each has a ninety-five percent VaR of zero. What is the ninety-five percent VaR of holding both?

2Coherent risk measuresUndergraduate4 min

And the answer to the pause: 100 dollars. The chance that at least one bond defaults is 7.84 percent, more than five, so the portfolio's VaR is a full default, while each bond alone shows zero. Diversifying made the reported risk appear from nothing.

The numbers. Each bond alone: a VaR of zero, because a default is rarer than one day in twenty; an expected shortfall of 80. Added up, a VaR of zero. Held together, a VaR of 100. Expected shortfall goes the other way: 103.2 together, less than the 160 of the sum. One measure punishes diversification; the other rewards it.

Philippe Artzner, Freddy Delbaen, Jean-Marc Eber and David Heath asked what a risk measure should satisfy, and called the answer coherence. A sure extra loss adds exactly that much capital. Twice the position, twice the risk. A position that always loses more is riskier. And merging never creates risk: the firm's capital is at most the sum of its desks'.

VaR satisfies translation, nonnegative scaling and monotonicity. Quantiles preserve those properties. Subadditivity fails in examples such as the independent default bonds. It holds for linear losses from a jointly elliptical family when the scale coefficient is nonnegative and the means exist; merely fitting separate normal or t marginals is insufficient. Splitting a book can then reduce summed reported VaRs without reducing the underlying joint loss distribution.

Expected shortfall uses an integrable loss and the integrated-quantile definition. It averages all upper quantiles, splitting any atom at the cutoff. Its dual takes a supremum over probability measures absolutely continuous with respect to the reference measure, with nonnegative density integrating to one and bounded by one over one minus alpha. Each expectation is linear and the same density class applies to both positions, so the supremum is subadditive. Translation, homogeneity and monotonicity follow too.

For a normal loss, ES is its mean plus sigma times the normal density at the quantile divided by tail probability. At ninety-nine percent the zero-mean coefficient is about two point six six five, versus two point three two six for VaR. At ninety-seven and a half percent the ES coefficient is about two point three three eight. That is close to ninety-nine percent normal VaR, not identical. A universal inequality across different confidence levels does not follow merely from calling a distribution fat tailed.

The family behind it. Carlo Acerbi's spectral measures weight every quantile. They are coherent exactly when the weights rise toward the worst outcomes, a risk aversion written as a function. Expected shortfall weights the tail equally and ignores the rest; VaR, a single point, is not in the family at all.

Convex monetary risk measures relax positive homogeneity while retaining monotonicity and cash translation. Convexity rewards mixing; scaling up a position can raise risk more than proportionally. On a specified function space with the appropriate lower-semicontinuity or Fatou property, a dual representation uses scenario expectations minus a penalty. Entropic risk is one example when the exponential moment exists; its penalty is relative entropy divided by risk aversion. These domain and regularity conditions matter.

Euler allocation requires conditions. Degree-one homogeneity plus differentiability gives risk equal to the sum of position times marginal risk; coherence alone does not guarantee derivatives. In a chosen zero-mean Gaussian two-factor example, use the displayed positive-definite covariance and unit weights. Portfolio variance is nought point nought nought nought six. Marginal ES shares are twenty-five and seventy-five percent, from each weighted covariance divided by portfolio variance. Both contributions use this same chosen book. The omitted historical extra output is not replaced by another fit; atoms and nondifferentiable books need appropriate boundary weights or subgradients.

Which measure serves which task? VaR is a quantile with direct exception diagnostics, but is not generally subadditive. Integrated-tail ES is coherent for integrable losses and sensitive to severity. Non-elicitability alone means no strictly consistent standalone score on the class considered; it does not rule out backtesting. Basel's twenty-sixteen standard specified ninety-seven-and-a-half percent ES and retained VaR diagnostics. Later revisions and local implementation differ; this is historical methodology, not a current compliance certification.

Pause and predict. A ninety-nine percent VaR model was used for two hundred and fifty days and exceeded on seven of them. Is the model wrong? How would you decide, and what would you look at besides the count?

3BacktestingMaster's5 min

Seven exceptions in two hundred and fifty days place the historical Basel traffic light in yellow. A coverage likelihood ratio uses a chi-square approximation and can reject at five percent, but sparse counts make finite-sample calibration relevant. Non-rejection would not prove the model correct. We also inspect timing: a correct conditional continuous quantile implies unpredictable hits relative to the forecast information set, not merely an acceptable unconditional total.

A forecast can be checked. Each day the loss either exceeds the forecast made the evening before or it does not: the hit sequence. If the forecast is right, hits are independent coin flips with probability one minus alpha. Paul Kupiec's test compares the promised rate with the observed one by a likelihood ratio, as Parts two and twenty-one did.

Regulators turned the count into a traffic light. Over two hundred and fifty days, up to four exceptions is green, and capital is three times the model's VaR. Five to nine is yellow, with a rising multiplier. Ten or more is red: the multiplier is four and the model is reviewed.

Peter Christoffersen added the timing. Treat the hits as a two-state Markov chain: the chance of an exception after a quiet day, and after an exception. A correct forecast makes them equal: yesterday's hit tells you nothing. Adding the two likelihood ratios tests the count and the timing together.

Six reported forecasters, with 24,396 observations each. Normal exceptions are 2.24 percent and follow an exception 12 percent of the time; history and RiskMetrics also reject selected tests. GJR filtering reports 0.88 percent with neither coverage nor first-order independence rejected at five percent. This does not establish calibration at every horizon or independence beyond one lag. More importantly, the unchanged filter initializes each refit variance with a segment that includes some evaluation returns. These are descriptive implementation comparisons, not strictly past-measurable validation. EVT reports 0.69 percent, which the two-sided coverage test rejects on the conservative side.

Where the failures come from. Through twenty oh eight, the five-hundred-day normal VaR barely moves while the losses grow: its exceptions arrive in bunches, in September and October. The GARCH-filtered forecast rises with volatility within days, and the losses mostly stay under it. A risk number must forget the calm quickly enough to see the storm.

Calendar-year exception counts. The normal series peaks in 2008, with 28 exceptions. The filtered series is smaller in many years, but the dashed two-and-a-half line is only the expectation for exactly two hundred and fifty trials. Calendar years and the first partial year have different lengths. Sparse yearly outcomes do not prove equal crisis and calm calibration, and the filter initialization caveat still applies.

The historical traffic-light thresholds applied descriptively to calendar years. Normal has 22 red calendar years out of 93. GJR has 1 red and 6 yellow. These are not the regulatory rolling two-hundred-and-fifty-day windows. Their unequal lengths and the filter initialization prevent a regulatory pass claim or a direct probability statement about model luck.

The shortfall diagnostic. Z two averages loss times the VaR-hit indicator divided by the ES forecast and tail probability, then subtracts one. Under correct continuous conditional VaR and ES, suitable integrability and a nonzero ES denominator, its expectation is zero. Realized values fluctuate; a positive statistic can reflect either quantile or tail-severity error. In this sample-size experiment, simulated iid normal and t-four null critical values are 0.11 and 0.12. Similar values in two models are not a distribution-free theorem. The normal statistic is +1.92; negative filtered statistics do not establish correctness or rule out overconservatism.

Three lessons. At one percent, two hundred and fifty correctly calibrated continuous observations have two and a half expected exceptions, so sparse-count tests can have low power. The exact power depends on the alternative. Check dependence as well as coverage; first-order timing tests do not exhaust all serial patterns, and there is no universal ordering of which test rejects first. Two-sided tests can reject overconservative as well as aggressive quantiles. Capital cost and model calibration are related but distinct evaluation criteria.

Pause and predict. The American market's worst day since nineteen twenty-six was a loss of about seventeen percent. Under a normal distribution fitted to all those days, how often should a day like that happen?

4Extreme value theoryMaster's5 min

And the answer to the pause: the nineteenth of October nineteen eighty-seven was 16 standard deviations. Under the normal, a day like that has a probability of about ten to the minus 59: once in ten to the 56 years, against a universe fourteen billion years old. The normal is not wrong in the tail; it is not even close.

The data reject a simple Gaussian-tail description, without proving one universal tail law. Daily-market excess kurtosis is 16.7. The largest observed daily loss is 17.4 percent, far out under a fitted Gaussian benchmark. A positive-shape generalized Pareto model motivates power-tail extrapolation. Lognormal, mixtures and other non-Gaussian models can also have heavy-looking finite samples, so kurtosis or one crash alone does not establish regular variation. Threshold choice and uncertainty remain part of the answer.

Peaks over threshold uses a limiting theorem. If the parent distribution lies in a generalized-extreme-value maximum domain of attraction, the conditional excess law approaches a generalized Pareto law with threshold-dependent scale as the threshold approaches the upper endpoint. The approximation is not guaranteed for every distribution or finite cutoff. Positive shape gives a regularly varying power tail, zero an exponential-type limit, negative a finite endpoint. Estimation with dependent observations needs additional mixing or clustering treatment; the marginal theorem itself is not a blanket iid requirement.

Peaks over threshold, on the American market. Take the threshold at the ninety-fifth percentile of daily losses, 1.55 percent, and keep the 1,244 days beyond it. Fit the generalised Pareto to their excesses: xi of 0.20. A tail exponent of about 5. And the fitted tail gives quantiles, and shortfalls, beyond any day in the data.

How well it fits. On logarithmic scales, the share of exceedances beyond each loss: the data fall along a slightly curving line. The fitted Pareto follows them out to the nineteen eighty-seven crash, the single point at the end.

Threshold choice trades data against approximation. A lower cutoff supplies more excesses and can add bias. A higher cutoff leaves fewer observations, so dependence and sampling variability matter. The combined extra original was blocked and returned no approved output. Its historical sweep is omitted, without retry or substitute fit. A future authorized analysis would inspect shape stability and uncertainty; apparent stability alone would not prove a tail law.

Model extrapolation beyond observed losses. At ninety-nine percent the fitted EVT VaR is 3.1 percent and the historical estimate 3.1, compared with normal 2.5. At ninety-nine point nine nine percent, the nominal exceedance rate is one in ten thousand trading days, about forty years at two hundred and fifty-two days a year. EVT gives 11.7 percent VaR and 15.2 percent ES. Only a few observations inform this region, and no confidence interval is computed here. Fitted positive-shape tails increasingly diverge from Gaussian extrapolation; the data do not prove either limiting model.

Hill estimates a power-tail exponent using the k largest positive losses relative to the next order statistic, the k-plus-first cutoff in this implementation. That convention differs from dividing by the kth largest value. It presumes a positive regularly varying tail and suitable asymptotic threshold growth. The cached estimate is 3.4 at one hundred observations and 2.2 at sixteen hundred. Drift across k signals threshold sensitivity and a bias-variance tradeoff. These estimates do not establish finite variance or other population moments from one sample.

Cross-market tail comparisons require aligned definitions. A simple daily US return and a Bitcoin log return use different transformations and sample spans. Differences in a fitted shape can reflect threshold and sampling uncertainty rather than an identified population ordering. The combined extra output is unavailable, so no Bitcoin tail table or substitute historical fit is presented. A successful finite fit would still not establish an exact asymptotic exponent or moment boundary.

McNeil and Frey's conditional tail approach assumes a return location plus volatility times a standardized shock. Volatility filtering aims to remove changing scale; it does not guarantee independent residuals. Fit a generalized Pareto model to high residual losses. In positive-loss convention the quantile is minus location plus volatility times the quantile of minus the shock, not plus the return mean. The cached implementation omits the time-varying location term in its final forecast, uses periodic fits and has the initialization limitation already stated; it is an illustrative implementation rather than a certified reproduction.

Three cautions. Threshold choice trades approximation bias against sampling noise. The marginal excess theorem differs from dependent-sample inference; residual clustering, mixing assumptions or declustering can matter even after filtering. Extrapolation remains a model assumption with uncertainty. No interval calculated in this lecture certifies a remote-tail probability or a universal moment boundary.

Pause and predict. Bank stocks and insurance stocks have a daily correlation of about nought point eight. A Gaussian model says that on banks' worst one percent of days, insurers have their own worst one percent about forty percent of the time. What do the data say?

5Dependence and copulasMaster's4 min

And the answer to the pause: 67 percent. On banks' worst days, insurers had their own worst day 67 percent of the time, where a Gaussian model with the same correlation says 40. The model gets the average relationship right and the crashes wrong.

Paul Embrechts, Alexander McNeil and Daniel Straumann's pitfalls of correlation. Zero correlation is not independence. Not every correlation is possible: for lognormal marginals with very different volatilities, the attainable range is narrow. And correlation does not fix the tail: the same marginals and the same correlation can give very different chances of crashing together.

Separate the two. Abe Sklar's theorem: any joint distribution is its marginals glued together by a copula. The copula is the dependence with the marginals removed. The Gaussian copula, Part twenty's credit model. And the Student t copula, with the same correlation parameter but a tendency to produce extremes together.

A chosen finite sample with uniform marginals. Nine hundred Gaussian-copula points use latent correlation nought point seven. The t-copula points use the same latent correlation and three degrees of freedom. Count the observed five-percent red-corner points: this particular seed has nineteen Gaussian and seventeen t points. That finite random ordering does not contradict the distinct asymptotic tail coefficients, and the illustration does not estimate an expected joint frequency precisely. It would be wrong to claim this sample must contain more t-copula corner points.

Tail dependence is a limiting conditional probability. Given one uniformized variable lies below q, ask the chance the other does too as q tends to zero. For a nonsingular Gaussian copula with correlation strictly between minus one and one, this limit is zero. That does not make finite-threshold joint extremes impossible. A t copula with finite degrees of freedom has the displayed positive limit. A one-percent empirical conditional frequency is a finite-threshold statistic, not an estimate known to have reached that limit.

In the data: Kenneth French's industries, every day the forty-nine all trade, from nineteen sixty-nine. Banks and insurers: 0.67 in the data against the Gaussian's 0.40. Oil and mining: 0.52 against 0.23, less than half. In every pair, joint crashes are more common than the Gaussian copula allows; the t copula's limit is closer, though a finite sample at one percent is not yet the limit.

A copula sensitivity exercise must say what is held fixed. Match marginal distributions, units, portfolio weights and confidence. A Gaussian and a t copula can use the same latent correlation parameter without yielding the same Pearson correlation after nonlinear marginal transformations. A finite-threshold portfolio expected shortfall is also different from an asymptotic conditional tail limit. The combined extra output was not approved, so its simulated portfolio comparison is omitted rather than reconstructed from another historical fit or simulation.

Conditioning changes the population being measured. Average pairwise industry correlation is 0.56 over all eligible days. On selected worst-market-five-percent days it is 0.51. That conditional correlation estimates a different, truncated population. Selection can change correlation even with fixed structural dependence, but these two numbers do not identify the entire gap as bias or prove a structural change. Conditional correlation and finite-threshold joint-tail frequencies answer different questions.

The credit application illustrates model scope. A one-factor Gaussian default construction often uses a latent correlation parameter, not simply the Pearson correlation of default times. Zero asymptotic tail dependence does not imply riskless senior tranches: finite default probabilities, recovery, correlation, concentrations and tranche attachment all matter. A crisis narrative cannot be attributed to one asymptotic coefficient. The practical task is to examine joint-loss assumptions and stress alternative dependence structures.

Three lessons. Model the tail of the joint distribution, and test it on joint exceedances, not on correlations. Diversification measured on all days is smaller on the days it is wanted. And dependence is itself uncertain: Chapter seven asks how bad VaR can get when nothing is known about it.

Pause and predict. A portfolio's daily volatility is one point two million dollars. What is the most plausible move of its risk factors that would cost it ten million in a day, and how many standard deviations away is that move?

6Stress testsUndergraduate4 min

Chapter six illustrates a zero-centered linear-factor reverse stress. A ten-million-dollar loss has minimum Mahalanobis distance 8.2, with a market move 8.8 percent and the displayed factor tilts under the chosen covariance. The direction is proportional to minus covariance times portfolio weights. Calling it most plausible additionally assumes a suitable elliptically decreasing density. A daily dollar volatility of one point two million in the preceding chosen question gives a distance about eight point three, while this cached factor book has its own precisely reported volatility.

Why a second kind of number. VaR is a quantile of a model fitted to the recent past, silent about what the window never saw. A stress test names the event and revalues today's positions under it. And a reverse stress test asks the opposite question: what is the most likely scenario that would cost a given amount?

Historical factor replays on a fixed market-plus-size-plus-value book. Nineteen eighty-seven gives 13.8 million dollars and Mahalanobis distance 18.8. October twenty oh eight gives 8.3 million; March twenty twenty gives 12.5. The distance matrix is estimated using nineteen ninety through twenty twenty, so the nineteen-eighty-seven comparison is retrospective. Distance is not a univariate normal tail probability, and these replays do not establish what a historical VaR forecast called impossible.

A chosen two-day path shows why horizon conventions matter. A gain of ten percent followed by a loss of ten percent sums to zero, but compounded wealth falls one percent. The approved square-root exercise uses overlapping arithmetic sums of simple returns. Overlap creates sampling dependence, and the statistic is not a buy-and-hold ten-day wealth quantile. The combined extra original returned no approved historical worst-window ranking, so that table is omitted without a substitute fit. A worst observation, a tail quantile and a chosen stress scenario answer different questions.

Regulators turned scenarios into policy. Since America's first supervisory stress test of twenty oh nine, they publish severe scenarios each year and ask whether banks keep enough capital through them. The scenarios are macro paths plus a market shock, and the results set capital buffers and limit dividends. But a scenario chosen by committee tests what someone imagined, and the next crisis is usually a different one.

Reverse stress testing, as a formula. Find the factor move closest to the centre, measured in the covariance's own metric, that costs the portfolio exactly L. Lagrange's condition makes it proportional to sigma w: every factor moves in proportion to its covariance with the portfolio. And its distance is the loss divided by the portfolio's standard deviation.

The fixed linear portfolio has daily dollar volatility 1.22 million under the selected covariance. A ten-million-dollar loss has minimum Mahalanobis distance 8.2 with market move -8.8 percent and the displayed factor moves. This is a geometric optimum for a zero-centered quadratic metric, not an unconditional probability statement. It is a maximum-density route only under an appropriate elliptically decreasing density. History can lie farther from the covariance center without contradicting the constrained minimization.

And the dual question. Gerold Studer's maximum loss: the worst loss over every scenario within k standard deviations, k times the portfolio's own deviation for a linear book. At three, about 3.7 million. With options the loss bends, and the worst point on the ellipsoid must be found by revaluing the book everywhere on it.

What stress tests leave out. In a crisis the covariance that defines plausibility is itself different. A one-day scenario assumes the book can be closed at the shocked prices. And forced sellers move prices further, the spirals of Part forty-one, which no static scenario contains.

Pause and predict. Three losses each have a ninety-nine percent VaR of nine, with Pareto tails of exponent two. Nothing is known about how they depend on each other. How large can the ninety-nine percent VaR of their sum be?

7Model uncertaintyPhD4 min

Chapter seven revisits the chosen Pareto example. The lower-grid rearrangement estimate is 46, about 1.7 times the comonotonic sum of VaRs. This is a finite-grid heuristic output, not a certified global worst-case value. Comonotonicity is one particular dependence structure, and need not maximize VaR. A separate analytic sum-of-ES bound remains valid for these integrable marginals.

The problem. Each loss's own distribution can be estimated from its own data. How they depend on each other, especially in the tail, often cannot. So ask for the worst VaR of the sum over every possible dependence: a bound that holds whatever the copula.

The rearrangement method is a numerical dependence exercise. Discretize the upper tail of each known marginal into columns. Reorder a column against the sum of the others, cycling until stabilization or an iteration cap. The minimum row sum is a candidate based on that discretization. The unchanged implementation uses two grids, a capped final upper quantile and at most two hundred passes. It does not prove a global optimum or certified lower and upper bounds for the continuum VaR supremum.

A six-quantile illustration of three chosen Pareto marginals. Initially columns share the same order: the minimum row sum is their comonotonic cutoff value. Each alternating pass reorders a column against the other columns' sum. Large entries spread across rows and the reported minimum can rise. This demonstrates the heuristic's operation; it neither proves global convergence nor converts a finite set of tail quantiles into a certified continuum VaR maximum.

The reported Pareto exercise uses one thousand tail quantiles. At exponent three, simulated independence gives 6.9, comonotonicity 10.9, and the lower-grid rearrangement estimate 16.2. At exponent one and a half, that estimate is 2.0 times the comonotonic value. Agreement of two heuristic grids does not certify the continuum optimum, and a Monte Carlo independent quantile has its own error. The analytic sum-of-ES bound is a separate rigorous statement for integrable losses.

Expected shortfall is better behaved again. Because it is subadditive and adds up exactly when losses move together, its worst case over all dependence is just the sum of the individual shortfalls. And since VaR never exceeds ES, that sum also bounds the worst VaR. Coherence buys a usable bound.

Across risk types, adding VaRs produces a comonotonic benchmark under the stated quantile conditions, not a safe upper bound under arbitrary dependence. Across desks, diversification depends on a common valuation, horizon and joint loss model. An analytic sum-of-ES bound requires integrable marginals and uses the same confidence. Report those rigorous assumptions separately from a grid rearrangement estimate, and from any approved firm-wide risk limit.

And even with the model right, there is estimation error. An empirical quantile's standard error is the binomial one divided by the density, and the density is low in the tail. For historical simulation's ninety-nine percent VaR on five hundred normal days, about 7 percent of the VaR itself. Expected shortfall, averaging the five worst points, is noisier still, and fat tails make both worse.

A chosen model-change review. Suppose a new model reports less risk. First hold positions, prices, horizons and loss conventions fixed. Independently check timing, units, initialization and formulas, rather than inferring improvement from a lower charge. Then compare calibration, uncertainty and stress sensitivity under a declared evaluation design. This is a governance illustration, with no unverified claim about a particular institution or an approved production deployment.

Pause and predict. A neural network is trained to forecast tomorrow's one percent quantile of American returns from recent volatility, on nineteen twenty-six to ninety. Will it beat a GARCH-filtered forecast on the thirty years after?

8Learned riskMaster's4 min

Chapter eight compares a frozen quantile network with adaptive benchmarks on nineteen ninety-one through twenty twenty. Its average pinball loss is 3.59 basis points versus 3.41 for GJR-filtered history, and its exception rate is 1.31 percent. This one seeded run does not show that learned risk models generally lose. The comparator adapts and has the previously described refit-segment initialization issue, so the experiment is not a clean causal comparison of architectures.

How to train a quantile. The pinball loss penalises a forecast tau on one side and one minus tau on the other. Its expected value is minimised by the true quantile, as the research chapter proves. So any model of tomorrow's one percent quantile can be fitted, and compared with others, by its average pinball loss.

Robert Engle and Simone Manganelli's CAViaR. The quantile itself follows an autoregression on yesterday's quantile and yesterday's absolute return. Fitted to nineteen twenty-six to ninety, it keeps 86 percent of yesterday's quantile. No distribution is assumed: it is fitted straight to the pinball loss.

The quantile network uses five lagged features: EWMA scale, yesterday's absolute return, lagged five- and twenty-two-day absolute-return averages, and yesterday's negative return. After an initial burn-in these features use past observations; feature and target normalizations are fitted on the training block. Sixteen hidden tanh units are trained with Adam and pinball loss for one seed. A decade has about twenty-five nominal one-percent tail observations, not hundreds. Parameters are frozen after nineteen ninety, unlike the adaptive GJR benchmark. No tuning uncertainty or repeated-seed inference is measured here.

The test. The GARCH-filtered forecast has the lowest pinball loss, 3.41, with exceptions on 0.99 percent of days. CAViaR comes close, 3.48, with neither selected backtest rejected at five percent. The network is worse, 3.59, exceeded too often; and plain historical simulation, 4.43, is far behind them all.

Through the crisis. All three forecasts fall with the returns as volatility rises in September twenty oh eight. The network reacts most slowly and recovers too fast: it learned the average speed of volatility from the past, while GARCH's filter reacts to each day as it comes.

A score difference needs an uncertainty calculation. The reported two-sided Diebold--Mariano statistics are 1.83 for network minus GJR and 1.92 for CAViaR minus GJR, with a five-lag HAC estimate. Neither equal-mean-score null is rejected at five percent here. Non-rejection is not equivalence, and HAC asymptotics require suitable dependence and moments. One seeded network, adaptive comparator fitting, parameter estimation and initialization differences limit the inference. No new model, tuning trial or hold-out opening is performed.

Possible explanations are hypotheses rather than identified causes. GJR's four variance parameters impose asymmetry and persistence, while the network must learn useful structure from features. Sixty-five trading years contain about one hundred and sixty-four nominal one-percent tail observations, so flexible tail estimation is data hungry. Frozen parameters, adaptive benchmark fits, one seed and initialization differences all affect this comparison. The reported losses do not isolate a post-nineteen-ninety structural shift or prove why a model performed as it did.

Three proposed research directions. Evaluate additional inputs such as implied volatility or realized measures, with realistic availability. Compare a residual correction with direct replacement under the same expanding or rolling training schedule. Jointly score VaR and ES, predeclare tuning and seeds, and quantify uncertainty on a fresh authorized evaluation. These are designs to test, not newly run models or a promise of better performance.

Pause and predict. A ten-day ninety-seven and a half percent expected shortfall of eleven million dollars is computed for a large-cap equity book. Choose an investment-grade corporate credit-spread book assigned a forty-day liquidity horizon and the same ten-day shortfall. What is its chosen single-horizon scaled ES, separately from the complete capital calculation?

9Regulation and liquidityIndustry4 min

And the chosen scaling answer: an eleven-million-dollar ten-day ES becomes twenty-two million at forty days under a single-factor-horizon square-root illustration. This is not the full bank capital calculation. The cached numerical table separately starts from one-day historical ES scaled by root ten; that synthetic base does not meet Basel's requirement to estimate the ten-day base from ten-day risk-factor changes. The distinction is material, not a rounding issue.

Three historical generations of standards. The nineteen ninety-six market-risk amendment permitted eligible approved models to use ninety-nine percent ten-day VaR with multiplication and other requirements; the traffic-light example concerns a one-day backtest. Basel two point five added a separate stressed-VaR charge based on a qualifying twelve-month stress period. FRTB was issued in twenty sixteen and revised in twenty nineteen: expected shortfall at ninety-seven and a half percent, liquidity horizons and desk-level assessment. Actual implementation dates and local rules vary; this chapter is not a current-jurisdiction compliance determination.

The historical Basel standard specifies ninety-seven-and-a-half percent ES. Its zero-mean Gaussian coefficient is close to, not identical to, ninety-nine percent VaR; that does not equate full capital requirements. Start with ten-day ES for all factors, then add squared contributions from nested subsets of factors whose liquidity horizons exceed each threshold, weighted by successive horizon increments. The ten-day base must use ten-day factor changes rather than scaling shorter-horizon ES. Stress calibration, constrained aggregation, default risk and non-modellable factors add further requirements. This lecture illustrates methodology rather than certifying current local rules.

Single-horizon scaling illustrations with corrected categories from the twenty-nineteen Basel table. Large-cap equity price has a ten-day floor; investment-grade sovereign spreads and large-cap equity volatility have twenty. The synthetic ten-day base here is 11.3 million dollars. High-yield sovereign and investment-grade corporate spreads use forty days, giving 22.5 under this illustration. Credit-spread volatility uses one hundred and twenty, giving 39.0. The original cached category strings were overbroad; these visible labels correct their interpretation without altering the computation. Single-bucket ES scaling is not total capital or a measured liquidation-cost forecast.

How the stress enters. The shortfall of a reduced set of risk factors over the stressed year, scaled up by the ratio of the full set's shortfall to the reduced set's today. The reduced set exists because many of today's factors had no prices in the stressed year; it must explain most of today's risk for the scaling to be trusted.

Internal-model eligibility is assessed at desk level. Historical Basel standards combine desk backtests with profit-and-loss attribution requirements. Attribution compares risk-theoretical P and L with hypothetical P and L for a specified static portfolio, not simply realized front-office trading P and L. A discrepancy is evidence to investigate under the prescribed metrics and thresholds, not an automatic result from any missing factor. Factors failing modellability criteria have separate stressed treatment. The exact current jurisdictional implementation is outside this methodological illustration.

Liquidity in the number itself. Anil Bangia and coauthors' liquidity-adjusted VaR adds the cost of crossing half a stressed spread. On a hundred million dollars with a ten basis point spread, VaR rises from 3.30 to 3.41 million: little, for a liquid book. The larger cost of exiting size is impact.

Part thirty-seven's square-root impact is an empirical scale, not a universal execution-cost identity. With a chosen unit coefficient, the terminal-impact scale is daily volatility times root quantity over daily volume. At twenty percent participation in volume that is about nought point four five daily volatility. For a cumulative square-root trajectory, averaging over executed quantity gives two thirds of terminal impact before other costs. Comparing either with a two-point-three-three-sigma Gaussian VaR requires compatible price, dollar and horizon units. Liquidity and stress can change coefficients, volume and volatility.

Risk numbers also set margin. A clearing house's initial margin is a VaR: a ninety-nine or ninety-nine point five percent loss over the days needed to close a defaulter's position, Part twenty-one's clearing. But a VaR that reacts quickly, as Chapter three recommends, raises margin calls in the middle of a crash and forces sales: procyclicality, visible in March twenty twenty, as reported. So the rules add floors, buffers released in stress, and stressed data in every window: a forecast tempered so that it does not amplify what it measures.

Pause and predict. The House's evening risk report shows a ninety-nine percent one-day VaR. Which three other numbers should sit beside it, so that a reader can judge it?

10Rule 40: a risk number is a forecastIndustry3 min

The answer to the pause. First, the expected shortfall: how bad the bad days are. Second, the backtest: the exceptions, whether they cluster, and the shortfall test. Third, the stress: the worst historical and reverse-stress losses, and how much of the number rests on the dependence assumed.

Chapter ten. The House's fortieth rule belongs to its risk function, which now reports on every desk. It treats every risk number the way the series has treated every return: as a forecast, to be tested.

The proposed research dashboard compares separate examples. It shows descriptive historical exception diagnostics, a fitted GPD exponent, finite-threshold industry co-exceedances, a linear-factor reverse stress, a Pareto dependence exercise and one seeded learned-quantile comparison. These are not components of one portfolio's reconciled capital number. Non-rejection is not validation, a fitted exponent is not a population moment proof, and a finite-grid rearrangement estimate is not a certified worst-case bound. The initialization and source-exclusion limitations remain visible in the notes.

A dashboard must identify the provenance of every line. The first two are separate historical-market VaR and ES measures with different confidence levels. The GJR diagnostics use another forecast procedure and longer window, so they do not backtest the first line's historical estimator. Stress uses a factor-tilted book, dependence uses chosen Pareto marginals, and impact is a chosen terminal scale rather than total exit cost. These examples illustrate a report design; they are not one reconciled live risk report or deployment approval.

And around it. The risk function reports to the board, not to the desks it measures. Every model is validated by people who did not build it, before and after it goes live. And desks are limited in shortfall and stress loss, while VaR's exceptions serve as the alarm that the model has drifted.

What the rule means for the House's desks. The volatility and market-making desks are short gamma and carry inventory: their VaR needs full revaluation, with volatility as a risk factor. The statistical and systematic books look diversified until correlations shift: they need tail dependence and reverse stress. And the digital-assets desk's venue and stablecoin exposures are stress items with limits of their own, outside the VaR.

Chapter three's timing test. Count the four kinds of consecutive pairs of days, quiet then quiet, quiet then exception, and so on, and compare the chance of an exception after an exception with the chance after a quiet day.

Chapter four in two lines: the quantile of the fitted generalised Pareto tail, and its shortfall.

Chapter six's reverse stress test: the portfolio's variance, the scenario proportional to sigma times w, and its distance.

And Chapter seven: for each column, the sum of the others, and the column re-sorted to run against it.

The tools this part adds. Forecasting, backtesting, and tails and uncertainty. And the fortieth rule. Every risk number the House reports is a forecast, shown with its own backtest. Expected shortfall sits beside VaR. And every report carries the stress loss and the dependence bound that the model cannot see.

The rule against three cases. A VaR model with no exceptions in a year: ask whether it is good or merely conservative, and look at a decade. A portfolio whose risk fell when it diversified: ask whether the measure is VaR, and whether the new positions sit just beyond its quantile. A credit book modelled with a Gaussian copula: ask for its joint exceedances, and what the dependence bound would say.

For the researcher: what can be backtested?PhD8 min

For the researcher: scoring, calibration and backtesting are different tasks. A quantile with a unique appropriate cutoff is elicitable; integrated-tail ES is not elicitable alone on a rich convex distribution class, while the VaR--ES pair is jointly elicitable under stated conditions. Non-elicitability does not prohibit model-verification tests. We prove the convex-level-set obstruction, derive score derivatives, and distinguish illustrative numerical evidence from a proof or a fully past-measurable historical forecast.

A scoring function maps a point forecast and outcome to a loss, with lower better. Fix both a distribution class and an action domain, and require the expected scores used in the comparison to exist. Consistency means the target minimizes expected loss; strict consistency requires the minimizer to be unique on that class. Elicitability supports truthful score-based forecast comparison. It does not say that other model-verification tests are impossible, that every consistent score gives the same finite-sample ranking, or that a score alone establishes calibration.

The pinball expectation is convex in q when the first moment is finite. At a continuous point its derivative is F of q minus tau. At an atom the left and right derivatives are F of q-minus minus tau and F of q minus tau. The minimizing condition is that tau lies between those two probabilities. A unique quantile gives strict consistency on the chosen class; otherwise the score elicits the quantile set. This statement avoids assuming every generalized quantile is a unique zero of a smooth derivative.

Lemma two, a necessary condition due to Kent Osband. If two distributions have the same value of an elicitable functional, so does every mixture of them. The proof: an expected score under a mixture is the mixture of the expected scores. Each is minimised at t, so their mixture is too, and strict consistency makes t the only minimiser. Elicitable functionals have convex level sets.

The theorem. Take a sure loss of one, and a loss of two with probability five percent, nothing otherwise. At ninety percent both have an expected shortfall of exactly one. Mix them half and half: the worst ten percent now holds two and a half percent of twos and seven and a half of ones, a shortfall of one and a quarter. The level set is not convex, so by lemma two no score of any form elicits expected shortfall.

Check one: the level sets, computed. Two distributions with the same ninety-nine percent VaR, 0, and their mixture: the same VaR again. The theorem's pair, with the same shortfall, 1.00, and their mixture: 1.25.

Rockafellar and Uryasev give a variational representation for integrable losses: minimize v plus expected positive excess above v divided by one minus alpha. At continuity points its derivative is one minus the exceedance probability divided by the tail mass. With atoms, the subgradient condition is F of v-minus at most alpha at most F of v. The minimum value is integrated-tail ES, and the minimizers form the quantile set. This representation does not make the minimum value elicitable alone; it motivates adding the quantile as another action.

Fissler and Ziegel characterize strictly consistent scores for the pair under suitable distribution and action-domain conditions. This FZ-zero version uses lower-tail return quantile v and ES e on the domain e less than v less than zero. Assume a unique continuous tau quantile, finite first moment, negative true ES, and finite expected score. Rescaling all returns and forecasts by a positive constant adds log of that constant to FZ zero. Score differences are unchanged, but the score level itself is not literally unit free. Joint scoring does not remove model uncertainty or guarantee identical rankings across every consistent score.

Both parts of the joint argument. For fixed negative e, the v derivative has the sign of F of v minus tau, so a unique continuous quantile minimizes the score in v. Define A of v as v minus the expected lower partial excess divided by tau. At the true cutoff this equals lower-tail ES. The e derivative is e minus A, divided by e squared. At the true cutoff it changes from negative to positive at the true ES, giving a global minimum within the negative domain. Minimizing v first and e second proves the pair result for the stated domain and integrability assumptions, not just a stationary point. Atoms and nonunique cutoffs require the more general theorem.

Check two is finite simulation evidence, not proof. Four hundred thousand Student-t-four draws generate average FZ-zero scores on an admissible grid around the truth, with brighter cells indicating smaller scores. The plotted heatmap uses every second grid point, while the reported minimum uses the full grid. Its minimum is -1.96 and -2.82 percent, compared with the separately displayed population values. Sampling and grid discretization can move a minimum; agreement at this resolution does not establish exact population equality.

Check three: ranking the forecasters of Chapter three by FZ zero, at ninety-seven and a half percent, every day from nineteen twenty-eight. The GARCH-filtered historical simulation scores best. Every other forecaster is worse, by Diebold-Mariano statistics from 6.7 to 11.1, and the normal last. The joint score orders them as the backtests did, but with one number each, and with a test of the difference.

Check four holds one quantile fixed while changing the distribution. Each of two thousand replications has 1000 iid Student-t-three observations. A normal forecast is scaled to match its ninety-nine percent VaR, though the body and tail both differ. Forecast ES is 3.00 versus true 4.04. Kupiec rejects 5.9 percent: hits have the null one-percent probability, so the count does not identify the severity error. Z two rejects 32.2 percent using a critical value calibrated on the chosen normal null. These Monte Carlo rates and that calibration are specific to the sample length and alternative, not a universal power guarantee or proof that only the tail changed.

What this changes. A traditional backtest asks whether a model can be rejected, a weak question. Fissler, Ziegel and Gneiting, and Natalia Nolde with Ziegel, proposed comparative backtests: is the bank's model worse than a standard one, by the joint score? A traffic light built on score differences, possible only because the pair is elicitable.

An expectile minimizes an asymmetric squared loss when the needed second moment exists. For return X, a coherent monetary risk convention is minus its lower expectile, with tau at most one half; for losses use an upper expectile with the opposite tail orientation. Classification results for law-invariant coherent elicitable risks require an atomless rich function space and regularity; they are not an unqualified identity for every domain. The mean is included at tau one half. State the sign, space and integrability before applying that result.

The theory links Osband's convex-level-set condition, Gneiting's scoring framework and Fissler and Ziegel's joint elicitability. Patton, Ziegel and Chen develop dynamic joint-score models; Acerbi and Szekely study calibration diagnostics, and Nolde and Ziegel compare forecasting procedures. QLIKE can consistently score an appropriate conditional second moment or unbiased proxy under its assumptions; it does not elicit unconditional variance with an unknown mean from a single raw observation. Squared error elicits a mean. Out-of-sample R squared is a normalized fixed-benchmark loss comparison, not itself a universal standalone proper score. Those distinctions reconcile the next variance counterexample.

Three open questions. Tests of expected shortfall with power in a year or two of data, without strong assumptions. Which systemic measures, such as Part forty-one's CoVaR, are elicitable, and by which scores. And among the many consistent scores for the pair, which one ranks models by what a bank actually loses when they are wrong.

Pause and predict. The mean is elicited by squared error. Is the variance elicitable on its own? Try lemma two with two point masses.

Recap, desk questions, problemsAll tracks4 min

Part forty in thirteen lines. Value at risk is a quantile: it says how often, never how much, and expected shortfall is the mean beyond it. The arithmetic-sum horizon comparison can differ from root-time scaling. VaR is not subadditive; expected shortfall is coherent. A normal VaR was exceeded twice as often as promised, in clusters, while a GARCH-filtered one was not rejected by selected tests, with an initialization caveat. The fitted GPD has an exponent near five. And the Gaussian copula has zero asymptotic tail dependence; finite-threshold market co-exceedances answer a different question.

The most plausible way to lose a given amount is a formula, and history takes costlier routes. Unknown dependence can push VaR far above the sum of its parts. Learned quantile models did not beat a GARCH filter. Regulation moved to expected shortfall with liquidity horizons, and liquidity is a second risk of its own. The research chapter separates strict scoring consistency from calibration tests. And the House's rule: a risk number is a forecast, reported with its backtest.

Three lessons. A risk number is a forecast, testable like any other, and it should be reported with its record. Volatility first, then tails: most failures come from ignoring clustering. And what the model cannot see, tail dependence, liquidity and unseen scenarios, belongs beside the number, not hidden inside it.

The part on one card. Expected shortfall two ways. Kupiec's ratio and the Z two statistic. The peaks-over-threshold quantile. Tail dependence, for the t and the Gaussian. The most plausible stress scenario. And the joint score for VaR and expected shortfall.

How this part connects. Backwards: Part two's margin, Part seven's volatility models, Part twenty's copula, Part thirty's CVaR and Part thirty-seven's impact all meet in the risk report. Sideways: Part twenty-six's backtests of strategies and this part's backtests of risk are the same idea. Forwards: Part forty-one's crises are where risk numbers fail together.

Six desk questions. Ten-day VaR from one-day? Square-root-ten scaling requires zero-mean independent Gaussian additive daily losses with constant variance. The historical comparison can differ, without guaranteeing a larger ratio for every real sample. Why can VaR fail coherence? It is not subadditive on a general loss class. How do you backtest it? Check exception counts and timing under the appropriate forecast and sampling assumptions.

Beyond the data? Extreme-value theory. What does correlation miss? Tail dependence. And can expected shortfall be backtested? Yes, with suitable tests; standalone scoring and joint elicitability are different questions. Full solutions are in the notes.

The variance pause. Point masses at minus one and plus one each have variance zero, while their even mixture has variance one. On a convex class containing them, variance alone fails the convex-level-set condition. On a finite-fourth-moment class, sum squared errors for the mean and second moment, then transform the uniquely elicited pair to mean and variance. Squared error for the second moment needs integrability of the squared target. This does not contradict using QLIKE for a correctly centered conditional second moment.

Twelve fully solved bilingual problems. Six foundations cover normal VaR and ES, Gaussian AR-one horizon variance, independent defaults, Kupiec, a fully specified transition count, and an EVT quantile. Four advanced questions cover t-copula tail dependence, positive-definite reverse stress, the analytic sum-of-ES bound and a chosen single-liquidity-horizon scaling illustration. Two qualifying problems prove the pinball and convex-level-set results, the ES obstruction and variational formula, then derive conditional Z-two centering and the joint-score minimum. Complete English and Mandarin solutions state their domains, signs and integrability assumptions in the notes.

Where this comes back. Part forty-one follows leverage and liquidity into the crises where risk numbers fail together. Part forty-two lets machines trade on the risks measured here. And Part forty-three asks whether anyone's returns pay for the risks they take.

The textbooks and papers shown supply the theoretical and regulatory references. Numerical examples use the twelve approved unchanged ordinary outputs, explicitly chosen arithmetic, or labeled simulation through the stated research window. The extra assembled-public-data dependency was blocked before its original checker and has not been retried; its partial calculations supply no approved results here.

The House can now say how much it might lose, and how it would know if it were wrong. Next, Part forty-one: leverage, liquidity and crises. Bank runs, fire sales and the spirals in which every risk number fails at once.

Where it goes next. Risk limits that tighten together are the mechanism of Part 41.

Key results

The part's results in one place, for revision.

Value at risk\[\mathrm{VaR}_\alpha=\inf\{x:\ \mathbb P(L\le x)\ge\alpha\}\]
Expected shortfall\[\mathrm{ES}_\alpha=\frac{1}{1-\alpha}\int_\alpha^1\mathrm{VaR}_u\,du\]
Kupiec's test\[\mathrm{LR}=-2\ln\frac{(1-p)^{T-x}p^{x}}{(1-\hat p)^{T-x}\hat p^{x}}\ \sim\ \chi^2_1\]
Generalized Pareto tail\[\mathbb P(L-u>y\mid L>u)\approx\Bigl(1+\frac{\xi y}{\beta}\Bigr)^{-1/\xi}\]

Try it

Lab 40 · Backtest a risk model

Forecast one-day 99% value at risk three ways on a simulated market with volatility clusters and heavy tails: a rolling normal, historical simulation, and filtered historical simulation. Count the exceptions, test their number and their clustering, and compare the expected shortfalls.

Figure produced by Lab 40: Backtest a risk model
Produced by the lab below, seed 0, in 0.8 s. Simulated data.
python -m videos.quant.labs 40 needs numpy, scipy, matplotlib, numba · download lab40.py · source on GitHub
rolling normal         exceptions 102 of 5000 (2.04%; 1% expected)   coverage p = 0.000   independence p = 0.000   ES/VaR 1.15
historical simulation  exceptions  63 of 5000 (1.26%; 1% expected)   coverage p = 0.076   independence p = 0.000   ES/VaR 1.30
filtered historical    exceptions  57 of 5000 (1.14%; 1% expected)   coverage p = 0.330   independence p = 0.684   ES/VaR 1.39

The rolling normal fails twice: too many exceptions, and they come in clusters. Filtering by today's volatility repairs the clustering; the empirical tail repairs the count.
The code (55 lines; it asserts its own result)
"""Lab 40: a risk number is a forecast: three VaR models, backtested on a market with clusters and fat tails."""

import numpy as np

from videos.quant import labs
from videos.quant.labs.lab01 import garch
from explainer.quant.house import risk

TITLE = "Backtest a risk model"
GOAL = ("Forecast one-day 99% value at risk three ways on a simulated market with volatility clusters and heavy "
        "tails: a rolling normal, historical simulation, and filtered historical simulation. Count the "
        "exceptions, test their number and their clustering, and compare the expected shortfalls.")
TASKS = [
    "Add 'evt' to the methods (a generalized Pareto tail on GARCH residuals). Is it better at 99.9%?",
    "Scale the one-day VaR to ten days with risk.sqrt_time. When does the square-root rule fail, and in which direction?",
    "Score the forecasts with risk.fz0, the joint VaR-ES loss. Does it rank the models the same way?",
]


def run(seed=0):
    r = garch(6000, seed=seed + 5)
    alpha, start = 0.99, 1000
    out = risk.rolling_forecasts(r, alpha=alpha, window=500, start=start, methods=("normal", "hs", "fhs"))
    names = {"normal": "rolling normal", "hs": "historical simulation", "fhs": "filtered historical"}
    lab, res = labs.Lab(), {}
    for key, name in names.items():
        var, es = np.asarray(out[key]["var"]), np.asarray(out[key]["es"])
        I = risk.hits(r, var)  # forecasts are NaN before `start`; hits skips those days
        k, c = risk.kupiec(I, 1 - alpha), risk.christoffersen(I, 1 - alpha)
        res[key] = dict(var=var[start:], I=I, rate=I.mean(), p_uc=k["p_value"], p_ind=c["p_ind"], ratio=np.nanmean(es / var))
        lab.row(name, f"exceptions {I.sum():>3} of {I.size} ({100 * I.mean():.2f}%; 1% expected)   "
                      f"coverage p = {k['p_value']:.3f}   independence p = {c['p_ind']:.3f}   ES/VaR {res[key]['ratio']:.2f}")
    lab.note = ("The rolling normal fails twice: too many exceptions, and they come in clusters. Filtering by "
                "today's volatility repairs the clustering; the empirical tail repairs the count.")
    assert res["normal"]["rate"] > 0.014 and res["normal"]["p_ind"] < 0.05
    assert abs(res["fhs"]["rate"] - 0.01) < 0.005 and res["fhs"]["p_ind"] > 0.01 and res["fhs"]["ratio"] > res["normal"]["ratio"]

    realized = r[start:]
    fig, ax = labs.figure(2, size=(11, 4.2), gridspec_kw={"width_ratios": [2, 1]})
    days = np.arange(start, start + 1500)
    ax[0].plot(days, 100 * realized[:1500], color=labs.MUTED, lw=0.5)
    for key, c in (("normal", labs.LOSS), ("fhs", labs.GAIN)):
        ax[0].plot(days, -100 * res[key]["var"][:1500], color=c, lw=1.1, label=f"-VaR, {names[key]}")
        hit = np.flatnonzero(res[key]["I"][:1500])
        ax[0].plot(days[hit], 100 * realized[:1500][hit], "o", color=c, ms=3)
    ax[0].set(title="Returns, two 99% VaR forecasts and their exceptions", xlabel="day", ylabel="%", ylim=(-9, 6))
    ax[0].legend(fontsize=8, loc="upper right")
    keys = list(names)
    ax[1].bar([names[k].replace(" ", "\n") for k in keys], [100 * res[k]["rate"] for k in keys],
              color=[labs.LOSS, labs.P, labs.GAIN])
    ax[1].axhline(1.0, color=labs.INK, ls="--", lw=1)
    ax[1].set(title="Exception rate, % (1% promised)")
    ax[1].tick_params(axis="x", labelsize=8)
    lab.fig = fig
    return lab

Now change it

  1. Add 'evt' to the methods (a generalized Pareto tail on GARCH residuals). Is it better at 99.9%?
  2. Scale the one-day VaR to ten days with risk.sqrt_time. When does the square-root rule fail, and in which direction?
  3. Score the forecasts with risk.fz0, the joint VaR-ES loss. Does it rank the models the same way?

Problems, with solutions

Try each problem before opening its solution; the last two of each set are at qualifying-exam level.

Problems, with worked solutions

Twelve worked problems — six foundations

  1. Normal, zero mean, sigma=1%. A normal daily loss with \(\sigma = 1\%\) and zero mean: VaR and ES at 99% and at 97.5%.

    Solution

    VaR_alpha=sigma Phi^-1(alpha); ES_alpha=sigma phi(Phi^-1(alpha))/(1-alpha). At 99% they are 2.32635% and 2.66521%; at 97.5%, 1.95996% and 2.33780%. These are additive daily loss units, not capital approval.

  2. Stationary Gaussian AR(1), phi=.1. Zero-mean stationary Gaussian AR(1) returns with lag-one correlation 0.1: the SD factor for a sum of ten returns.

    Solution

    With marginal variance sigma², lag-k covariance is sigma² phi^k. Summing all diagonal and off-diagonal terms gives Var(sum_1^10 r)=sigma²[10+2 sum_1^9(10-k).1^k]=11.975308642 sigma². Its SD factor is 3.460535889, versus root ten 3.162277660. Zero-mean Gaussianity transfers that SD factor to the selected quantile; it is not a compounding formula.

  3. Independent 3% defaults of 100. Two independent bonds each lose 100 with probability 3%: the 95% VaR of each and of both.

    Solution

    Each zero-loss mass .97 exceeds .95, hence VaR95=0. Joint zero-loss mass is .97²=.9409<.95; cumulative mass through loss100 is 1-.03²=.9991>=.95, hence joint VaR95=100. This is a non-subadditivity example, not a claim that diversification increases every risk functional.

  4. Eight hits, T=250, p=.01. Eight exceptions of a 99% VaR in 250 days: Kupiec's statistic, its \(p\)-value and the traffic-light zone.

    Solution

    With phat=.032, LR=2[x log(phat/p)+(T-x) log((1-phat)/(1-p))]=7.733550724. A chi-square1 asymptotic p-value is .0054204. Historical Basel yellow covers 5–9 exceptions; at eight the base-plus-add-on multiplier is 3.75 in that historical framework. Sparse-count asymptotics and current local requirements are separate questions.

  5. Ten hits, first/last zero, four adjacent hit pairs.

    Solution

    Among 999 transitions, n11=4, n10=10-4=6, n01=6, n00=999-16=983. Thus p11=4/(4+6)=.4 and p01=6/(983+6)=.006066734. The large difference indicates first-order clustering in this sequence. It does not identify volatility as its cause; without endpoint information the exact denominators would be underspecified.

  6. GPD extrapolation. Threshold 2%, \(\xi = 0.2\), \(\beta = 0.8\%\), 400 exceedances in 10,000 days: VaR and ES at 99.9%.

    Solution

    u=.02,xi=.2,beta=.008,N_u/n=.04,alpha=.999. The exceedance multiplier is (25*.001)^(-.2). Hence VaR=.02+.008/.2[(.025)^(-.2)-1]=.0636511642 and `ES=(VaR+.008-.2*.02)/(.8)=.0845639553'. Require alpha above the threshold's percentile, support positivity and xi<1 for finite ES. These are chosen parameters, not another fitted historical tail.

Problems, with worked solutions

Four advanced solutions

  1. t copula, rho=.5, nu=4. A \(t\) copula with \(\rho = 0.5\) and \(\nu = 4\): its tail-dependence coefficient.

    Solution

    The lower-tail limit is 2 t_5(-sqrt(5*(1-.5)/(1+.5)))=2 t_5(-sqrt(5/3))=.2531699951. It is a limit of a conditional probability, not the joint probability at a finite 1% threshold; rho is a latent copula parameter.

  2. Reverse stress, dollar SD=2m, target16m. A portfolio with daily standard deviation \\(2m: the distance of the most plausible \\)16m loss, and its direction.

    Solution

    With zero center, positive-definite covariance Sigma and a linear loss '-w'x=L, minimize 'x'Sigma^-1 x. Lagrange differentiation gives 2 Sigma^-1 x+lambda w=0, so 'x*=-L Sigma w/(w'Sigma w). Substitution satisfies the constraint and gives distance 'L/sqrt(w'Sigma w)=8. Positive definiteness gives uniqueness; maximum-density interpretation additionally requires a suitable elliptical model.

  3. Three Lomax/Pareto-II losses, exponent2. Three Pareto losses with exponent 2 (VaR 9, ES 19 each at 99%): an upper bound on the worst-case VaR of the sum.

    Solution

    Their quantile is q_u=(1-u)^(-1/2)-1; VaR99=9. Integrating the upper tail gives ES99=2/sqrt(.01)-1=19. For any dependence, VaR99(sum)<=ES99(sum)<=sum ES99=57, using integrability and ES subadditivity. The cached grid estimate about45.9 is separate numerical evidence, not a certified optimum or proof that57 is sharp.

  4. Chosen single-horizon ES, 5m base at10days and60day horizon. A 10-day ES of $5m on a book with a 60-day liquidity horizon: the chosen single-horizon ES illustration, distinguished from full FRTB capital.

    Solution

    The illustration gives 5 sqrt(60/10)=12.247448714m. This is one-horizon scaling, not complete FRTB capital. A compliant ten-day base must itself use ten-day risk-factor changes, with nested subset aggregation and other regulatory charges handled separately.

Problems, with worked solutions

Two qualifying solutions

  1. Pinball, level sets, ES obstruction and variational formula. (qual) Prove that the pinball loss elicits the quantile, that elicitable functionals have convex level sets, and that ES is not elicitable; derive the Rockafellar–Uryasev representation.

    Solution

    For finite E|Y|, expected check loss is convex. At a continuity point differentiation yields (1-tau)F(q)-tau[1-F(q)]=F(q)-tau. At atoms use left/right derivatives F(q-)-tau and F(q)-tau; minimizers satisfy F(q-)<=tau<=F(q). Uniqueness gives strict consistency. If T is elicited by S and equal to t at F0 and F1, every alternative x has strictly higher expected score in each distribution. Linearity of expectation preserves that strict inequality in nontrivial mixtures, forcing the mixture's T to be t. Now F0=delta1 and F1=.95delta0+.05delta2 both have ES90=1: the latter tail splits 5% twos and5% zeros. In the half mixture, the worst10% contains2.5% twos plus7.5% ones, giving (2*.025+1*.075)/.1=1.25. The level set fails convexity, ruling out a strictly consistent scalar ES score on this class, without ruling out calibration tests. Finally g(v)=v+E(L-v)^+/(1-alpha) is convex, with subgradient containing zero exactly when F(v-)<=alpha<=F(v). At such v, g(v)=[E L1{L>v}+v(F(v)-alpha)]/(1-alpha), which splits the cutoff atom and equals integrated-tail ES. This proves the formula for integrable losses, including atoms.

  2. Z2 and the global joint-score minimum. (qual) Show that \(\mathbb E[Z_2] = 0\) when VaR and ES are correct for a continuous loss, and that for the true VaR the FZ0 expected score is minimised in \(e\) at the true ES.

    Solution

    Let forecasts be measurable with respect to information H_(t-1), with a continuous conditional alpha quantile v_t, nonzero positive ES e_t and the relevant ratios integrable. Then E[L_t 1{L_t>v_t}|H]=(1-alpha)e_t, so E[L_t I_t/e_t|H]=1-alpha. Iterated expectation gives E Z2=0 even for random forecasts; no exchange of a random denominator with expectation is assumed. If VaR stays correct but the forecast ES is lower, expected Z2 is T^-1 sum E[e_true,t/e_forecast,t]-1, positive under pointwise underestimation, not generally a ratio of unconditional means. For the lower-return FZ0 convention assume e<v<0, a unique continuous tau quantile and finite first/score moments. At fixed e, partial_v E S=(F(v)-tau)/(-tau e) changes from negative to positive at q. At q set e_true=q-E(q-R)^+/tau. Then partial_e E S=(e-e_true)/e², negative below e_true and positive above. Thus v=q is globally optimal for each fixed e and e=e_true is globally optimal there: the pair is the global minimum in the stated domain. At the root the second derivative in e is 1/e_true²>0, but the sign argument supplies the global result. General atoms/nonunique actions require the broader theorem.

Reading and notes

The part's papers

from READING.md

  • Sklar, A. (1959). "Fonctions de répartition à n dimensions et leurs marges."

  • Balkema, A., de Haan, L. (1974). "Residual life time at great age." Annals of Probability; Pickands, J. (1975). "Statistical inference using extreme order statistics." Annals of Statistics.

  • Hill, B. (1975). "A simple general approach to inference about the tail of a distribution." Annals of Statistics.

  • Koenker, R., Bassett, G. (1978). "Regression quantiles." Econometrica.

  • Kupiec, P. (1995). "Techniques for verifying the accuracy of risk measurement models." J. Derivatives.

  • J.P. Morgan/Reuters (1996). RiskMetrics Technical Document.

  • Christoffersen, P. (1998). "Evaluating interval forecasts." International Economic Review.

  • Artzner, P., Delbaen, F., Eber, J.-M., Heath, D. (1999). "Coherent measures of risk." Mathematical Finance.

  • Barone-Adesi, G., Giannopoulos, K., Vosper, L. (1999). "VaR without correlations for portfolios of derivative securities." J. Futures Markets.

  • Bangia, A., Diebold, F., Schuermann, T., Stroughair, J. (1999). "Modeling liquidity risk, with implications for traditional market risk measurement and management." Wharton WP.

  • McNeil, A., Frey, R. (2000). "Estimation of tail-related risk measures for heteroscedastic financial time series: an extreme value approach." J. Empirical Finance.

  • Danielsson, J., et al. (2001). "An academic response to Basel II." LSE FMG.

  • Acerbi, C., Tasche, D. (2002). "On the coherence of expected shortfall." J. Banking & Finance.

  • Föllmer, H., Schied, A. (2002). "Convex measures of risk and trading constraints." Finance and Stochastics.

  • Embrechts, P., McNeil, A., Straumann, D. (2002). "Correlation and dependence in risk management: properties and pitfalls." In Risk Management: Value at Risk and Beyond.

  • Engle, R. F., Manganelli, S. (2004). "CAViaR: conditional autoregressive value at risk by regression quantiles." JBES.

  • Breuer, T., Jandačka, M., Rheinberger, K., Summer, M. (2009). "How to find plausible, severe, and useful stress scenarios." Int. J. Central Banking.

  • Gneiting, T. (2011). "Making and evaluating point forecasts." JASA.

  • Embrechts, P., Puccetti, G., Rüschendorf, L. (2013). "Model uncertainty and VaR aggregation." J. Banking & Finance.

  • Acerbi, C., Székely, B. (2014). "Backtesting expected shortfall." Risk.

  • Glasserman, P., Kang, C., Kang, W. (2015). "Stress scenario selection by empirical likelihood." Quantitative Finance.

  • Fissler, T., Ziegel, J. (2016). "Higher order elicitability and Osband's principle." Annals of Statistics.

  • Basel Committee (2019). Minimum Capital Requirements for Market Risk (FRTB).

  • Osband, K. (1985). Providing incentives for better cost forecasting. PhD thesis, University of California, Berkeley.

  • Gneiting, T. (2011). "Making and evaluating point forecasts." JASA.

  • Acerbi, C., Székely, B. (2014). "Backtesting expected shortfall." Risk.

  • Embrechts, P., Puccetti, G., Rüschendorf, L. (2013). "Model uncertainty and VaR aggregation." J. Banking & Finance.

  • Bellini, F., Bignozzi, V. (2015). "On elicitable risk measures." Quantitative Finance.

  • Fissler, T., Ziegel, J. (2016). "Higher order elicitability and Osband's principle." Annals of Statistics.

  • Ziegel, J. (2016). "Coherence and elicitability." Mathematical Finance.

  • Nolde, N., Ziegel, J. (2017). "Elicitability and backtesting: perspectives for banking regulation." Annals of Applied Statistics.

  • Patton, A., Ziegel, J., Chen, R. (2019). "Dynamic semiparametric models for expected shortfall (and value-at-risk)." J. Econometrics.

  • Rockafellar, R. T., Uryasev, S. (2000). "Optimization of conditional value-at-risk." J. Risk.

  • Boyer, B., Gibson, M., Loretan, M. (1997). "Pitfalls in tests for changes in correlations." Federal Reserve IFDP 597.

  • JPMorgan Chase & Co. (2013). Report of JPMorgan Chase & Co. Management Task Force regarding 2012 CIO losses; US Senate PSI (2013), JPMorgan Chase Whale Trades.

Papers and sources

Primary sources checked

Data, scope and reproducibilityEvidence and data scope

Thirteen audited unchanged ordinary originals were each invoked once. Twelve succeeded: var3, sqrt, coherent, backtest, evt, depend, stress, ra, learned, liq, research, options. Their hashes are pinned in common.py. extra was blocked before the unchanged original checker because the initial public-key map omitted Binance's assembled daily-file key. This was an audit gap, not a demonstrated frozen-hash mismatch. The attempt and rejection remain recorded; no retry, audit-widening rerun, partial-output reuse or substitute historical fit follows. Its threshold sweep, cross-market tail fits, copula portfolio simulation, Euler table and worst-window ranking are omitted. Clearly chosen formulas/examples replace those sections without recreating failed empirical output.

The initial map listed 43 possible public keys, not every key actually reachable: the blocked assembled key exposed the missing 44th dependency. Possible keys do not claim every key was read. Ten inherited rejected keys plus this newly blocked key remain barred before original checking. French daily factors and 49 daily industries are frozen subsets through 2020-12-31. Industry comparisons use complete eligible rows. No strategy hold-out or strategy payload was opened, read or scored. Every compute.py, the financial algorithms and all 98 protected files remain unchanged. Existing registrations are 23,561 through Part 40 and 23,562 globally; none are new work from this pass.

Do not run the default all-item computation. Missing or changed pinned outputs fail before implicit computation. extra and sensitive prefixes are rejected before name-to-path conversion, counted loading or cache access. No force/refresh, new market trial, rejected-key retry or registry mutation is part of this review.

Data, scope and reproducibilityScientific conventions

For integrable positive-convention losses L, VaR is the generalized alpha quantile. Strict exceedance has probability at most 1-alpha; equality needs appropriate continuity. ES is (1-alpha)^-1 integral_alpha^1 VaR_u du. A conditional mean above the quantile agrees for continuous losses, but atoms need boundary mass splitting. The unchanged historical helper uses a NumPy interpolated quantile and mean of observations at/above that cutoff; it is not an exact integrated empirical ES for arbitrary atoms. The discrete bond/mixture examples explicitly split atoms.

Root-time scaling is exact for zero-mean iid Gaussian additive losses with fixed variance. For returns with daily mean mu and scale sigma, horizon loss VaR is -h mu + sqrt(h) sigma z_alpha. The approved historical exercise sums overlapping simple daily returns, not compounded buy-and-hold returns. Overlap affects sampling dependence. A gap from scaling does not identify clustering, autocorrelation or rebounds as its unique cause. A chosen +10%/-10% path sums to zero but compounds to -1%.

The options example shorts 1,000 straddles and hedges initial delta. Delta-gamma retains the quadratic spot term but omits theta; full Black–Scholes revaluation advances maturity by one day and keeps the hedge static. Their difference does not isolate gamma approximation error. The five-point implied-volatility stress is applied to every simulated path, not only the worst spot moves, and is not a fitted joint spot/volatility model.

Coherence and duality require a specified integrable domain; the ES dual uses probability densities between zero and 1/(1-alpha) integrating to one. Elliptical VaR subadditivity requires jointly elliptical linear losses with a nonnegative confidence coefficient, not merely separately fitted elliptical marginals. Euler allocation additionally needs differentiability, with subgradients/boundary weights when absent. Convex dual representations require the relevant function-space lower-semicontinuity/Fatou assumptions. Normal ES at 97.5% has coefficient 2.3378, close to but not equal to the 99% VaR coefficient 2.3263; a universal cross-confidence inequality does not follow just from calling tails fat.

The rolling GJR implementation has a material timing limitation. At each refit, garch_filter initializes variance from a segment including some evaluation observations, so the forecast series is not strictly past-measurable. Parameters are otherwise periodically estimated on preceding data; residual centering and approximation choices also remain as coded. Reported tests compare this unchanged implementation descriptively. Non-rejection is not proof of calibration, independence, suitability or equality between models. Calendar-year traffic-light counts differ from the historical regulatory 250-day windows. Kupiec and Christoffersen use chi-square asymptotics; sparse counts and dependence affect finite-sample calibration. Z2's iid normal/t4 critical values are two null examples, not a distribution-free theorem.

The marginal peaks-over-threshold limit requires a maximum domain of attraction. Dependence affects estimation/inference and may need mixing or declustering conditions; filtering does not guarantee iid shocks. Positive fitted GPD shape motivates regular variation without proving a universal population tail law. Under an assumed power tail with exponent zeta, moments strictly below zeta can exist and those strictly above diverge; equality is a separate boundary question. The cached xi=0.1967 implies a fitted exponent about 5.08, so claiming that the fifth moment must be infinite would be wrong. Finite ES requires xi<1. Hill uses the k largest positive observations divided by the next, (k+1)st order-statistic cutoff. Its reference line is shown on an expanded axis. No confidence interval is calculated for remote-tail quantiles.

Industry one-percent co-exceedance frequencies are finite-threshold conditional statistics. Gaussian zero asymptotic tail dependence does not imply impossible joint crashes or riskless senior tranches. A copula's latent correlation parameter need not equal Pearson correlation after nonlinear marginal transforms. Selected-crash correlation estimates a different conditional population; the observed gap does not identify a causal selection decomposition. The fixed covariance for retrospective factor stress uses 1990–2020, including dates after some replayed crises. Mahalanobis distance is not a one-dimensional Gaussian tail probability. A minimum-distance loss route is maximum-density only for suitable elliptically decreasing distributions, with a zero-centered linear loss and positive-definite covariance in this illustration.

The rearrangement output is a finite-grid alternating heuristic with an iteration cap and a capped last upper quantile. Agreement of two grids does not certify global optimality or continuum lower/upper bounds. The analytic sum-of-ES bound is separate and valid for integrable marginals. The network is one seeded run trained through 1990 against adaptive comparators, not an architecture-wide or causal test. A trading decade has about 25 nominal 1% tail observations; 65 years have about 164, not 650. DM inference uses a five-lag HAC estimate and its asymptotic dependence/moment assumptions; non-rejection is not equivalence. Proposed better inputs or residual models were not newly trained.

NotesScoring, calibration and the proof

Elicitability specifies a distribution class, action domain and finite expected scores. Pinball loss has derivative F(q)-tau at continuity points and subgradient [F(q-)-tau,F(q)-tau] at atoms. Its minimizing set is the quantile set; strict consistency for a point requires uniqueness. If a strictly consistent score elicits T and T(F0)=T(F1)=t, then the mixture's expected score is a mixture of uniquely minimized scores, so T(lambda F1+(1-lambda)F0)=t. Thus convex level sets are necessary.

At 90%, F0=delta_1 and F1=.95 delta_0+.05 delta_2 have integrated ES 1, but their half mixture has ES 1.25. On a convex class containing them, ES alone therefore has no strictly consistent scalar score. This does not make ES impossible to backtest. Calibration/model-verification tests and strict score-based comparison are different tasks. Joint VaR–ES scores exist with suitable domains and assumptions.

For returns use e<v<0, a unique continuous tau quantile, finite first moment, negative true ES and finite expected score. FZ0 is

S(v,e;r)=-1{r<=v}(v-r)/(tau e)+v/e+log(-e)-1.

For fixed e<0, partial_v E S=(F(v)-tau)/(-tau e), which changes sign at the unique quantile q. Put A(v)=v-E(v-R)^+/tau. At q, A(q)=e_true. The other derivative is (e-A(v))/e^2; at q it changes from negative to positive at true ES. Minimize v first, then e, to obtain the global pair minimum on the stated action domain. Atoms/nonunique quantiles require the general theorem. Scaling returns and forecasts by c>0 adds log(c); score differences are invariant, but absolute FZ0 score levels are not literally unit free.

The finite 400,000-draw heatmap samples every second full-grid point, whereas the reported minimum uses the full grid. A grid/sampling match is numerical evidence, not proof of exact population equality. The power experiment changes the full t3/normal distributions while matching one VaR; it does not change only the tail. Its 2,000 replications of length 1,000 and 4,000 simulated normal-null critical-value replications have Monte Carlo error and model-specific calibration.

QLIKE can target a correctly specified conditional second moment or suitable unbiased proxy under its assumptions. It does not elicit unconditional variance with unknown mean from a single raw observation. Squared error elicits a mean; fixed-benchmark out-of-sample R-squared is a normalized loss comparison. The expectile risk convention is minus a lower return expectile, tau<=1/2, or an upper loss expectile. Classification among law-invariant coherent elicitable risks needs an atomless rich space and its regularity assumptions.

Data, scope and reproducibilityHistorical Basel and liquidity scope

Basel 2019, MAR33 specifies a ten-day base from ten-day factor changes without shorter-horizon scaling, then nested factor subsets at longer liquidity horizons. The displayed cascade includes all-factor base ES squared plus successive nested-subset ES squared times horizon increments/10. The cached table instead scales one-day historical ES by root ten; it is explicitly a synthetic single-horizon illustration, not a compliant base or full bank capital. Corrected visible examples: large-cap equity price 10; IG sovereign spread and large-cap equity volatility 20; HY sovereign/IG corporate spread 40; HY corporate spread and small-cap equity volatility 60; credit-spread volatility 120 days. The original cache's overbroad category strings remain unaltered, and presentation corrects their interpretation.

P&L attribution compares risk-theoretical with hypothetical P&L on a specified static portfolio, not simply realized front-office P&L. Stress calibration, constrained aggregation, default and non-modellable risks add requirements. The 1996 backtesting framework is historical; local implementation and current requirements are not certified here. Root participation is a chosen terminal-impact scale; under a cumulative square-root trajectory its average over quantity is two thirds of terminal impact before fees, spread and other effects. It is not automatically average execution cost or a universal VaR add-on.

中文讲义

本讲的中文说明、交易台问题与习题解答(与英文版对应)。

导言第40部分:度量风险

十三个场景讨论分位数、积分尾部预期亏损、回测、极值、相依性、压力、学习模型与历史巴塞尔方法。风险汇总表是研究设计,不是同一实盘组合的完整资本报告,也不构成上线或资本批准。

Problems, with worked solutions十二道完整解答:六道基础
  1. 正态。 零均值、sigma=1%,VaR=sigma乘正态分位数,ES=sigma乘该点密度再除尾概率。99%分别为2.32635%、2.66521%;97.5%分别为1.95996%、2.33780%。它们是可加损失单位,不是资本批准。
  2. AR(1)。 平稳零均值高斯、phi=.1、边际方差sigma²时,k阶协方差为sigma² phi^k。十日和的方差为[10+2 sum_(k=1)^9(10-k).1^k]sigma²=11.975308642sigma²,标准差因子3.460535889。高斯零均值才能把该因子直接用于分位数;不是复利公式。
  3. 3%独立违约。 单只零损失概率.97≥.95,故VaR95=0。两只零损失概率.9409<.95,而损失不超过100的概率.9991≥.95,故联合VaR95=100。这说明VaR不次可加,不表示所有风险函数都惩罚分散。
  4. 8次突破。 T=250,目标p=.01,经验比例.032。似然比2[8 log(.032/.01)+242 log(.968/.99)]=7.733550724,卡方1自由度近似p=.0054204。历史1996黄区为5–9次;8次对应乘数3.75。稀疏样本近似与现行本地规则另论。
  5. 成簇。 1000天、首尾指标均为0、10个1、4个相邻11对:共有999个转移,n11=4、n10=6、n01=6、n00=983。因此p11=.4,p01=6/989=.006066734。差距提示一阶聚集,但不识别波动率为原因;缺少首尾条件时精确分母不充分。
  6. GPD。 u=.02、xi=.2、beta=.008、超额比例.04、alpha=.999,则VaR=.02+.04[(.025)^(-.2)-1]=.0636511642;ES=(VaR+.008-.004)/.8=.0845639553。须目标超过阈值百分位、满足支撑条件,且xi<1保证有限ES。参数是选定例子,不是新历史拟合。
Problems, with worked solutions四道进阶
  1. t Copula。 rho=.5、nu=4时,系数2 t5(-sqrt(5/3))=.2531699951。这是条件概率的极限,不是1%阈值的联合概率;rho为潜在相关参数。
  2. 反向压力。 零中心、正定Sigma、线性损失约束-w'x=L。拉格朗日一阶条件2 Sigma^-1 x+lambda w=0,代入约束得x*=-L Sigma w/(w'Sigma w)。最小距离L/sqrt(w'Sigma w)=16/2=8;正定性保证唯一。最大密度解释还需适当椭圆递减分布。
  3. 相依界。 三个指数2的Lomax损失,q_u=(1-u)^(-1/2)-1,故VaR99=9;积分上尾得到ES99=2/sqrt(.01)-1=19。对任何相依,VaR(sum)≤ES(sum)≤3*19=57。约45.9的缓存网格量只是数值估计,不认证最优,也不证明57为锐界。
  4. 单期限示例。 十日ES=500万、期限60日,选定开方规则给5 sqrt(6)=12.247448714百万。并非完整FRTB资本;十日基数、嵌套因子集合、压力及其他资本项须另满足规定。
Problems, with worked solutions两道资格题
  1. 引出与ES反例。 E|Y|有限时,期望pinball损失为凸函数。连续点导数为F(q)-tau;原子处左右导数为F(q-)-tau、F(q)-tau,因此最小化条件为F(q-)≤tau≤F(q)。唯一分位数给严格一致性。若严格评分S使F0和F1的函数值同为t,则任何x≠t在两者下期望损失均更大;期望对分布混合线性,非平凡混合也唯一由t最小化,故水平集必须凸。现取F0=delta1、F1=.95delta0+.05delta2;两者ES90=1,后者尾部取5%的2及5%的0。半混合的最差10%为2.5%的2和7.5%的1,均值(.025*2+.075*1)/.1=1.25,故ES水平集不凸。在包含这些分布的凸类上,无严格一致标量ES评分,但仍可做校准回测。最后g(v)=v+E(L-v)^+/(1-alpha)为凸函数;0属于其次梯度当且仅当F(v-)≤alpha≤F(v)。在此v处,g=[E L1{L>v}+v(F(v)-alpha)]/(1-alpha)恰好拆分分位点原子,等于积分ES。这证明可积损失(含原子)的变分公式。
  2. Z2与联合评分。 预测v_t、e_t对前一期信息H可测,条件损失连续,v为正确alpha分位数、e为非零正ES,并假设相关比率可积。则E[L_t I_t|H]=(1-alpha)e_t,所以E[L_t I_t/e_t|H]=1-alpha;迭代期望给E Z2=0,未把随机分母移到期望外。若VaR正确但ES逐点低估,则期望Z2为T^-1 sum E[e_true/e_forecast]-1>0,通常不是无条件均值的比。FZ0改用负收益尾:e<v<0、唯一连续tau分位数、有限一阶与评分矩。固定e,v导数(F(v)-tau)/(-tau e)在q由负转正。定义e_true=q-E(q-R)^+/tau,在q处e导数(e-e_true)/e²也由负转正。先对v再对e全局最小化,证明该域的联合唯一最优;根处e二阶导数为1/e_true²>0,但全局性来自符号论证。原子与非唯一动作须用一般定理。

Review log of the earlier QA passes on this part: docs/qa/quant/part40.md.

Data, scope and reproducibility数据与结论边界

十三个经审计的常规原始计算各调用一次,十二个成功。extra因访问图漏列Binance组装日线键,在原校验器调用前被屏障阻止;这属于审计缺口,不是已证明的冻结哈希不符。不重试、不扩大授权后重跑、不读取或复用部分输出、不换一个历史拟合。其阈值扫描、比特币尾部、Copula组合模拟、历史欧拉表与最差窗口表均删除,以明确标记的公式或选定例子说明概念。

初始图列出43个可能公共键,遗漏的组装键使完整依赖至少多一项;不能称原图穷尽,也不能把可能依赖说成实际全部读取。十个既有拒绝键与本次阻止键持续拦截。只使用截至2020年末的French研究数据和获准模拟结果,不打开、读取或评分封存策略。所有原始金融算法、每个compute.py与98个受保护文件不变。本轮没有刷新、新市场试验或登记变化;累计计数截至第40部分为23,561、全局23,562。

Data, scope and reproducibility科学解释

VaR为广义分位数,严格突破概率至多1-alpha;连续正确校准时才等于它。ES定义为上尾分位数的积分,遇到分位点原子须拆分边界质量,不能一概写作含全部边界原子的条件均值。原历史助手使用插值分位数及阈值以上样本均值,对任意离散样本不等于精确积分ES;债券与混合反例单独拆分原子。

平方根时间法则假设零均值、独立同分布正态的可加日损失;非零收益均值按天数线性累加。历史十日量是重叠简单日收益之和,不是复利财富变化;差距不能唯一归因于自相关或波动聚集。期权二阶近似省略theta,完全估值减少一天期限,故两者差异不只代表gamma近似误差;五点波动冲击施于全部路径。

GJR每次重估段的初始方差使用含部分评估期收益的片段,因此结果并非严格只依赖过去信息的预测验证。未拒绝选定检验不等于模型正确、适用或彼此等价。日历年度红黄次数不等于监管滚动250日窗口。Z2的两种iid临界值不是分布无关定理。

超阈值极限定理需要适当最大吸引域;边际极限与相关样本推断不同,过滤不保证残差独立。拟合正形状并不证明真实总体幂律。xi约0.1967给出拟合指数约5.08,不能据此声称五阶矩必定无限;严格低于、严格高于指数及等于指数的边界问题应分开。有限ES需xi<1。Hill使用前k大值相对于第k+1大值的比率。

行业1%共突破是有限阈值统计,不是渐近尾部相依系数;高斯系数为零不表示联合危机不可能或高级分层无风险。Copula潜在相关参数不必等于边际非线性变换后的Pearson相关。条件崩盘相关度对应另一个条件总体,不能把差距全部识别为偏差。压力距离用1990–2020协方差,早期危机属于回顾对比;Mahalanobis距离不是一维正态尾概率。重排数值是有限网格、有上端截断与迭代上限的启发式,不是全局最优或连续界的认证。

网络只运行一个种子,参数冻结,而比较模型自适应;65个交易年约有164个名义1%尾部观测,不是650个。DM采用五阶HAC近似,其非拒绝不是等价证明,也不识别模型结构的因果优劣。未来输入或残差模型只是研究方向,没有新增训练。

ES不可单独严格评分引出,不等于不能回测。校准检验、模型验证与一致评分比较是不同任务。Pinball在原子处使用次梯度;唯一分位数才给出唯一严格最优。FZ0在负尾域及唯一连续分位数、有限矩等条件下可共同引出VaR和ES。单位乘c会使绝对分数加log(c),差分保持不变;绝对水平不是字面上的无单位。QLIKE针对适当条件二阶矩,不是未知均值的无条件方差。Expectile分类须说明符号、无原子丰富空间与正则性。

巴塞尔2019要求十日风险因子变化形成基础ES,不能由一天ES简单开方缩放。原缓存表正是后者,故只作为单期限缩放示例,不是合规十日基数或完整资本。显示类别按2019表修正:大盘股价10日;投资级主权利差及大盘股波动20日;高收益主权、投资级公司利差40日;高收益公司利差及小盘股波动60日;信用利差波动120日。P&L归因比较风险理论与假设静态组合P&L,不是简单比较实际前台交易损益。本段不认证当前本地法规。平方根冲击若表示终点价格冲击,平均执行成本需沿数量积分;选定轨迹下为终点的三分之二。

Build the film

python -m videos.quant.quant40.compute      # the part's numbers, into .cache/quant40
python tools/make.py quant40                # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant40 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/quant/quant40. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.