Topic1 2 EfficientPortfolios VarCov
1. Risk return tradeoff and portfolio volatility calculation
This section covers the fundamental principles of evaluating investment risk through standard deviation and expected return, detailing the risk-return tradeoff, the mathematics of two-stock portfolio volatility, and the concept of the efficient frontier.
1.1 Measures of Risk and Return
Investment risk is characterized by the uncertainty surrounding future outcomes; while stocks generally yield positive average returns, there is always a possibility of significant short-term losses. Risk is quantified using standard deviation (σ^), which serves as the measure of dispersion of returns. Expected returns are calculated based on weighted averages of potential outcomes 4.
The Sharpe Ratio (SR) is the primary metric used to quantify the risk-return tradeoff, indicating the amount of expected excess return earned per unit of risk taken. The higher the Sharpe Ratio, the better the portfolio's risk-adjusted performance.

The formula for the Sharpe Ratio is: SR=σ^R−Rf where R is the expected portfolio return, Rf is the risk-free rate, and σ^ is the standard deviation of the portfolio's excess return 5.
Tip: The Sharpe Ratio helps compare investments that have different risk levels by standardizing the return relative to the volatility (risk).
1.2 Portfolio Volatility and Diversification
Combining multiple stocks into a portfolio can reduce overall risk through diversification. The effectiveness of this risk reduction hinges on how closely the stocks' prices move together, which is quantified by covariance. Positive covariance suggests returns tend to move in the same direction, while negative covariance implies they move in opposite directions 6.
Correlation (ρ) provides a standardized measure of the strength and direction of this co-movement, always falling within the range of -1 to +1.

A common misconception is that the standard deviation (volatility) of a portfolio is simply a weighted average of the individual asset volatilities. This is only true if the assets are perfectly positively correlated (ρ=+1). In general, portfolio variance, Var(Rp), must account for the covariance between assets 8.
For a two-stock portfolio (Assets 1 and 2) with weights x1 and x2, the variance is calculated as the covariance of the portfolio return with itself: Var(Rp)=Cov(Rp,Rp) Expanding this yields: Var(Rp)=x12Cov(R1,R1)+x1x2Cov(R1,R2)+x2x1Cov(R2,R1)+x22Cov(R2,R2)
Since Cov(Ri,Ri)=Var(Ri) and Cov(R1,R2)=Cov(R2,R1), the formula simplifies: Var(Rp)=x12Var(R1)+x22Var(R2)+2x1x2Cov(R1,R2)

This covariance term can also be expressed using correlation (ρ12) and individual standard deviations (σ1,σ2): Cov(R1,R2)=ρ12σ1σ2
The key takeaway is that the lower the covariance (or correlation) between securities, the smaller the resulting portfolio variance 9.
Example: For a portfolio composed of Intel (I) and Coca-Cola (C), the weights must sum to 1.00 (xI+xC=1.00). Analyzing various weightings shows how expected return (E[Rp]) responds to weight changes, and crucially, how volatility (SD[Rp]) changes, often hitting a minimum point before rising again as the weights shift entirely to one asset. If the correlation between the two stocks is changed, the expected return of any given weight combination remains constant, but the portfolio volatility changes significantly. Volatility is minimized when correlation is ρ=−1 and maximized when correlation is ρ=+1. Short selling (assigning a negative weight to a stock) is possible and can further extend the set of possible risk-return combinations 17 18.

