Skip to content

How Probability and Linear Algebra Solve Quant Finance Problems

Original question

How do probability theory, statistics, linear algebra, and calculus connect to real-world quantitative finance problems?
Probability describes the uncertain quantities in a model. Statistics estimates those quantities from data and measures uncertainty about the estimates. Linear algebra organises their relationships across assets. Calculus measures sensitivity and helps solve optimisation problems. Portfolio construction uses all four when it turns a model of asset returns into a set of weights.

One portfolio problem uses all four subjects

Let RR be a vector of single-period asset returns, with mean vector μ\mu and covariance matrix Σ\Sigma. For deterministic portfolio weights ww, the portfolio return is w⊤Rw^\top R. Linearity of expectation and the definition of covariance give
E[w⊤R]=w⊤μ,Var⁡(w⊤R)=w⊤Σw.\mathbb E[w^\top R]=w^\top\mu,\qquad \operatorname{Var}(w^\top R)=w^\top\Sigma w.
Given nn complete return vectors R1,…,RnR_1,\dots,R_n, one way to estimate the matrix is the sample covariance
Σ^=1n−1∑t=1n(Rt−Rˉ)(Rt−Rˉ)⊤.\widehat{\Sigma}=\frac{1}{n-1}\sum_{t=1}^n (R_t-\bar R)(R_t-\bar R)^\top.
If Σ^\widehat{\Sigma} is treated as fixed and symmetric, the derivative of the portfolio variance with respect to its weights is 2Σ^w2\widehat{\Sigma} w. For two assets with weights (x,1−x)(x,1-x), let their variances be v1,v2v_1,v_2 and their covariance be cc. Differentiating x2v1+2x(1−x)c+(1−x)2v2x^2v_1+2x(1-x)c+(1-x)^2v_2 gives the unconstrained minimum-variance weight in asset one, provided v1+v2−2c>0v_1+v_2-2c>0.
x⋆=v2−cv1+v2−2c.x^\star=\frac{v_2-c}{v_1+v_2-2c}.
For a long-only portfolio, the minimum over 0≤x≤10\leq x\leq 1 is the nearest feasible point to x⋆x^\star.

The covariance term is worth unpacking. Expand the squared deviation of xR1+(1−x)R2xR_1+(1-x)R_2 from its mean. Two terms are squared deviations of the individual assets. The cross term is 2x(1−x)2x(1-x) times the product of their deviations. Taking expectations turns that product into covariance. This is what the off-diagonal entries in the matrix encode. Calculus can then minimise the resulting quadratic in xx, but the answer still depends on the estimated matrix. Compare a solution computed on one period with the risk it actually realises over a later period.

Why the answer can beat both individual volatilities

Suppose annual variances are 0.040.04 and 0.090.09, with covariance 0.0150.015. The formula gives x⋆=0.075/0.10=0.75x^\star=0.075/0.10=0.75, so the portfolio holds 75% in asset one and 25% in asset two. Its variance is 0.033750.03375, or a standard deviation of about 18.37%18.37\%. The two individual volatilities are 20% and 30%. The covariance term is what allows the combination to have lower volatility than either asset individually in this example.

Interactive example

See how correlation changes two-asset portfolio risk

Asset A has 15% annual volatility and asset B has 25%. Move the correlation or the long-only weight in A.

Selected portfolio volatility 15.03% · minimum-risk weight in A 80.19%
Portfolio volatility as the weight in asset A changes1520250255075100Weight in asset A (%)Annual volatility (%)
  • Portfolio volatility
  • Selected weight

References and next steps