This appendix provides worked solutions to the exercises at the end of each chapter. For derivation exercises the key steps are shown; for computational exercises the numerical answer is given; for conceptual exercises the principal arguments are outlined. Solutions to exercises marked as requiring the accompanying notebooks assume access to the code provided there.
(b) At y=5%: P′=28.57+27.21+25.92+24.69+887.00=913.41.
(c) Duration approximation (using Dmod≈4.45 from Exercise 2): ΔP≈−4.45×955.48×0.01=−42.52. Actual change: 913.41−955.48=−42.07. The approximation captures about 99% of the move; the residual is convexity.
(d) A bond’s cash flows are fixed. When yields rise, the present value of each cash flow falls, so the price falls. The longer the duration, the more sensitive the price.
Exercise 2 — Duration and DV01.
(a) Macaulay duration at y=4%:
Dmac=955.481(1.041⋅30+1.0422⋅30+1.0433⋅30+1.0444⋅30+1.0455⋅1030)=955.484,252≈4.45 years
(b) Quoted put P′=2.80>2.70: the put is overpriced. Arbitrage: sell the put, sell the bond (borrow Ke−rT), buy the call, and buy the stock short. More precisely — sell put, buy call, short stock, invest Ke−rT at the risk-free rate. At T: call-put spread replicates the forward and the invested cash repays K.
(c) At ST=95: call expires worthless (CT=0); put you sold pays out 100−95=5; short stock gains 102−95=7; bond investment returns 100. Net: −5.20+2.80+(102−95)−(100−99.50)=−5.20+2.80+7.00−0.50=$4.10 profit at time 0 + riskless position at T. The actual arbitrage profit is the initial mis-pricing 2.80−2.70=$0.10 per share, risklessly locked in at inception.
Exercise 4 — Forward pricing.
(a) No-arbitrage forward: F=(S0−De−rtD)erT with tD=1/12, T=6/12=0.5.
(c) F′=51>49.74: the forward is overpriced. Cash-and-carry: borrow S0−De−rtD=49.00 today, buy the stock, enter a short forward. At T=0.5: receive F′=51 from the forward, repay loan 49.00×e0.03×0.5=49.74. Riskless profit: 51−49.74=$1.26 per share.
(b) s^=20.000167=2×0.01291=0.0258 (2.58 bps half-spread or 5.2 bps full spread).
(c) The Roll estimator recovers the transaction cost component of the spread (the bid-ask bounce). It misses the information component (adverse selection cost), which does not generate mean reversion in prices. It fails when: the spread is asymmetric, there is autocorrelation in order flow, or prices trend persistently.
(b) Market maker sets price P=λK⋅q=0.25×2.0=0.50 above the prior mean.
(c) A larger λK means the market maker moves the price more aggressively per unit of order flow, reflecting a higher information ratio σv/σu. This corresponds to a less liquid market with more informed relative to noise trading.
Exercise 3 — LOB impact.
(a) A buy order of 400 shares fills: 200 at Pa, 150 at Pa+$0.01, 50 at Pa+$0.02.
(c) Refilling within 5 seconds indicates high resiliency: the book quickly recovers its depth after a large order, implying competitive market-making and active liquidity provision.
(d) In an RfQ bond market of the same notional, there is no public order book to consume: the dealer quotes a two-way price directly. The transaction cost is the dealer’s bid-ask spread, not the slippage through a book. Price impact is borne by the dealer’s inventory, not immediately visible pre-trade.
Exercise 4 — Market mechanism comparison.
Electronic CLOB
RfQ (3 dealers)
Pre-trade transparency
Full book visible
No book; only price from responding dealers
Liquidity provider risk
Adverse selection from faster traders
Inventory + information asymmetry from client
Normal conditions
Tight spread, instant execution
Competitive quotes, 5–10 bps spread
Stressed conditions
Depth evaporates, large slippage
Dealers widen or decline; harder to execute
The CLOB is preferred for standardised liquid instruments (on-the-run government bonds, equity futures) with many participants. The RfQ protocol is preferred for less liquid instruments (credit, off-the-run govvies) where dealers internalise risk and pre-trade transparency would disadvantage liquidity providers.
(a) With prior Beta(1,1) and k=14 heads from n=20: posterior is Beta(1+14,1+6)=Beta(15,7).
(b) Posterior mean: 15/(15+7)=15/22≈0.682. MLE: 14/20=0.70. The posterior is shrunk toward 0.5 by the prior.
(c) The 95% credible interval is the 2.5th–97.5th percentile of Beta(15,7): approximately [0.46,0.87] (via standard beta quantile).
(d) Starting from Beta(15,7) and adding m fair tosses, the posterior becomes Beta(15+m/2,7+m/2) in expectation, with mean (15+m/2)/(22+m). Setting this equal to 0.5+0.01=0.51 and solving: (15+m/2)=0.51(22+m), giving 15+m/2=11.22+0.51m, so 3.78=0.01m, m≈378 additional tosses.
Exercise 2 — BLR predictive distribution.
(a) The posterior is p(w∣D)=N(mN,SN) where SN−1=αI+βΦTΦ and mN=βSNΦTy. The predictive mean is μ∗=mNTϕ∗ (linearity of expectation over the Gaussian posterior). The predictive variance σ∗2=β−1+ϕ∗TSNϕ∗ has two terms: aleatoric noise (β−1) and epistemic uncertainty about w.
(b) With Φ=⎝⎛1110.20.50.8⎠⎞, y=(1.1,2.3,2.9)T, α=1, β=10:
SN−1=(1001)+10(31.51.50.93)=(31151510.3), so SN≈(0.0837−0.1218−0.12180.2516).
mN=10SN(6.34.19)≈(0.1763.08).
At x∗=0.5, ϕ∗=(1,0.5)T: μ∗=0.176+3.08×0.5=1.716. σ∗2=0.1+[0.0837−2(0.5)(0.1218)+0.25(0.2516)]=0.1+0.0215=0.1215.
Exercise 3 — d-separation.
(a) Paths between B and C: only one — B←A→C (a fork at A) and B→D←C (a collider at D).
(b) Given ∅: the fork B←A→C is open (the common cause A is not conditioned on), so B and C are not d-separated. Given {A}: the fork path B←A→C is blocked; the collider path B→D←C remains blocked (not conditioning on D). So B⊥C∣A. Given {D}: the fork path B←A→C is open; the collider path B→D←C is now opened by conditioning on D. So B and C are not d-separated given {D}.
(c) Conditioning on a collider activates the path between its parents, inducing a spurious correlation — the “explaining away” effect. This is counter-intuitive: conditioning on more variables can create dependencies.
Exercise 4 — EM convergence to k-means.
(a) The responsibility γn,k∝πkexp(−∥xn−μk∥2/(2ϵ)). As ϵ→0, the exponential is dominated by the nearest centroid: γn,k∗(n)→1, γn,k→0 for k=k∗(n).
(b) The M-step centroid update μk=∑nγn,kxn/∑nγn,k becomes, in the hard-assignment limit, μk=∣Ck∣1∑n∈Ckxn — exactly the k-means centroid update.
(c) Both k-means and EM for GMMs converge only to local minima of their respective objectives. The initialisation strongly affects the final solution; multiple random restarts are standard practice.
(a) A to E: paths go through D (via B or C). All paths from A to E pass through D. Conditioning on D blocks the direct chain A→⋯→D→E, but opens the collider at D (B→D←C), creating a new path A→B→D←C←A. However, this path already goes through A itself. Net result: conditioning on D blocks the A→{B,C}→D paths since D is a descendant. But D is a collider on the path B→D←C. So: conditioning on D opens B–C but does not help A–E. The path A→B→D→E is blocked at D (conditioned on). Similarly A→C→D→E. So yes, A is d-separated from E given {D} — all paths from A to E pass through D and are blocked.
(b) Path from B to C: B←A→C (fork at A). Conditioning on A blocks this fork. No other path exists (the collider B→D←C is not opened since we do not condition on D). Yes, B⊥C∣A.
(c) Without conditioning: the fork B←A→C is active. B and C are not d-separated given ∅.
Exercise 2 — Back-door criterion.
(a) Back-door paths from δ to H (entering δ via a non-descendant): δ←σ→H and δ←CF→H.
(b) {σ,RF,CF} satisfies the back-door criterion: (i) no node in the set is a descendant of δ; (ii) every back-door path (δ←σ→H and δ←CF→H) is blocked by the set (both σ and CF are in it). RF is included because it directly affects H and controls for additional variation, though strictly only {σ,CF} is a minimal adjustment set.
(b) Apply Rule 2 with GXX: removing arrows into X gives a graph where Z is d-separated from Y given X along the path through X (since the edge X→Y remains and Z→X is removed but Z→Y remains). Formally, Rule 2 says P(Y∣do(X),Z)=P(Y∣X,Z) when (Y⊥Z∣X)GX — here the graph with arrows into X removed has Z→Y and X→Y, and Z is no longer a cause of X. Marginalising over Z: P(Y∣do(X=x))=∑zP(Y∣X=x,Z=z)P(Z=z).
(c) This is exactly the back-door formula with Z as the adjustment set — the unique back-door path X←Z→Y is blocked by conditioning on Z.
Exercise 4 — Counterfactual reasoning.
(a) P(H=0∣δ′=8)=P(δres<8)=8/20=0.40.
(b) Abduction: given H=0 and δ′=8, we infer δres<8, i.e., U<8/20=0.4. Posterior: U∣(H=0,δ′=8)∼Uniform[0,0.4], so δres∣observed miss∼Uniform[0,8].
(c) Action: set δ=5. Prediction: P(Hδ=5=1∣H=0,δ′=8)=P(δres≥5∣δres∼U[0,8])=3/8=0.375.
(d) Interventional: P(H=1∣do(δ=5))=P(δres≥5)=15/20=0.75. The counterfactual (0.375) is lower because it conditions on the fact that this specific client’s reservation spread was already revealed to be below 8 bps — a harder-to-win client than average. The interventional ignores this individual-level evidence.
Introduction to Bayesian Probability and Stochastic Calculus¶
Stochastic Calculus — Exercise 1 (Crank–Nicolson and inflation targeting).(Numerical — see notebook.)
Dynamics xk+1=xk−uk, cost ∑uk2, terminal cost Ax32 with A→∞.
Riccati backward: P3=A→∞. Gain K2=P3/(1+P3)→1, P2=P3(1−K2)=0 — wait: standard LQSC gain Kk=BTPk+1B(R+BTPk+1B)−1 with B=1, R=1, Q=0:
K2=P3/(1+P3)→1; P2=Q+ATP3A−K2P3=P3(1−K2)→0.
K1=P2/(1+P2)=0, so u1∗=0. Similarly K0=0. The only non-trivial control is u2∗=x2 (liquidate everything in the last period), i.e., uk∗=xk/3 for each k — the equal-slicing TWAP schedule, as required.
Exercise 2 — Euler–Lagrange for general f(t), g(t).
L=x˙2/f(t)+λg(t)x2. Euler–Lagrange: dtd∂x˙∂L−∂x∂L=0 gives dtd(2x˙/f)−2λgx=0, or x¨/f−x˙f˙/f2=λgx. For f=η, g=σ2 constant: x¨/η=λσ2x, i.e., x¨=κ2x with κ2=λσ2/η — the Almgren–Chriss equation.
N=2: P1=P2−P22/(P2+η)=ηP2/(P2+η) where P2=Aterm; K0=P1/(P1+η)=Atermη/((Aterm+η)(η+Atermη/(Aterm+η))). As Aterm→∞: u0∗=X/2 (equal split over 2 periods — TWAP).
Exercise 5 — Certainty equivalence.
In LQSC the optimal gains Kk depend on Pk which satisfies the deterministic Riccati recursion — no σ2 term enters because the noise σwk has zero mean and does not affect the minimisation of the quadratic cost. The Bellman equation separates cleanly: Vk(x)=xTPkx+ck where ck accumulates the noise variance, but Pk and hence Kk are identical to the deterministic problem. This relies on: (i) linearity of dynamics (noise enters additively), (ii) quadratic cost (cross terms vanish under expectation), (iii) Gaussian noise (higher moments don’t enter). For ∣ut∣ cost (not differentiable), the certainty equivalence fails because the optimal policy depends on the full distribution of the state.
Exercise 6 — HJB for market making.(Conceptual — setup only.)
State variables: (t,qt,St). Control: δt. The HJB equation for J(t,q,S)=supδE[∫0Tδtλ(δt)dt−ϕqT2∣qt=q,St=S] is:
with terminal condition J(T,q,S)=−ϕq2. The state space is low-dimensional; standard treatments (Avellaneda-Stoikov) further reduce it by assuming J(t,q,S)=Sq+u(t,q) and show that the optimal depth δ∗ depends only on (t,q).
The stationary mean: λˉ=μ+ϕλˉ/β (since in stationarity E[λ(t)]=μ+ϕE[∫−∞te−β(t−s)λ(s)ds]=μ+(ϕ/β)λˉ). Solving: λˉ(1−ϕ/β)=μ, giving λˉ=μβ/(β−ϕ). For convergence we need 1−ϕ/β>0, i.e., ϕ<β.
For (μ,ϕ,β)=(0.5,1.5,2.0): λˉ=0.5×2.0/(2.0−1.5)=2.0. (Empirical verification: see notebook.)
Exercise 2 — Square-root impact.
MI=YσQ/ADV with Y=0.7, σ=1%, ADV=106:
Q=103: MI=0.7×0.01×10−3=0.7×0.01×0.0316=0.022%.
Q=104: MI=0.7×0.01×0.1=0.07%.
Q=105: MI=0.7×0.01×0.316=0.221%.
Doubling order size multiplies impact by 2≈1.41. Trading twice as fast with the same order means executing Q/2 twice; total impact is 2×YσQ/(2ADV)=2 times the single-trade impact — the same! The square-root model implies no benefit from splitting a given quantity over faster intervals at the same participation rate.
Exercise 3 — Fill probability MLE.(Computational — see notebook.)
Likelihood of censored exponential: ℓ(A,k)=∑i:filledlog(Ae−kδi)−Ae−kδiτi+∑i:censored(−Ae−kδiτmax). Gradient ascent or scipy.optimize recovers (A,k) close to (2.0,1.0).
Exercise 4 — Order imbalance predictor.(Computational — see notebook.)
Exercise 5 — PIN estimation.(Computational — see notebook.)
Exercise 6 — Agent-based model calibration.(Computational — see notebook.)
P(a=1∣D=01100,p,θ): the sequence 01100 has 2 hits in 5 attempts. Writing the likelihood explicitly for each sequence using the informed/uninformed model, the number of buy signals, sell signals, and non-events determines the posterior — not their order. Since both 10100 and 01100 contain exactly 2 hits and 3 misses, the posterior P(a=1∣counts,p,θ) is identical. (Formal proof: expand the Bayesian update summing over the order-insensitive sufficient statistics.)
Exercise 2 — Hit probability with causal adjustment.(Numerical integration.)
Under higher volatility σ∼U[1.5,4.0], the term −0.5σ shifts the logistic argument left, reducing f(δ) for all δ, and the optimal spread widens slightly (higher vol reduces hit probability so the dealer compensates by extracting more per trade).
(c) Counterfactual at δcf=4: P(H4=1∣H=0,δ′=7)=P(δres≥4∣δres∼U[0,7])=3/7≈0.429.
(d) Expected revenue of counterfactual: 4 bps×500,000×0.429/10,000=$857 (where bps of notional = notional/10000). Revenue potential = $857. This differs from the interventional 4×f(4)×500,000/10,000 because the counterfactual conditions on this specific client being harder to win (reservation spread below 7 bps already established), giving a lower probability than the population average f(4).
Exercise 4 — Attrition risk.
(a) Out of 500 RfQs where the dealer was best-priced: 800 — wait, 420 trades from 500. Of the 80 misses: 60 timed out, 20 traded away. Attrition rate p^att=120/500=0.24 (or 60/80=0.75 of missed quotes were attrition). Conditional hit rate given no attrition: 420/(500−120)=420/380≈1.105 — this is impossible, suggesting the 120 timed-out/cancelled should be excluded from the denominator: p^hit=420/(500−120)=420/380. Re-reading: 800 hits from 1000 — the problem says 1000 RfQs, 800 hits, 120 timed-out, 80 cancelled. p^att=(120+80)/1000=0.20. Conditional hit rate: 800/800=1.0 — that can’t be right either. The 800 hits + 120 timeout + 80 cancel = 1000. The naive win rate is 800/1000=80%. The attrition-corrected estimate excludes attrition: 800/(1000−200)=800/800=100%. This is an extreme example; in practice attrition does not correlate perfectly with winning, so the attrition-corrected rate is 800/(800+trades missed to competitors), which the data doesn’t separate. The key lesson is (b).
(b) A dealer that is consistently the best-priced but still sees misses due to attrition will count those misses in her denominator, underestimating her true competitive hit rate. If response latency is correlated with attrition probability, slow dealers have systematically downward-biased win rates that do not reflect their pricing quality.
(c) Attrition should enter the spread optimisation as a separate term: the effective hit probability is f(δ)⋅(1−patt(latency)). A dealer who can reduce latency increases effective f(δ) without changing the pricing model, enabling tighter competitive spreads.
Exercise 5 — Axe matching.
(a) Bond A (axe match = 1, buy order reduces short): sA=2(1)−0.5(3)=2−1.5=0.5. Bond B (axe match = 0, no inventory benefit): sB=2(0)−0.5(4)=−2.
(b) Bond A has higher priority. The dealer should respond aggressively to Bond A — even tightening the spread slightly below the market to secure the axe trade, since reducing the short inventory has a risk benefit that offsets the smaller spread.
(c) Axe matching is equivalent to adjusting the reservation spread downward by α/β×δquoted for trades that reduce inventory risk, or equivalently, adding an inventory-reduction premium to the revenue from the trade. The scoring system makes this adjustment explicit and computable.
For two predictors s^1,s^2 with variances σ12,σ22 and covariance σ12, the combined predictor s^=ws^1+(1−w)s^2 has variance Var(s^)=w2σ12+(1−w)2σ22+2w(1−w)σ12. Minimise over w:
For uncorrelated predictors: w∗=σ22/(σ12+σ22) — the inverse-variance weighting. The correlated case reduces to the same form after projecting out the shared component.
Exercise 2 — BSM via option–option hedging.
Hedging portfolio Πt=ΔtC2+βt. Self-financing: dΠt=ΔtdC2+rβtdt. Requiring ΠT=C1: apply Itô to C1 and C2 under GBM dS=rSdt+σSdW and match the Brownian components to eliminate risk:
Δt=∂C2/∂S∂C1/∂S.
The remaining deterministic drift condition yields rCi=∂t∂Ci+rS∂S∂Ci+2σ2S2∂S2∂2Ci for each i=1,2 — the BSM PDE. The connection to the market price of risk: both options have the same underlying, so they must have the same λmpr=(μ−r)/σ for the resulting PDE to be internally consistent.
Exercise 3 — Roll estimator and Kalman.
The autocovariance of first differences Δpt=pt−pt−1 under the random walk with noise model: pt=st+ϵt (mid + noise), st=st−1+νt. Then Δpt=νt+ϵt−ϵt−1, so Cov(Δpt,Δpt−1)=−σϵ2 (only the overlap in ϵt−1 contributes). Thus σ^ϵ2=−Cov(Δpt,Δpt−1) and the Roll spread s=2σ^ϵ gives s2/4=−Cov(Δpt,Δpt−1), matching the Roll formula. The Roll estimator assumes: (i) the mid-price is a random walk, (ii) trade direction is serially uncorrelated, (iii) no information asymmetry in the spread. It breaks down when trades are autocorrelated (momentum or mean reversion in order flow) or when informed trading causes the mid to drift persistently after a trade.
Exercise 4 — Vasicek bond pricing.
(a) Substitute B(τ)=(1−e−κτ)/κ and the corresponding A(τ) (standard form) into the Riccati ODE system B˙=1−κB, A˙=21σ2B2−(κθ−λ0σ)B. Both satisfy the ODEs by direct differentiation.
(b) As κ→0: B(τ)→τ, and A(τ)/τ→−rtτ+2σ2τ2−6σ2τ3. The bond price P=eA−Brt→exp(−rtτ+6σ2τ3) — matching the Ho-Lee model up to the cubic variance term.
Exercise 5 — Utility indifference price limits.
For small γ: the certainty equivalent Ct satisfies e−γCt=Et[e−γΠT]. As γ→0: expand e−γΠT≈1−γΠT+O(γ2), so Et[e−γΠT]≈1−γEt[ΠT], and e−γCt≈1−γCt. Thus Ct≈Et[ΠT]=e−r(T−t)EQ[f(ST)] (the BSM price, since the delta-hedged P&L under BSM is ΠT=f(ST) in expectation under the risk-neutral measure).
For large γ: e−γΠT is dominated by the worst-case path. Ct=−γ1logEt[e−γΠT]→e−r(T−t)infωf(ST(ω)) (the worst-case payoff) by the Laplace principle for large γ.
Exercise 6 — SDF and CAPM.
(a) From E[mRf]=1: Rf(a−bE[RM])=1. From E[mRM]=1: aE[RM]−b(E[RM]2+Var(RM))=1. Solving the 2×2 system: b=(E[RM]−Rf)/(RfVar(RM)); a=(1+bE[RM])/Rf.
(b) For asset i: 1=E[mRi]=aE[Ri]−b(E[RM]E[Ri]+Cov(Ri,RM)). From 1=E[mRf]=aRf and 1=E[mRM]: E[Ri]−Rf=bCov(Ri,RM)/a⋅a=bCov(Ri,RM)⋅Rf... more cleanly: E[Ri]−Rf=Cov(RM,m)Cov(Ri,m)(E[RM]−Rf)=βi(E[RM]−Rf).
(c) For m=a−bRM to be a valid SDF it must be strictly positive: a>bRM for all realisations of RM. Since RM can in principle be unbounded, this requires truncating the market return distribution or accepting approximate validity.
Exercise 7 — Put-call parity from SDF.
(a) (ST−K)+−(K−ST)+=ST−K identically (signed payoff of a forward). Taking SDF expectations:
(b) The essential property is linearity of the pricing functional Et[mt,T⋅] — the SDF must price all assets consistently (law of one price).
(c) Put-call parity holds in any incomplete market as long as both the call and put can be priced by the same SDF. Even when markets are incomplete (multiple EMMs), put-call parity is a model-free no-arbitrage condition requiring only the existence of a replicating strategy for the forward — not the option itself.
Exercise 8 — Kalman steady state.
In steady state Kt=K constant. The Kalman update: s^t=s^t−1∣t−1+K(pt−s^t−1∣t−1)=(1−K)s^t−1+Kpt — an EWMA with smoothing constant K. The Kalman gain K=σν2/(σν2+σϵ2). Equal weighting K=1/2 requires σϵ2=σν2.
Exercise 1 — Roll estimator on simulated data.(Computational — see notebook.)
Exercise 2 — Amihud ratio.(Computational — see notebook.)
Exercise 3 — Composite liquidity scores.(Computational — see notebook.)
Exercise 4 — Inventory rotation time.
τ1/2 decreases with higher arrival rate A (faster turnover), larger average size xˉ (each trade reduces more inventory), and higher p0 (proportion of two-way flow). It increases with higher volatility σ (wider quotes needed) and lower α (steeper fill-probability curve, fewer fills per unit time). An on-the-run sovereign bond has high A, large xˉ, low σ → short τ1/2. An off-the-run corporate has low A, small xˉ, high σ → long τ1/2 and material inventory carrying cost.
Exercise 5 — Intraday Amihud pattern.(Computational — see notebook.)
Single market order: MI=YσQ/ADV=1×0.015500,000/2,000,000=0.015×0.5=0.75%.
TWAP (12 slices of Q/12): impact per slice =0.015(500,000/12)/2,000,000=0.015/12=0.00433%. Total expected temporary impact: 12×0.00433%=0.0520%. TWAP reduces expected impact by a factor of 1/N=1/12≈0.29 but introduces timing risk.
IS cost = (50.15 − 50.00)/50.00 × 10,000 bps + 1 bp = 30 bp + 1 bp = 31 bp.
VWAP cost = (50.15 − 50.10)/50.10 × 10,000 = 9.98 bp vs market VWAP.
IS P&L = −31 bp (cost to the buyer).
Exercise 3 — Trader’s dilemma.(Conceptual.)
Reducing timing risk requires executing faster (higher participation rate), which increases market impact. Reducing market impact requires executing slower, which increases exposure to adverse price drift. The two objectives are in tension because they require opposite adjustments to the trading rate. The efficient frontier makes this tradeoff explicit: every point minimises risk for a given expected cost. The frontier degenerates to a single point only if the market impact function is linear and the timing risk is zero (no price uncertainty), which never holds in practice.
Exercise 4 — Broker guaranteed VWAP.(Conceptual.)
The broker prices the guarantee by modelling its own expected VWAP performance distribution. The “+5 bps” represents a margin above the broker’s internal expected execution cost that covers: (i) the expected tracking error, (ii) a risk premium for adverse market moves, and (iii) the broker’s profit margin. The broker bears replication risk: if market conditions deteriorate and it cannot achieve its internal VWAP estimate, it absorbs the loss.
Exercise 5 — PoV strategy.
In the first 5 minutes: 0.10×50,000=5,000 shares executed. For completion: need 500,000 total shares. At ρ=10% participation and total market volume =3,000,000: algorithm executes 0.10×3,000,000=300,000<500,000 shares. The order is not completed: residual = 200,000 shares. Opportunity cost in IS: the unexecuted residual is valued at the final market price minus the arrival price, representing the cost of failing to trade.
When an algorithm is large relative to market volume, its own trades inflate the VWAP it is measured against. By trading more aggressively, it raises the benchmark, paradoxically improving its measured performance without reducing its true cost. This constitutes potential market manipulation (painting the tape or benchmark gaming) and is prohibited under MiFID II and equivalent frameworks.
Price model dSt=σdWt−γvtdt, execution price Pt=St−ηvt. Cash proceeds from selling: ∫0TPtvtdt=∫0T(St−ηvt)vtdt. IS = S0X−∫0TPtvtdt. Substituting St=S0−γ∫0tvsds+σWt: E[IS]=η∫vt2dt+γX∫0Tvt∫0tvsdsdt. The second term: integration by parts on ∫0Tvt∫0tvsdsdt=21(∫0Tvtdt)2=X2/2. Hence E[IS]=η∫vt2dt+2γX2.
Exercise 2 — IS variance.
Var[IS]=σ2Var[∫0TvtWtdt]=σ2∫0T(∫tTvsds)2dt=σ2∫0Txt2dt where xt=∫tTvsds is the remaining inventory. The last equality uses Itô isometry after integration by parts: ∫0TvtWtdt=−∫0TxtdWt.
Exercise 3 — Almgren–Chriss trajectory.
ODE x¨=κ2x has general solution xt=Aeκt+Be−κt. Boundary conditions x0=X, xT=0: A+B=X, AeκT+Be−κT=0. Solving: xt∗=Xsinh(κ(T−t))/sinh(κT). Verify: x0∗=Xsinh(κT)/sinh(κT)=X ✓; xT∗=Xsinh(0)/sinh(κT)=0 ✓.
Exercise 4 — Numerical AC computation.
σ=0.02, η=10−5, λ=10−4, T=1 day, X=106.
κ=λσ2/η=10−4×4×10−4/10−5=4×10−3=0.0632 day−1.
κT=0.0632. Since κT is small, the trajectory is nearly linear (close to TWAP).
Initial rate v0=κXcosh(κT)/sinh(κT)=κX/tanh(κT)≈X/T×(1+(κT)2/3) — only ~0.13% faster than TWAP.
First quarter (t=T/4): xT/4∗=Xsinh(3κT/4)/sinh(κT)≈75%X — very close to the TWAP fraction.
Exercise 5 — TWAP limit of IS.
As κ→0: sinh(κt)≈κt, vt∗=κXcosh(κ(T−t))/sinh(κT)→X/T. Then η∫0Tvt2dt→ηX2/T and σ2∫0Txt2dt→σ2X2T/3. Expected cost →γX2/2+ηX2/T: the permanent impact is constant (path-independent); the temporary impact falls as T grows (slower execution is cheaper). Variance →σ2X2T/3: grows with T because more time means more exposure to random price drift.
Exercise 6 — Dynamic VWAP reduces to static.
With Vn=0, Qn=0, En[⋅]=E0[⋅]: qn∗=Π(0+E0[vn])/E0[VM]−0=ΠE0[vn]/E0[VM]=qnstatic. ✓
Exercise 7 — Two-asset portfolio eigenmodes.
K2=λH−1Σ with H=ηI, Σ=σ2(1ρρ1). K2=(λσ2/η)(1ρρ1). Eigenvalues: κ±2=(λσ2/η)(1±ρ). Eigenvectors: (1,1)T/2 (sum) and (1,−1)T/2 (difference). The sum mode has κ+2>κ−2 (for ρ>0), so it is more aggressive: correlated assets must be traded faster together to control correlated risk. The difference (spread) mode has lower risk and can be executed more slowly.
Define Cγ=k+γA(k+γk)k/γ. The reduced ODE for q=1 is ∂τH=Cγe−kH (since ΔH=H(τ,1)).
Substitute H(τ,1)=k−1ln(e−kb+kCγτ):
∂τH=k(e−kb+kCγτ)kCγ=e−kb+kCγτCγ.
Cγe−kH=Cγ⋅(e−kb+kCγτ)−1. These match ✓.
Initial condition: H(0,1)=k−1ln(e−kb)=−b ✓.
Risk-neutral limit. As γ→0: Cγ→kA⋅e(k/γ)ln(k/(k+γ))=kA⋅e−1=A/(ek) (using limγ→0γkln(1−γ/(k+γ))=−1). Substituting: H→k−1ln(e−kb+Aτ/e), the risk-neutral solution ✓.
Limits.τ→0: H→−b, so δ∗(0,1)=γ1ln(1+γ/k)−b. This is a market order when b>γ1ln(1+γ/k); since the right-hand side is decreasing in γ, high risk aversion makes market orders more likely at deadline. τ→∞: H→∞ and δ∗→∞ — with unlimited time, even a risk-averse agent posts very passively.
Exercise 2 — Urgency monotone in inventory.
(a) δ∗(t,q)=γ1ln(1+γ/k)+ΔH(t,q) with ΔH(t,q)=H(t,q)−H(t,q−1). Since H(t,q) is concave in q (the certainty equivalent is a decreasing, concave function of inventory), ΔH(t,q)≤ΔH(t,q−1), i.e., δ∗(t,q)≤δ∗(t,q−1). The risk-comfort depth γ1ln(1+γ/k) is inventory-independent, so the monotonicity follows entirely from the monotonicity of ΔH.
(b) As t increases (time runs out, τ=T−t decreases), the urgency penalty intensifies: H(t,q) becomes more negative and ΔH becomes more negative. Hence δ∗(t,q) decreases — the tactic posts shallower as deadline approaches. At the limit τ→0: δ∗(0,q)=γ1ln(1+γ/k)−b<0 for b large enough, triggering a market order.
Exercise 3 — Two-venue SOR under CARA utility.
(a) The CARA FOC for each venue gives δk∗=γ1ln(1+γ/kk)+ΔH. With A1=2, k1=0.5, A2=0.5, k2=2.0, and risk aversion γ fixed:
δ1∗=γ1ln(1+2γ)+ΔH; δ2∗=γ1ln(1+γ/2)+ΔH.
The liquid venue (small k1=0.5) attracts a deeper passive placement; the illiquid venue (large k2=2.0) is approached more aggressively.
(b) For ΔH=−1 and γ=2: δ1∗=21ln(5)+(−1)=0.805−1=−0.195 (market order); δ2∗=21ln(2)−1=0.347−1=−0.653 (aggressive market order). Both venues attract market orders at this urgency level. Fill rates at δk∗=0 (constrained): λ1(0)=2, λ2(0)=0.5; total =2.5/min. On venue 1 alone: λ1(0)=2/min.
(c) The SOR uses the illiquid venue as a marginal fill source: even at the constrained depth, it contributes 0.5 fills/min additional. This exploits the separability of the CARA HJB — each venue’s contribution is independent — and reduces the expected residual inventory at deadline, which is particularly valuable to a risk-averse agent.
Exercise 4 — Pegged-to-mid order.
Proceeds relative to mid at posting: E[proceeds−Smid,post]=E[δt]=δ where δ is the fixed peg offset. The fill occurs at St+δ regardless of where St moved, so the expected spread captured is always δ. Price volatility σ does not affect expected proceeds because the limit price tracks the mid — the trader captures exactly the peg. This breaks down when: fills occur via trade-through (the mid jumps discontinuously past the limit), when there is significant adverse selection in who fills the order, or when the mid-price has a systematic drift that is correlated with the arrival of fill-generating orders.
Exercise 5 — RL convergence and DQN.
(a) Tabular Q-learning converges under: (i) all state-action pairs visited infinitely often, (ii) step sizes αn→0 with ∑αn=∞, ∑αn2<∞. These ensure the Robbins-Monro conditions are met and the contraction mapping of the Bellman operator drives Q to Q∗.
(b) With function approximation, the Bellman target r+γmaxa′Qθ(s′,a′) depends on θ itself, making the update a semi-gradient rather than a true gradient of a fixed loss. This introduces a “moving target” that can cause divergence. Two stabilisation techniques: (i) experience replay breaks correlations between consecutive transitions by sampling from a buffer; (ii) target network uses a periodically updated copy Qθ− for the Bellman targets, making them locally stationary.
Exercise 6 — Iceberg order trade-off.
Visible limit: fill rate λ=0.5 fills/min for 1000 shares. Expected fills in 30 min: 0.5×30=15 fills. Each fill = 1 unit (assume fills of 1 unit for comparability). If each fill is for 1000/N units this doesn’t quite parse — assume each fill event fills 1 lot. Total expected lots: 15.
Iceberg (tip = 100 shares, λ=0.5 fills/min per tip): each refill incurs 5/60 min = 0.0833 min delay. Expected fills per cycle = λ×(1/(1/λ+0.0833))⋅time. Effective rate: 1/(1/0.5+0.0833)=1/2.0833=0.480 fills/min. Expected fills in 30 min: 0.480×30=14.4 lots — slightly fewer than the visible order due to queue re-entry delays.
Optimal tip minimises total time = Q/(fill_rate(qtip)) where fill_rate=λ/(1+λ×delay/qtip). Taking derivative gives qtip∗=Q×delay×λ as a rough estimate; for Q=1000, delay=5/60, λ=0.5: qtip∗≈1000×0.0833×0.5≈6.5 shares, suggesting very small tips maximise fill rate (fill more frequently, minimize delay penalty per unit).
SGM=n+1γσ2i where n=4 competing MMs, i=100 units, σ=2%=0.02, γ=10.
S=10×(0.02)2×100/5=10×0.0004×100/5=0.08. If n=3: S=0.08×5/4=0.10 (spreads widen with fewer MMs). If σ doubles to 4%: S quadruples to 0.32 (spreads increase with σ2).
With α=0.4: spread =0.4×4=1.6. Adverse selection drives wider spreads.
Exercise 3 — Inventory and skew.
Executed 50 sells at ask (€100.2) and 30 buys at bid (€99.8). Net inventory: −50+30=−20 (short 20 units). P&L from trading: 50×0.2+30×0.2=$16 in spread income. If fair price moves to 99.9: unrealized P&L on short position = +20×(100.0−99.9)=+$2 (price moved in favor of short). To reduce short inventory, skew bids upward (bid 99.9 instead of 99.8) to attract more sell orders from clients.
Exercise 4 — Toxic flow diagnosis.(Conceptual.)
Consistently negative flow value for one client indicates adverse selection: the client systematically trades against the market maker when the market subsequently moves in the client’s direction. Possible cause: the client has superior information. Remediation: increase the spread for that client (client-specific pricing), apply a toxicity-driven skew that widens when pre-trade indicators (OI, recent price trend) align with the client’s direction, or in extreme cases, decline to quote (quote withdrawal).
Exercise 5 — Hedging vs skewing.(Conceptual.)
Hedging in the market: the MM immediately trades in the interdealer market to offset the inventory position acquired from the client. Advantages: eliminates inventory risk immediately. Disadvantages: consumes bid-ask spread in the hedge market, may signal the client’s direction and move prices adversely (information leakage). Better suited to: large positions, illiquid instruments with slow client flow, high-volatility environments.
Skewing quotes: the MM adjusts her bid-ask quotes to attract offsetting client flow. Advantages: monetises the inventory through the spread without incurring hedge market costs. Disadvantages: offsetting flow may take time, leaving residual risk; if the market moves before offset, losses exceed spread income. Better suited to: liquid instruments with active two-way client flow, tight hedge markets with visible adverse selection.
Zero-profit ask: informed buys at H with prob αp=0.21; uninformed buys at rate 0.5(1−α)=0.35. Ask must satisfy: αp(VH−a)+0.5(1−α)(μ−a)=0, so a(αp+0.5(1−α))=αpVH+0.5(1−α)μ. a=(0.21×105+0.35×102)/(0.21+0.35)=(22.05+35.7)/0.56=57.75/0.56=103.13.
Spread: 103.13−99.38=3.75. For p=0.5: spread =α(VH−VL)=0.3×10=3.0. The asymmetric case widens the spread because p>0.5 increases the risk on the ask side.
Exercise 3 — Multi-asset skew.
Single-trade expected cost for the dealer holding inventory q0=(10,−5)T before the trade, and quoting to buy qˉ=8 EUR bonds (becoming qnew1=18):
δ1∗=210×0.5×(0.1011−0.0275)/8+1/20+0.002=5×0.5×0.0736/8+0.052=0.023+0.052=0.075 (normalised units). The negative USD inventory reduces the incremental risk (negative cross-term helps the hedge), so δ∗ is lower than the clean-book case.
Exercise 4 — AS optimal spreads.
(a) η=γ1ln(1+γ/k)=0.11ln(1+0.1/1.5)=10ln(1.0667)=10×0.0645=0.645 (in spread units).
For q=5: bid δb≈η−θq=0.645−0.0135×5=0.645−0.0675=0.578; ask δa≈η+θq=0.645+0.0675=0.713. Skew: tighter bid (buy more urgently), wider ask — consistent with positive inventory.
Exercise 5 — GLF sensitivities.
(a) η=0.21ln(1+0.2/1.0)=5ln(1.2)=0.912. θ=21×0.2×1.0×(0.012)2×T. Without T specified, θ∝σ2.
(b) σ→0.024: η unchanged (doesn’t depend on σ). θ doubles (∝σ2) — skew becomes more aggressive.
(c) A→3.0: θ=2kγσ2Ak (in the GLF formula θ decreases with A) — higher arrival rate means inventory turns over faster, reducing the incentive to skew. Economically: with more client flow, the MM can rebalance inventory through client trades rather than forcing an aggressive skew.
(c) With a large long position: the MM skews bids downward and asks upward uniformly. Uninformed retail clients (class A) are more useful for inventory rebalancing because their trades are random and uncorrelated with the MM’s inventory risk — the MM can offer them tighter prices to attract offsetting flow. Fund managers (class B) have high αB, so trading with them is expensive (high effective γB), and the MM will prefer to widen the spread or decline.
The minimum variance hedge h∗=qΣHH−1σXH minimises Var(ΔX−hTΔH). In L2(Ω) with inner product Cov: this is the orthogonal projection of ΔX onto the span of {ΔH1,…,ΔHm}. The residual ΔX−(h∗)TΔH is orthogonal to all ΔHk (i.e., uncorrelated). Basis risk is the variance of this residual — the component of ΔX that cannot be explained by any linear combination of the hedge instruments.
Exercise 2 — PCA hedge for 7-year bond.(Requires yield curve PCA data from notebook.)
For diagonal ΣHH, this is a standard Lasso with design matrix ΣHH1/2 and response y~. The regularisation path algorithm is LARS (Least Angle Regression).
Exercise 4 — Delta hedging with transaction costs.
(b) Whalley–Wilmott no-trade band width: Ht=(2γ3cΓ2S2)1/3 where c=0.001×S=0.1 per unit. Ht=(3×0.1×(0.05)2×10000/(2×0.01))1/3=(3×0.1×0.0025×10000/0.02)1/3=(375)1/3=7.21 shares.
(c) As expiry approaches, Γ rises sharply for at-the-money options, narrowing Ht∝Γ−2/3 and forcing more frequent rehedging. Deep in or out of the money, Γ→0 and the band widens to infinity (no rehedging needed).
Exercise 5 — Deep hedging BSM optimality.
Under GBM, the BSM delta π∗=N(d1) achieves perfect replication: Zδ=VT−PT=0 a.s. Thus the variance of the hedging P&L is zero, which is trivially the global minimum of the variance objective. No other strategy can do better than zero variance. In the deep hedging framework without transaction costs, the network recovers N(d1) in the GBM case by learning the exact replication strategy.
Exercise 6 — Skew-versus-hedge band.
From Barzykin et al. (2023), the threshold q∗ above which the dealer hedges (rather than skewing) scales as q∗∝c/σ2 for unit hedging cost c and volatility σ. Increasing c raises the threshold linearly: more expensive hedging leads the dealer to tolerate larger inventory positions before hedging. For arrival rate A: client flow is more likely to rebalance the book organically when A is large, so q∗∝A−1/2 — the dealer can afford a larger skew band before the stochastic arrival of offsetting flow becomes too slow.
As M increases: bias decreases (the model is more flexible and can approximate f∗ better); variance increases (small changes in training data lead to very different fitted polynomials). At M=N−1, training error →0 (interpolating polynomial) but test error typically peaks due to overfitting. This is the classic bias-variance tradeoff.
Exercise 2 — Ridge via SVD.
OLS predictor: f^(x)=∑j(ujTy)vjTϕ(x) (unweighted). Ridge adds penalty λ∥w∥2; the solution in the SVD basis shrinks each component by sj2/(sj2+λ). Directions with small singular values (near-zero sj) are shrunk toward zero — ridge regularisation stabilises the fit by discarding near-collinear directions.
Exercise 3 — Lasso KKT condition.
KKT stationarity: ∇w21∥y−Φw∥2+λ∂∥w∥1=0. For coordinate j: −ϕjT(y−Φw)+λ∂∣wj∣=0. If w^j=0: ∣ϕjT(y−Φ−jw^−j)∣≤λ/2 (subgradient ∈[−λ,λ] at zero). Interpretation: feature j is set to zero if its correlation with the current residual is below the regularisation threshold.
Exercise 4 — Polynomial kernel.
(x1z1+x2z2+1)2=x12z12+x22z22+2x1z1x2z2+2x1z1+2x2z2+1=ϕ(x)Tϕ(z) with ϕ(x)=(x12,x22,2x1x2,2x1,2x2,1)T ✓. For degree d in RD: feature space dimension =(dD+d).
Exercise 5 — Gradient boosting.(Computational — see notebook.)
Exercise 6 — PCA as optimal compression.
We seek UM (orthonormal columns) minimising ∥X−XUMUMT∥F2=∥X∥F2−∥XUM∥F2. Maximising ∥XUM∥F2=tr(UMTXTXUM) subject to UMTUM=I is solved by the top M eigenvectors of XTX. Minimum error: ∑j=M+1min(N,D)λj where λj are the discarded eigenvalues of the sample covariance.
Exercise 7 — Bellman iteration.
For a two-state, two-action MDP: write V∗(si)=maxa[R(si,a)+γ∑jP(sj∣si,a)V∗(sj)] explicitly for i=1,2. Substitute numerical values and solve the resulting linear system for V∗(s1), V∗(s2). The greedy policy selects the action maximising the right-hand side. (Numerical values depend on the specific MDP; the method generalises straightforwardly.)
Raw logits: (−0.2,−0.5,−1.0,−1.5,−3.0). Unnormalised: eli: (0.819,0.607,0.368,0.223,0.050). Sum =2.067. Probabilities: (0.396,0.293,0.178,0.108,0.024) ✓ sum to 1.
At T=0.5: divide logits by 0.5 → exponentiate → renormalise. Top token gets higher probability; entropy decreases.
At T=2: logits divided by 2 → distribution flattens; entropy increases.
H=−∑pilogpi: H(T=0.5)<H(T=1)<H(T=2).
Exercise 2 — Attention mechanism.
Q=K=XWQ=X[:,:2] (first two columns). Q=K=⎝⎛100010⎠⎞.
QKT/2=21⎝⎛100010000⎠⎞. Softmax row-wise: rows 1, 2 concentrate on positions 1, 2 respectively; row 3 is uniform (all zeros). Output attends most to the same position (self-attention).
Exercise 3 — Perplexity.
(a) PP=2350/100=23.5=11.31.
(b) Random baseline: 2log210,000=10,000. PP =11.31 is far better than random.
(c) Cross-entropy of model 1: 350/100=3.5 bits/token. Model 2: log2(80)=6.32 bits/token — wait, PP =80⇒ cross-entropy =log2(80)=6.32 bits. Model 1 has lower perplexity and hence lower cross-entropy: 3.5 vs 6.32. Ratio of cross-entropies: 6.32/3.5=1.81.
(c) BM25 would retrieve whichever document contains the query’s exact keywords. If the query is “earnings announcement impact” and document e2 contains those exact words while e1 is semantically similar but uses different terms, BM25 would rank e2 first. Hybrid retrieval combines both signals to capture lexical and semantic relevance.
Exercise 6 — Agent topology design.
(a) The supervisor topology fits best: a central controller (supervisor) assigns tasks to specialist sub-agents for news scanning, impact assessment, and summary generation, and routes the final output for human review before any action. The parallel nature of scanning multiple feeds and the sequential dependency (assessment depends on news detection) align with this pattern.
(b) Design patterns: (i) Reflection — the impact assessment agent critiques its own analysis before passing it on; (ii) Human-in-the-loop — mandatory human review gate before position submission.
(c) Evaluation: task-level metrics — precision/recall of identified earnings announcements, quality of impact summaries (human evaluation or reference comparison); step-level metrics — latency per agent step, error rate on news extraction, percentage of summaries correctly flagged for review vs auto-approved.
(c) The argument is positive (0.13 > 0), meaning σ(0.13)>0.5: the model is making progress toward preferring yw over yl relative to the reference. However, the margin is small (the reference model already assigned yl higher probability, and the trained model has started correcting this but not fully).
(a) ITP spread mean reversion — mean reversion (statistical arbitrage at the country level).
(b) Low price-to-book basket — factor investing (value factor).
(c) Moving average crossover — trend following.
(d) Long convertible, short equity — statistical arbitrage (capital structure relative value, also involves mean reversion to theoretical value).
Exercise 2 — Sharpe significance.
Daily SR =0.08. Annualised SR =0.08252=1.27. Standard error of the annualised SR over N=500 days: SE≈1/N=1/500=0.0447 (approximate, ignoring higher moments). t-stat =1.27/0.0447=28.4. This is far above the critical value of 1.96, so yes, the SR is statistically significant. (Note: for the daily SR test, t=SRN=0.08500=1.79<1.96, so just below significance at 5% using the daily statistic — the distinction matters!)
Additional days for significance: need t=SRdN=0.08N=1.96, so N=(1.96/0.08)2=600 days; need 600−500=100 more days.
Exercise 3 — Walk-forward design.
IS window: 240 trading days (2 years — allows 120-day estimation with buffer). OOS window: 60 trading days (1 quarter). With 2500 days total: leave 240 for the first IS window, then roll 60-day OOS windows. Number of splits: ⌊(2500−240)/60⌋=37 splits. Total OOS data: 37×60=2,220 days (about 8.8 years of OOS).
Exercise 4 — Transaction cost analysis.
(a) Daily turnover cost: 40%×5 bps/100×2=0.40%... more precisely: daily turnover = 40% of portfolio traded (buy + sell); cost per round-trip = 5 bps buy + 5 bps sell = 10 bps. One-way daily turnover 20% → daily cost = 20%×5 bps=0.01% per day (one-way), or if 40% is one-way: 40%×5=0.20% per day — large relative to daily SR.
Daily Sharpe (gross): 0.12. Daily cost drag: 0.0020 (0.20%). Net daily return ≈ gross mean return −0.0020. If gross SR =0.12 implies mean =0.12σ, and σ is daily vol, net SR depends on σ. In practice: net SR ≈0.12−0.0020/σ.
(b/c) With 20% turnover and SR =0.09: cost =20%×5=0.10%. Comparison requires knowing σ; the net Sharpe ratio depends on the return level, not just SR. (Full numerical answer requires specification of daily volatility.)
Exercise 5 — Overfitting and deflation.
(a) Effective significance level: testing 50 independent rules and reporting the best corresponds to a family-wise error rate (FWER). By Bonferroni: effective per-test level =0.05/50=0.001. The reported result implicitly uses a 0.1% significance threshold.
(b) With 50 rules on 3 years (≈750 days), even under the null (all rules have SR=0), the distribution of the maximum SR is substantially positive — consistent with a reported SR of 2.2. The result is almost certainly a false discovery due to multiple testing.
(c) By Bailey and López de Prado’s minimum backtest length formula: approximate minimum length for SR significance with 50 trials at 5% family-wise level requires roughly Nmin∝(z−1(1−0.05/50))2/SR2 — for 50 strategies and SR=2.2 annualised, this corresponds to several years of data beyond what was used.
Exercise 6 — Regime detection.(Conceptual.)
Two quantitative regime filters: (i) Hurst exponent: compute H on a rolling window; if H<0.45 the market is range-bound (mean-reverting), switch momentum off. (ii) Realised volatility ratio: compute the ratio of 1-month realised vol to 6-month realised vol; if >1.5 (vol is elevated and trending), mean reversion tends to fail and momentum is preferred. Validation: test the filter out-of-sample on held-out windows, ensuring the filter conditioning is applied strictly before the OOS period to avoid lookahead bias.
(d) Entry at z=(x−μ)/σ∞>zentry. For expected holding period ≈ one half-life, set zentry such that the expected time to revert to 0 starting from z is one half-life. A commonly used rule: zentry≈1–2 standard deviations.
(b) Critical value at 5% (without trend, with constant, N=500): approximately -2.87. Since −2.50>−2.87, fail to reject the unit root null.
(c) With trend: β^=−0.035, SE=0.014. t=−0.035/0.014=−2.50. Critical value with trend ≈−3.43. Still fail to reject.
Exercise 3 — Hurst exponent.
Slope 2H: (A) 2H=1.0⇒H=0.5 → random walk; (B) 2H=0.7⇒H=0.35<0.5 → mean reversion; (C) 2H=1.4⇒H=0.7>0.5 → trending.
Pairs trading: appropriate for (B) (mean-reverting series). Trend following: appropriate for (C) (trending series). Random walk (A): no exploitable serial structure.
Exercise 4 — Cointegration: EG vs Johansen.(Conceptual.)
Engle-Granger is a two-step OLS procedure testing a single cointegrating vector; it suffers from pre-test bias and is optimal only when there is exactly one cointegrating relationship. Johansen uses a VECM framework and tests for the rank of the cointegrating matrix — it can detect multiple cointegrating vectors and tests for their number sequentially. Disagreement arises when: the true cointegrating relationship involves all d=3 variables jointly (EG would test pairwise and may miss it); or when the normalisation chosen in EG is incorrect. Johansen is preferred in practice for d>2.
(c) Negative HML loading (β3=−0.2): the asset behaves like a growth stock (high price-to-book) rather than a value stock. Negative loading means it co-moves negatively with the value factor — it falls when value stocks outperform growth stocks.
Barzykin, A., Bergault, P., & Guéant, O. (2023). Algorithmic Market Making in Dealer Markets with Hedging and Market Impact. Mathematical Finance, 33(1), 41–79. 10.1111/mafi.12367