1.3 Portfolio Choice and the Efficient Frontier
The objective of mean-variance portfolio optimization is to identify the best possible portfolio allocation for an investor based on their willingness to trade off return for volatility. This problem is often broken down into two parts: finding the optimal portfolio of risky assets, and then combining that optimal risky portfolio with a risk-free asset (known as the separation property) 11 12.
1.3.1 Identifying Efficient Portfolios
When analyzing a set of possible portfolios, we distinguish between efficient and inefficient allocations:
- Inefficient Portfolios: A portfolio is inefficient if another combination exists that offers a higher expected return for the same level of volatility, or the same expected return with lower volatility. For instance, for Intel and Coca-Cola, investing 100% in Coca-Cola was shown to be inefficient because a mix of the two stocks offered better risk-return characteristics14.
- Efficient Portfolios: An efficient portfolio cannot have its volatility reduced without simultaneously lowering its expected return 13.
The set of all efficient portfolios forms the Efficient Frontier. This frontier represents the upper boundary of the feasible set of risk-return combinations for a given set of assets. If short sales are allowed, the set of possible portfolios (the feasible region) can expand, potentially shifting the efficient frontier further to the northwest (lower risk, higher return) 15 19.
1.3.2 Extending to N Assets and GMVP
The principles derived from two assets generalize to portfolios of N risky assets, where the key driver remains the covariance structure among all assets. Adding more assets generally improves diversification, causing the efficient frontier to shift towards the left (lower volatility)24.
Even if a new stock has a lower return than existing assets, it might still be beneficial to include it if its returns have low or negative correlation with the existing portfolio, thus enhancing diversification benefits.
Example: Adding Bore Industries (lower return, same volatility as Coca-Cola) to a portfolio of Intel and Coca-Cola can still lead to a portfolio that offers a higher return for the same volatility compared to the original Intel/Coca-Cola mix, due to diversification effects 22.
For any collection of risky assets, the efficient frontier is the upper-left boundary of the entire feasible region of possible portfolios 23.
The Global Minimum-Variance Portfolio (GMVP) is the specific portfolio on the frontier that achieves the absolute lowest possible variance (volatility) achievable with the given set of risky assets. The GMVP is efficient, but it is only the optimal choice for investors with very low risk tolerance. The efficient frontier itself consists of all portfolios that lie on or above the GMVP on the minimum-variance frontier 26 27.
Summary of Key Data for Three Stocks (I, C, B):
- Intel (I): Highest return (26%), highest volatility (50%).
- Coca-Cola (C) & Bore (B): Same volatility (25%).
- Correlation: ρIC=0, and Bore is uncorrelated with both Intel and Coca-Cola 21.


2. Introduction of the risk-free asset and the capital allocation line
The introduction of a risk-free asset, such as Treasury bills (T-Bills), fundamentally alters the investment opportunity set by allowing investors to combine risky portfolios with a guaranteed return stream, leading to the creation of the Capital Allocation Line (CAL) and identifying the Optimal Risky Portfolio (ORP) via the maximization of the Sharpe Ratio 30.
2.1 Combining Risky Assets with a Risk-Free Asset
Previously, analysis focused solely on combining risky assets to form efficient portfolios along the Mean-Variance Frontier (MVF). Introducing a risk-free asset (rf) changes this by allowing a fraction of capital (y) to be invested in a risky portfolio (P), with the remainder (1−y) invested in the risk-free asset 29.
When combining the risk-free asset with any arbitrary portfolio of risky assets, both the expected return, E(Rc), and the standard deviation, σc, of the combined portfolio (c) become linear functions of the fraction y invested in the risky asset portfolio:
E(Rc)=rf+y(E(Rp)−rf) σc=yσp
This linear relationship signifies that adding the risk-free asset allows for risk reduction, but often at the cost of reduced expected return, depending on the allocation y.

2.2 The Capital Allocation Line (CAL)
The Capital Allocation Line (CAL) represents all possible combinations of the risk-free asset and a specific risky portfolio P. The CAL plots the expected return against the standard deviation for these combinations.
The slope of the CAL connecting the risk-free rate (rf) to a risky portfolio P is constant and is defined by the Sharpe Ratio of portfolio P:
Slope of CAL=Sharpe Ratio=σpE(Rp)−rf
The Sharpe Ratio serves as the reward-to-risk measure, where a higher ratio indicates greater portfolio attractiveness because it offers a superior return compensation per unit of standard deviation risk taken. When comparing different potential risky portfolios (like A and B), the portfolio that generates the steepest CAL offers the best risk-return trade-off relative to the risk-free rate 35.

