Wednesday 2 September 2026

Quant interview

Exchanging one stock for another without knowing the interest rate

hard · Risk-neutral pricing and choice of numeraire

Work in a Black–Scholes market on [0,T] with a constant short rate r and money-market account Bt=ert. Two non-dividend-paying stocks follow, under the risk-neutral measure Q (numeraire B),

dSt1=rSt1dt+σ1St1dWt1,

dSt2=rSt2dt+σ2St2dWt2,

where W1,W2 are Q-Brownian motions with d⟨W1,W2⟩t=ρdt, and σ1,σ2>0, ρ∈(−1,1) are constant. Consider the exchange option that pays (ST1−ST2)+ at time T; its time-0 value is V0=e−rT𝔼Q[(ST1−ST2)+].

  1. Show that St2/Bt is a strictly positive Q-martingale, and use it to define the measure Q2 (asset 2 as numeraire) by dQ2dQ|ℱt=St2S02ert. Prove that V0=S02𝔼Q2[(YT−1)+], where Yt=St1/St2.

  2. Using Girsanov's theorem, find the dynamics of Yt under Q2. Show that Y is a driftless geometric Brownian motion with volatility σ^=σ12−2ρσ1σ2+σ22, and observe that r has dropped out entirely.

  3. Deduce the closed-form price V0 (Margrabe's formula). Then evaluate it numerically for S01=$100, S02=$95, σ1=0.20, σ2=0.30, ρ=0.4, T=1.

Solution

The numeraire change (part 1)

Since St2=S02exp((r−12σ22)t+σ2Wt2), we have

St2Bt=S02exp(−12σ22t+σ2Wt2).

This is S02 times a Doléans–Dade exponential ℰ(σ2W2)t, hence a strictly positive Q-martingale (the drift r cancels precisely because S2 is a discounted tradeable). Its normalized version

Zt:=St2S02ert=exp(−12σ22t+σ2Wt2),Z0=1,

is a legitimate Radon–Nikodym density process, so Q2 is well defined and equivalent to Q.

The general change-of-numeraire pricing formula says: if N is the price of a strictly positive self-financing tradeable and QN is the associated measure, then for any ℱT-payoff HT,

V0N0=𝔼QN[HTNT].

Take N=S2, HT=(ST1−ST2)+. Then HT/ST2=(ST1/ST2−1)+=(YT−1)+, so

V0=S02𝔼Q2[(YT−1)+].

The key insight here — the one candidates miss — is to deflate by S2 rather than by B. It collapses a two-asset problem to a one-dimensional option on the single ratio Y, and it will make r vanish.

Dynamics of the ratio under Q2 (part 2)

Under Q, applying Itô to the logs,

dlnSt1=(r−12σ12)dt+σ1dWt1,

dlnSt2=(r−12σ22)dt+σ2dWt2,

so that

dlnYt=12(σ22−σ12)dt+σ1dWt1−σ2dWt2.

Girsanov: the density Z has log-martingale part σ2W2, so under Q2 each Brownian motion is shifted by its covariation rate with σ2W2. Since d⟨W2,σ2W2⟩=σ2dt and d⟨W1,σ2W2⟩=ρσ2dt,

W~t2=Wt2−σ2t,W~t1=Wt1−ρσ2t

are Q2-Brownian motions (with the same correlation ρ). The step a hurried candidate botches is the shift of W1: it must move by ρσ2dt, not zero. Substituting dW1=dW~1+ρσ2dt and dW2=dW~2+σ2dt,

dlnYt=[12(σ22−σ12)+ρσ1σ2−σ22]dt+σ1dW~t1−σ2dW~t2.

The drift is

−12(σ12−2ρσ1σ2+σ22)=−12σ^2,

while the martingale part σ1dW~1−σ2dW~2 has variance rate σ12−2ρσ1σ2+σ22=σ^2. Writing it as σ^dW~ for a single Q2-Brownian motion W~,

dlnYt=−12σ^2dt+σ^dW~t⟺dYt=σ^YtdW~t.

So Y is a driftless GBM — a Q2-martingale, exactly as required, since S1/S2 is the price of a tradeable (S1) deflated by the numeraire (S2). The short rate r has cancelled: it never appears in σ^, in the drift, or anywhere in the reduced problem.

Closed form and number (part 3)

𝔼Q2[(YT−1)+] is a Black–Scholes call on an underlying starting at Y0=S01/S02, with strike 1, volatility σ^, and zero interest rate (there is no discounting left, because pricing is already expressed in units of the numeraire). Hence

𝔼Q2[(YT−1)+]=Y0N(d1)−N(d2),

d1=lnY0+12σ^2Tσ^T,d2=d1−σ^T.

Multiplying by S02 (and using S02Y0=S01),

V0=S01N(d1)−S02N(d2),d1=ln(S01/S02)+12σ^2Tσ^T,  d2=d1−σ^T,

with σ^=σ12−2ρσ1σ2+σ22. This is Margrabe's formula, and it is manifestly independent of r.

Numerics. With the given data,

σ^2=0.04−2(0.4)(0.2)(0.3)+0.09=0.082,σ^=0.2864.

ln(100/95)=0.05129,12σ^2T=0.0410,σ^T=0.2864.

d1=0.05129+0.04100.2864=0.3223,d2=0.3223−0.2864=0.0359.

N(d1)=0.6264,N(d2)=0.5143.

V0=100(0.6264)−95(0.5143)=62.64−48.86≈$13.78.

Closing note

The two things that separate candidates: (i) choosing S2 as numeraire so the payoff becomes a plain vanilla call on Y=S1/S2, and (ii) getting both Girsanov shifts right, which is what produces the cross term in σ^2=σ12−2ρσ1σ2+σ22. The tempting wrong answers are σ^=σ12+σ22 (forgetting the correlation cross term) and any formula containing r (from discounting under B instead of pricing in units of S2). A useful sanity check: at ρ→1 with σ1=σ2 the two stocks are perfectly locked together, σ^→0, and V0→(S01−S02)+, the deterministic payoff — as it must.

Statistics in machine learning

Absolute error is not a proper scoring rule

easy · Calibration and proper scoring rules

Let Y∈{0,1} with ℙ(Y=1)=q, and let a forecaster report a probability p∈[0,1]. Write ℓ¯(p;q)=𝔼Y~Bernoulli(q)[ℓ(p,Y)] for the expected score. A scoring rule ℓ is proper if p=q minimizes ℓ¯(p;q) for every q, and strictly proper if the minimizer is unique.

  1. Take the absolute score ℓ(p,y)=|p−y|. Compute ℓ¯(p;q) as an explicit function of p and q, and find the set of minimizers over p∈[0,1] as a function of q. Deduce that ℓ is not proper, and state exactly which q make the honest report p=q optimal.

  2. Take the Brier (quadratic) score ℓ(p,y)=(p−y)2. Compute ℓ¯(p;q), show it is uniquely minimized at p=q (so the rule is strictly proper), and give the excess expected score ℓ¯(p;q)−ℓ¯(q;q) in closed form.

Solution

Part 1: the absolute score

Since p∈[0,1] we have |p−1|=1−p and |p−0|=p, so

ℓ¯(p;q)=q|p−1|+(1−q)|p−0|=q(1−p)+(1−q)p.

Expanding,

ℓ¯(p;q)=q+(1−2q)p.

This is affine in p — the point a candidate can miss is that the modulus collapses to linear once p is restricted to [0,1]. A linear objective is minimized at an endpoint:

\argminp∈[0,1]ℓ¯(p;q)={{1},q>1/2,[0,1],q=1/2,{0},q<1/2.

So the optimal report is a hard decision (predict the more likely label with certainty), not the true probability q. The honest report p=q is optimal only when q∈{0,1} (endpoints, where the decision and the probability coincide) and, degenerately, when q=1/2 (every p ties). For all other q, reporting q is strictly worse than reporting 0 or 1.

Hence ℓ(p,y)=|p−y| is not a proper scoring rule: it rewards confident classification, not calibrated probabilities.

Part 2: the Brier score

ℓ¯(p;q)=q(1−p)2+(1−q)p2.

Expand:

ℓ¯(p;q)=q−2qp+qp2+(1−q)p2=q−2qp+p2.

Differentiate in p:

ddpℓ¯(p;q)=−2q+2p=2(p−q),

which vanishes at p=q, and d2dp2ℓ¯=2>0, so this is the unique global minimum. The Brier score is therefore strictly proper.

The optimal value is ℓ¯(q;q)=q−2q2+q2=q(1−q), and

ℓ¯(p;q)−ℓ¯(q;q)=(q−2qp+p2)−(q−q2)=p2−2qp+q2=(p−q)2.

So the excess expected score is

ℓ¯(p;q)−ℓ¯(q;q)=(p−q)2

the squared Euclidean distance between the report and the truth.

Closing note

The quadratic in p being minimized at p=q with excess (p−q)2 is the binary instance of the general fact that every strictly proper score induces a Bregman divergence as its excess loss: for the Brier score the generating convex function is −x(1−x) (giving squared distance), and for the log score ℓ(p,y)=−ylogp−(1−y)log(1−p) the excess is the KL divergence qlogqp+(1−q)log1−q1−p. The absolute score fails precisely because |p−y| has no strictly convex generator — its expectation is affine in p, so no interior point can be a strict minimizer.


Two new problems every morning at 8am · every day so far