Standard deviation measures how widely investment returns vary around their mean. In portfolio construction it is used interchangeably with return volatility: a lower value represents lower volatility. Plotting expected return against standard deviation turns the trade-off between return and risk into a risk–reward view. section 2.1
For a portfolio, volatility depends on asset weights and on how asset returns move together, not just on each asset’s standalone standard deviation. Given weights w and covariance matrix Cov, portfolio standard deviation is σp = (w @ Cov @ w.T)^0.5. The covariance matrix can be built from standard deviations and correlations as diag(σ) @ Corr @ diag(σ). Matrix multiplication keeps these calculations concise and avoids explicit loops. section 2.2
Three-stock portfolio
FE, WMT, and AAPL have assumed annual return standard deviations of 15%, 20%, and 35%. With weights of 20%, 30%, and 50%, compute expected portfolio return from the weighted means, then compute portfolio standard deviation from the weights and covariance matrix. Repeating this calculation for 1,000 random weight vectors produces a cloud of portfolios in mean–standard deviation space; its lowest-volatility boundary is the minimum-variance frontier. section 2.1 section 2.3
Listing 2.4 Computing the standard deviation of a portfolio
sigma_p = (w @ Cov @ w.T) ** 0.5
print('Portfolio standard deviation: ', sigma_p)
Use the quadratic-form calculation directly after creating the weight vector and covariance matrix. section 2.2
Standard deviation also supports risk-tolerance discussions. For a stock–bond allocation modeled with a normal distribution, a 95% worst-case loss is placed 1.96 portfolio standard deviations below the mean. This result depends on assumed expected returns, standard deviations, and correlations, so it is a visualization based on inputs rather than a guaranteed loss estimate. section 2.5