2.3 Identifying the Optimal Risky Portfolio (ORP)
The goal when including a risk-free asset is to find the risky portfolio that yields the steepest possible Capital Allocation Line. This "best" portfolio of risky assets is known as the Optimal Risky Portfolio (ORP) or the Tangency Portfolio.
The ORP is the unique portfolio on the efficient frontier of risky assets such that the line connecting the risk-free rate (rf) to this portfolio is tangent to the frontier curve. This tangency point mathematically maximizes the Sharpe Ratio among all available risky portfolios 36.
Tip: The Tangency Portfolio is the most highly diversified portfolio available consisting only of risky assets that provides the best risk-return trade-off before considering any allocation to the risk-free asset. The Efficient Frontier including the risk-free asset is the line segment starting at rf and extending along the CAL defined by the Tangency Portfolio 37.

The relationship between the risk-free rate, the optimal risky portfolio P, and the resulting CAL is critical. The line CAL(P) is tangent to the Opportunity Set of Risky Assets precisely at point P, the tangency portfolio that maximizes the Sharpe Ratio 38.

2.4 The Separation Property
The analysis of introducing the risk-free asset leads to the powerful Separation Property. This property dictates how different investors will structure their overall portfolios 33:
- Universal Risky Portfolio Choice: All investors, irrespective of their individual risk aversion, will choose to hold the exact same portfolio of risky assets—the Tangency Portfolio (P). This is because P offers the absolute best risk-return trade-off achievable with risky assets.
- Risk Aversion Dictates Allocation: The only difference among investors will be the degree to which they mix this optimal risky portfolio (P) with the risk-free asset (rf).
- Conservative investors (highly risk-averse) will invest a small fraction in P and a large fraction in T-bills.
- Aggressive investors (less risk-averse) will invest a larger fraction in P, potentially even borrowing at the risk-free rate to invest more than 100% in P (buying on margin), which corresponds to values of y>1 on the CAL 31 39.
Example: If the Tangency Portfolio yields an expected return of 15% with a standard deviation of 20%, and the risk-free rate is 5% (0.05 dollars), a conservative investor might choose y=0.5, leading to an expected return of 0.05+0.5(0.15−0.05)=0.10 or 10 dollars, and a standard deviation of 0.5×0.20=0.10 or 10 percent 32.
The process for determining the optimal investment strategy involves two steps:
- Determine the efficient frontier of risky assets and identify the Tangency Portfolio (P) by finding the CAL with the steepest slope (highest Sharpe Ratio).
- The individual investor then selects the appropriate mix between this optimal risky portfolio P and the risk-free asset (rf) based on their risk tolerance.

The set of risky investments itself is constrained by the Minimum-Variance Frontier, of which the Efficient Frontier is the upper, preferred portion 40.

