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 be a vector of single-period asset returns, with mean vector and covariance matrix . For deterministic portfolio weights , the portfolio return is . Linearity of expectation and the definition of covariance give
If is treated as fixed and symmetric, the derivative of the portfolio variance with respect to its weights is . For two assets with weights , let their variances be and their covariance be . Differentiating gives the unconstrained minimum-variance weight in asset one, provided .
The covariance term is worth unpacking. Expand the squared deviation of from its mean. Two terms are squared deviations of the individual assets. The cross term is 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 , 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 and , with covariance . The formula gives , so the portfolio holds 75% in asset one and 25% in asset two. Its variance is , or a standard deviation of about . 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.