3. Matrix notation and implementation of mean-variance analysis in Excel
This section translates the theoretical framework of mean-variance optimization for N assets into precise matrix notation and outlines the practical steps for implementation, particularly using Microsoft Excel's capabilities, including calculating the Global Minimum-Variance Portfolio (GMVP) and employing Solver for optimization.
3.1 Matrix Notation for Portfolio Characteristics
For a portfolio consisting of N risky assets, key inputs like expected returns and the covariance structure are compactly represented using vectors and matrices.
The vector of expected returns, E(R), is an N×1 column vector where each element E(Ri) is the expected return for asset i:
E(R)=E(R1)E(R2)⋮E(RN)The variance-covariance matrix, S, is an N×N symmetric matrix where diagonal elements σii represent the variance of asset i, and off-diagonal elements σij represent the covariance between asset i and asset j.
S=σ11σ21⋮σN1σ12σ22⋮σN2⋯⋯⋱⋯σ1Nσ2N⋮σNN
42.
The portfolio weights are represented by the vector x, an N×1 column vector where xi is the proportion invested in asset i. A fundamental constraint in portfolio construction is that the weights must sum to one:
x=x1x2⋮xNsuch that i=1∑Nxi=1
43.
The expected return of the portfolio, E(RP), is calculated as the dot product of the transposed weight vector and the expected return vector:
E(RP)=xTE(R)=i=1∑NxiE(Ri)The portfolio variance, σP2, is calculated using the quadratic form involving the weight vector and the variance-covariance matrix:
σP2=xTSx=i=1∑Nj=1∑NxixjσijIn Excel, this calculation is implemented as an array function: =MMult(MMult(x_as_row,VarCov),x_as_column).
3.2 Implementation Steps in Excel
Translating the theory into practice using Excel involves several key steps, starting with data preparation and culminating in portfolio optimization 46.
3.2.1 Data Preparation and Statistic Estimation
Before optimization, the necessary inputs, E(Ri) and S, must be estimated from historical price data.
- Data Acquisition: Download historical price data (e.g., from Bloomberg, LSEG, or Investing.com) and convert it into periodic returns 48.
- Statistic Estimation (Step 1): Calculate the variance-covariance matrix (S) using the demeaned returns (R~): S=M−1R~TR~ where M is the number of observations. Excel's "Data Analysis" tool might use a denominator of M instead of M−1.
A standard starting point for portfolio construction is the equally-weighted portfolio, where xi=1/N for all assets 50.
49.
Tip: When setting up the Excel sheet, ensure the structure aligns with matrix multiplication rules: the weight vector x should be a column vector, S should be the covariance matrix, and xT should be represented as a row vector in the calculation formulas 44.
3.2.2 Evaluating a Generic Portfolio
For any given set of weights x, the portfolio statistics are calculated as follows 47:
- Step 3 (Variance): Calculate σP2=xTSx 51.
- Step 4 (Expected Return): If a risk-free rate (rf) exists, the excess return component is used: xi×(E(Ri)−rf). Otherwise, it is xi×E(Ri).
52. - Step 5 (Portfolio Expected Return): Sum the individual weighted returns: E(RP)=∑i=1NxiE(Ri).
53.
3.3 Global Minimum-Variance Portfolio (GMVP) Weights
The Global Minimum-Variance Portfolio (GMVP) weights, xGMVP, are found by minimizing portfolio variance subject only to the constraint that weights sum to one (∑xi=1).
The analytical solution for the GMVP weights relies on the inverse of the variance-covariance matrix (S−1):
xGMVP=1TS−11S−11where 1 is a column vector of ones.
.
The implementation steps for GMVP in Excel involve:
- Steps 1 & 2: Calculate S and then derive the weights xGMVP using the formula involving S−1 54.
- Step 3 (Variance): Calculate the GMVP variance using xGMVP 55.
- Step 4 & 5 (Expected Return): Calculate the expected return for this specific weight vector, E(RGMVP) 56.
Example: In a full analysis, the expected return for a specific GMVP calculation (based on inputs in row 35) might yield −0.08%, while the average expected return across several calculated GMVPs (row 56) might be 0.80%.
57.
3.4 Constructing the Efficient Frontier and Optimization with Solver
The efficient frontier is characterized by portfolios that offer the highest expected return for a given level of risk (variance) or the lowest risk for a given target return (R∗) 58.
3.4.1 N-Asset Frontier Optimization
For N assets, the optimization problem to trace the frontier is formally stated as minimizing variance subject to two constraints:
- ∑i=1Nxi=1
- ∑i=1NxiE(Ri)=R∗ (Target return constraint)
The objective function is minVar(Rp)=minxTSx 59.
Tip: For problems involving many assets, manual calculation becomes infeasible; this necessitates the use of optimization software, which Excel provides via Solver.
3.4.2 Sharpe Ratio Maximization and Solver Application
The Optimal Risky Portfolio (ORP) is identified by maximizing the Sharpe Ratio (SRp):
xmaxSRp=xmaxVar(Rp)E(Rp)−rfsubject to the constraint ∑i=1Nxi=1 60.
Excel's Solver tool is essential for implementing these constrained optimizations. Solver can be used to:
- Find the minimum portfolio variance (e.g., the GMVP).
- Minimize variance for a specific target expected return.
- Maximize expected return for a target variance.
- Maximize the utility function: {E(Rp)−2A1×Var(Rp)}, where A is the coefficient of risk aversion.
Solver also allows imposing practical constraints beyond the core requirements, such as no short sales (x≥0) or setting minimum and maximum bounds on individual holdings. The overall algorithm for mean-variance analysis involves forecasting parameters, imposing constraints, solving the minimum variance problem for various target returns to map the frontier, and finally maximizing the Sharpe Ratio to find the ORP 61 62.
Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
© 2026 Maeve. All rights reserved. This content is protected by copyright.
