This is an INDIVIDUAL workshop. In this workshop we learn the basics of Portfolio Theory. We learn how to estimate portfolio expected return and risk, and also learn a method to optimize portfolios.
1 Introduction to Portfolio Theory
Portfolio theory is one of the most important theoretical contributions of Finance to social science disciplines, specifically Economics. Portfolio theory provide us the basis to understand how resources in a society can be allocated in order to diversify risk and improve economic wealth generation.
The methods to estimate expected return and risk of a portfolio are based mainly on probability theory.
2 Interesting historical facts
Although the concept of probability might emerged more than 1,500 years ago, it was until the 17th century in Europe when the scientific method started to be diffused and accepted. Probability theory and Statistics are conceptual frameworks that mathematicians invented. Probability was coined around mid 1650 with the work of the french Blaise Pascal and Pierre de Fermat when they tried to respond to a professional gambler about the odds of winning in a die game. Another interesting fact is that in 1666 great part of London was burn in a big fire. Right after this, companies in England came up with the innovation of insurance services, so the Actuarial science was developed to better understand the probabilities of “dying” according to certain personality traits and personal habits.
Even though financial institutions and financial markets started to be more developed in the 19th century in the US and Europe, surprisingly, it was not until the beginning of 1950s that Probability theory and Statistics were applied to better understand risk and return in Financial markets. Harry Markowitz was the pioneer in applying basic Probability theory and Statistics to better understand risk in financial markets. When Markowitz was a Ph.D. student at the University of Chicago he examined how investors can design a financial portfolio in order to minimize risk and maximize return by only changing the weights of each asset in the portfolio. His paper published in 1952 in the Journal of Finance was the beginning of Portfolio Theory. Some years later, in 1990, Harry Markowitz received the Nobel Prize in Economics due to this early work in the 1950s and 1960s about Portfolio Theory.
3 What is a Portfolio?
A portfolio is a set of 2 or more financial assets, also called financial instruments. Examples of a financial asset are stocks, bonds, risk-free instruments, derivatives, commodities, etc.
The owner of a portfolio needs to decide the percentages allocated to each individual asset. The main advantage of financial portfolios is the possibility to diversify risk, while maintaining an expected rate of return.
In this workshop we review practical easy examples of 2-asset and 3-asset portfolios with the purpose to illustrate portfolio theory and portfolio optimization.
4 Expected return and risk of a portfolio
In this section I illustrate the expected return and risk of portfolios with 2 assets and then, generalize the examples to portfolios of more than 2 assets.
4.1 Expected return of a 2-asset portfolio
We can define a 2-asset portfolio as follows:
P = w_1(R_1)+w_2(R_2)
Where:
w_i is the % of money allocated to the asset i R_i is the return of the asset i
The expected return is simply the weighted average of the expected return of each asset:
E[P]=w_1*E[R_1]+w_2*E[R_2]
E[R_i] is the expected return of asset i.
We estimate the expected return of each asset E[R_i] as the geometric average of historical returns.
4.2 Expected variance of a 2-asset portfolio
We have to remember that the variance of a variable is the average of squared deviations. In this case the variable is portfolio returns.
Since the portfolio is a set of assets, then the portfolio variance can be expressed in terms of the individual variances, but also we need to consider the possible covariance between pairs of assets:
Remember that covariance is a measure of linear relationship between 2 variables. If the 2 asset returns are NOT correlated, then its covariance would be zero, so the portfolio variance would be determined by the individual variances.
If the 2 asset returns are negatively correlated, then the variance of the portfolio diminishes.
However, in the real world there is very difficult to find 2 assets with correlation=0 or with negative correlation.
As shown in the variance formula, portfolio variance can change if the individual variances and the covariance change, and if the weights change. An investor would be interested in finding ways to reduce the expected portfolio variance to avoid losses. When designing a portfolio, the investor can only make a decision about the weights allocated to each asset, but he/she cannot influence the individual variances of the asset returns nor their covariance.
Then, an interesting question might be: what would happen to the expected return, variance and portfolio risk if we change the weights? we will examine that later.
To calculate the individual variance of each asset return and its covariance it is recommended to use historical continuously compounded returns (that is the reason why I used small r instead of R in the variance formula)
4.3 Expected risk of a 2-asset portfolio
Once we have an estimation for the variance of 2-asset portfolio, we can easily estimate the expected portfolio risk by calculating its squared root:
RISK[P]=SD[P]=\sqrt{VAR[P]}
Then the standard deviation of portfolio returns is the measure of portfolio risk. Remember that standard deviation of returns of an instrument is also called volatility. Then, the portfolio volatility is a measure of portfolio risk.
It is important to note that volatility is not the only one measure of risk. Value at Risk is another interesting measure that focuses of potential losses. For now we will use volatility for portfolio risk.
4.4 Example of expected return and risk of a 2-asset portfolio
How we use the previous formulas to estimate expected return and risk? We use historical returns of the assets.
As we learned previously, it is much better to use continuously compounded returns to calculate return variance, volatility and covariance. We can calculate geometric average returns with simple returns or continuously compounded returns (as we learned in Workshop 1).
Since we already know how to estimate returns from historical prices, and also how to calculate variance, volatility and covariance of returns, then we can easily use this to estimate the expected return and risk of a 2-asset portfolio.
To see the role of the weights allocated Let’s consider 11 2-asset portfolios with the following weights:
Possible 2-asset Portfolios
Portfolio #
w1
w2
1
0%
100%
2
10%
90%
3
20%
80%
4
30%
70%
5
40%
60%
6
50%
50%
7
60%
40%
8
70%
30%
9
80%
20%
10
90%
10%
11
100%
0%
For this example I consider Microsoft and WalMart in a portfolio using monthly historical returns from Jan 2020 to March 2024. Then:
If the range of stock prices are very different between 2 stocks, it is difficult to visualize the price performance of the stocks. In this case, we can see that the WalMart price range is much lower than that of Microsoft.
A more illustrative plot will be to convert these stock prices in indexes representing how much $1.00 invested in each asset would look like over time. Here is this plot:
Code
library(reshape2)library(ggplot2)# calculating the growth factor: firstprices =as.vector(prices[1,])# divide all prices by the first prices:investments =sweep(prices,2,firstprices,'/')inv =data.frame(coredata(investments))inv$month=index(investments)names(inv)=c(tickers,"month")# reshape from wide to long in order to do a ggplot:invlong =melt(inv,id.vars="month")ggplot(invlong,aes(x=month,y=value,col=variable)) +geom_line() +labs(y="$1.00 investment",title="$1.00 investment in 2 assets")
We can see that $1.00 invested in Microsoft in 2020 would increase to more than $2.5 in March 2024, while Walmart would be around $1.7. We can also see that Microsoft had strong price declines in some time periods compared to the worse price declines of Walmart, indicating that maybe Microsoft is more volatile.
The monthly cc returns look like:
Code
names(returns) =c("rMSFT","rWMT")rets =data.frame(coredata(returns))rets$month=index(returns)names(rets)=c("rMSFT","rWMT","month")# reshape from wide to long in order to do a ggplot:retlong =melt(rets,id.vars="month")ggplot(retlong,aes(x=month,y=value,col=variable)) +geom_line() +labs(y="Monthly returns",title="Returns of 2 assets")
Looking at this time plot of returns, we can visualize volatility. However, with these 2 assets, it is difficult to say which asset is more volatile. They look with similar movements (variations), so their volatilities might be similar. We need to calculate their volatilities with the standard deviation of returns.
Remember that standard deviation is the squared root of the variance, and the variance is the average of squared deviations:
Where \bar{r} is the arithmetic average of historical continuously compounded returns and r_t is the cc return in the period t of the asset.
We can use the geometric average return as the expected return of each asset. Remember that we can calculate the geometric average return using the continuously compounded returns as follows:
E[r]=GeometricAvgRet =e^{\bar{r}}-1
Calculating standard deviation and geometric average returns we get:
The following is the correlation matrix for these 2 assets:
Correlation matrix
rMSFT
rWMT
rMSFT
1
0.3943292
rWMT
0.3943292
1
Correlation between the 2 asset returns is 0.3943292. This means that MSFT returns are positively related with WMT returns in about 0.3943292%.
The diagonal shows a 1 indicating that the correlation of an asset return with itself is 1. Note that Correlation(rMSFT,rWMT)=Correlation(rWMT,rMSFT)
The calculation of the variances and the covariance is shown in the following Variance-Covariance Matrix:
Code
cov=var(returns)
Covariance matrix
rMSFT
rWMT
rMSFT
0.0041531
0.0013872
rWMT
0.0013872
0.0029799
Covariance between the 2 asset returns is 0.0013872.
The diagonal of the variance-covariance matrix shows the individual variances of the asset returns. In this case, the return variance of rMSFT is 0.0041531, while the return variance of rWMT is 0.0029799.
The non-diagonal cells show the covariance between both stock returns. As in the correlation matrix, note that Covariance(rMSFT,rWMT)=Covariance(rWMT,rMSFT).
Then, both the correlation and the covariance matrices are symmetrical.
We already have the inputs to calculate the expected return and risk of all 11 portfolios!
4.4.1 Example - calculations for 1 portfolio
Let’s calculate 1 of these portfolios as an example:
Portfolio 4: w1 = 0.30; w2=0.70 (30% allocated to MSFT and 70% to WMT)
Finally, getting the standard deviation of this variance we get the expected portfolio risk:
RISK[P]=\sqrt{VAR[P]}
Code
rp =sqrt(0.3^(2)*cov[1,1] +0.7^(2)*cov[2,2])
SD(P) = RISK[P] = 0.0428
As you see, the standard deviation of this portfolio is less than any of the 2 standard deviations of the 2 stocks! Then, this portfolio diversified individual risks!. But, what configuration of weights make the portfolio less risky?
4.5 How weights influence Portfolio Risk vs Return
In the following table we can see the expected return and risk for the 11 2-asset portfolios:
Code
# I create a matrix W with the 11 portfolios:w1=seq(0,1,by=0.1)w2 =1-w1W=rbind(w1,w2)# I multiply the transposed of W and the vector of expected returns to get the expected return of the 11 portfolios:ERP =t(W) %*% ER# I get the squared root of the variances and take the diagonal of the matrix result to get the vector of expected risk of the 11 portfolios:RISKP =diag(sqrt(t(W) %*% cov %*% W))
Doing this process for the 11 portfolios we arrive to the following calculations:
Possible 2-asset Portfolios
Portfolio #
wMSFT
wWMT
E[P]
RISK[P]
1
0%
100%
0.0104213
0.0545885
2
10%
90%
0.0112845
0.0520091
3
20%
80%
0.0121477
0.0501714
4
30%
70%
0.0130109
0.0491586
5
40%
60%
0.0138741
0.0490217
6
50%
50%
0.0147373
0.0497681
7
60%
40%
0.0156005
0.0513592
8
70%
30%
0.0164637
0.0537201
9
80%
20%
0.0173269
0.0567547
10
90%
10%
0.0181901
0.0603616
11
100%
0%
0.0190533
0.0644446
Remember that the granularity of the data we used for the calculations is monthly, so the expected return and risk of the portfolios are monthly.
We can estimate annual expected return and risk from these monthly values.
Remember the rules to convert from monthly to annual for returns and risk (standard deviation):
%AnnualReturn =12*MonthlyReturns
AnnualStdDev= \sqrt{12}*MonthlyStdDev
We can multiply these results times 100 to see the results in percentages.
Then, the annual expected return and risk in % of these 11 portoflios are:
Code
YERP=100*12*ERPYRISKP =100*sqrt(12)*RISKP
Portfolio #
wMSFT
wWMT
E[P]
RISK[P]
1
0%
100%
12.51%
18.91%
2
10%
90%
13.54%
18.02%
3
20%
80%
14.58%
17.38%
4
30%
70%
15.61%
17.03%
5
40%
60%
16.65%
16.98%
6
50%
50%
17.68%
17.24%
7
60%
40%
18.72%
17.79%
8
70%
30%
19.76%
18.61%
9
80%
20%
20.79%
19.66%
10
90%
10%
21.83%
20.91%
11
100%
0%
22.86%
22.32%
Out of these 11 portfolios, there are some that offer attractive expected monthly return. We can appreciate the risk-return relationship by plotting the expected risk vs expected return of these 11 portfolios:
Code
data=as.data.frame(cbind(t(W),YERP,YRISKP))names(data)=c("w1","w2","PortfolioExpectedReturn","PortfolioRisk")ggplot(data,aes(x=PortfolioRisk,y=PortfolioExpectedReturn, col=w1))+geom_point() +geom_text(label=w1, nudge_x=0.15) +labs(y="Expected Annual Portfolio Return in %",x="Portfolio Annual Risk in %",title="Expected Risk-Return of 11 2-asset portfolios")
Each point represents a portfolio, and the number shown is weight 1, the % allocated to the first stock, MSFT.
We can see that the portfolio with 100% in MSFT is the one with the highest return, but the one with the highest risk.
We can see that the portfolio with around 40% in MSFT is the portfolio with the lowest risk of all. The portfolio with the lowest expected risk of all is named the Global-Minimum-Variance Portfolio.
Also, we can see that there are some levels of risk that we can find 2 possible portfolios, one with high expected return and other with lower expected return. Then, those portfolios with high return for any level of risk are the ones located in the Efficient Frontier.
The expected risk-return of all possible portfolios of 2 assets actually will lie in the Frontier. However, if we have a portfolio of 3 or more assets, then most of the combinations of weights will end up in portfolios that are NOT in the Frontier.
Then, for portfolios with 3 or more assets we need to learn how to optimize the portfolio to find those combinations of weights that end up in portfolios that are in the Efficient Frontier. Let’s see an example of a 3-asset portfolio.
4.6 Expected return and risk of a 3-asset portfolio
The portfolio expected return of this portfolio is calculated as the weighted average of the 3 asset expected returns:
E[P]=w_1*E[R_1]+w_2*E[R_2]+w_3*E[R_3]
The expected variance of the portfolio is calculated as follows:
As you see, besides the 3 variance terms in the formula, we need to add covariance terms of all possible combination of pairs of returns. Since we have 3 assets, then there are 3 combinations for the covariances (asset 1 with 2 and 3, and asset 2 with 3).
If we have a portfolio of 4 assets or more assets, then the variance formula is more complicated since we need to add all possible combinations of asset pairs for the covariance terms.
Let’s see how we can visualize the variances and covariances terms in a matrix:
Variance-Covariance Matrix with weights
r_1
r_2
r_3
r_1
VAR(r_1)
COV(r_1,r_2)
COV(r_1,r_3)
r_2
COV(r_2,r_1)
VAR(r_2)
COV(r_2,r_3)
r_3
COV(r_3,r_1)
COV(r_3,r_2)
VAR(r_3)
The variances are in the main diagonal, while the covariances are in the non-diagonal. This is a symetric matrix since the COV(r_i,r_j)=COV(r_j,r_i) .
We can visualize another matrix with the weights:
r_1
r_2
r_3
r_1
w_1^2VAR(r_1)
w_1w_2COV(r_1,r_2)
w_1w_3COV(r_1,r_3)
r_2
w_2w_1COV(r_2,r_1)
w_2^2VAR(r_2)
w_2w_3COV(r_2,r_3)
r_3
w_3w_1COV(r_3,r_1)
w_3w_2COV(r_3,r_2)
w_3^2VAR(r_3)
The sum of these 9 terms of the matrix is the expected variance of the portfolio. Then, if we have a portfolio of 10 assets, then this matrix will be 10x10, so we need to sum 100 terms: 10 variances and 90 covariances! however, since the matrix is symmetric, we actually need to calculate 45 covariances and then multiply times 2 each covariance term.
Fortunately, we can learn how to multiply matrices to quickly calculate the portfolio variance without calculating each cell of this matrix. We will learn this with an example in Excel.
4.7 Drivers of Portfolio Diversification
Well-designed Portfolios allow investors to diversify trying to get an expected return without being exposed to high risk.
The main drivers of portfolio diversification are:
N - the number of financial assets. The more the financial assets, the higher the expected diversification.
Combination of pair of correlations between asset returns. The less the correlation of the pair of assets, the more the diversification.
The first driver is just given by N, the number of assets.
The second driver can actually be manipulated by changing the weights allocated for each asset.
In the following section I illustrate how changing asset weights actually change both, the expected return of the portfolio and the expected portfolio risk (its volatility).
4.8 Example: Risk and return of 3-asset portfolios
Remember that for a portfolio of 3 or more assets, if I randomly assign weights to each asset, it will be very difficult that that random portfolio will lie in the Efficient Frontier.
I will create 1,000 random portfolios by randomly creating combinations of 3 weights. Compared to the 2-asset portfolio, with 3 assets it is more difficult to create different combinations of weights. I will use random numbers to create random portfolios so that the sum of the 3 weights is equal to 1.
For this example I will keep Microsoft and WalMart and add AMD (Advanced Micro Devices), which is a competitor of Intel.
After downloading real prices for these 3 stocks from Jan 2020 to March 2024, their performance of $1.00 invested in each stock look like:
prices =merge(Ad(MSFT),Ad(WMT),Ad(AMD))returns =na.omit(diff(log(prices)))# calculating the growth factor: firstprices =as.vector(prices[1,])# divide all prices by the first prices:investments =sweep(prices,2,firstprices,'/')inv =data.frame(coredata(investments))inv$month=index(investments)names(inv)=c(tickers,"month")# reshape from wide to long in order to do a ggplot:invlong =melt(inv,id.vars="month")ggplot(invlong,aes(x=month,y=value,col=variable)) +geom_line() +labs(y="$1.00 investment",title="$1.00 investment in 3 assets")
With this plot, can you appreciate which stock is more volatile?
The plot of monthly cc returns of these 3 assets look like:
Code
names(returns) =c("rMSFT","rWMT","rAMD")rets =data.frame(coredata(returns))rets$month=index(returns)names(rets)=c("rMSFT","rWMT","rAMD","month")# reshape from wide to long in order to do a ggplot:retlong =melt(rets,id.vars="month")ggplot(retlong,aes(x=month,y=value,col=variable)) +geom_line() +labs(y="Monthly returns",title="Returns of 3 assets")
Following the formulas for geometric average and standard deviation of returns we get:
Code
cor =cor(returns) ER =exp(colMeans(returns)) -1SD =apply(returns,2,sd)
rMSFT
rWMT
rAMD
E[r]
0.0190533
0.0104213
0.0272759
SD(r)
0.0644447
0.0545884
0.1546472
The following is the correlation matrix for these 3 stocks:
Correlation matrix
rMSFT
rWMT
rAMD
rMSFT
1
0.3943296
0.6275978
rWMT
0.3943296
1
0.1889248
rWMT
0.6275978
0.1889248
1
The calculation of the variances and the covariance is shown in the following Variance-Covariance Matrix:
Code
cov=var(returns)
Covariance matrix
rMSFT
rWMT
rAMD
rMSFT
0.0041531
0.0013872
0.0062548
rWMT
0.0013872
0.0029799
0.0015949
rWMT
0.0062548
0.0015949
0.0239158
After creating 1,000 random portfolios and calculating their 1,000 expected returns and expected risk, we can visualize these portfolios in the following scatter plot. The X-axis represents the expected risk (standard deviation) of the portfolios, while the Y-axis the expected portfolio returns:
Code
# Initialize the Weight matrixW =c()# Create 3 vectors of 1000 random values from 0 to 1:for(i in1:3) { W =rbind(W,runif(1000))}# The problem I have now is that some of the 1,000 portfolios# might end up having a sum of weights higher than one. # I can do a simple "trick" by # dividing each of the 3 weights by the sum of these 3# weights. And I can do this # for all 1000 portfolios: # I first create a vector with the sum of weights for all portfolios:sumw <-colSums(W)# I do another loop to divide each weight by the sum of weights: for(i in1:3) { W[i,]<-W[i,]/sumw# In each iteration I divide one raw of W by the vector sumw, # which is the sum of the weights of all 1000 portfolios}# I can check that the sum of weights is 1 (I do this for 5 portfolios)#W[,1:5]#colSums(W[,1:5])# All sums are equal to 1, as expected# I calcuclate the 1,000 expected returns:ERPortfolios =t(W) %*% ER# t(W) is the transposed of the weight vector W# I calculate the variance of the 1,000 random portfolios: VARPortfolios =diag(t(W) %*% cov %*% W) # I get the risk of these 1,000 portfolios: RISKPortfolios =sqrt(VARPortfolios)# I plot the 1,000 portfolios in the Risk-Return space: #plot(x=RISKPortfolios,y= ERPortfolios,# xlabel="Portfolio Expected Risk", ylabel="Portfolio Expected Return")dataportfolios =data.frame(cbind(RISKPortfolios,ERPortfolios))names(dataportfolios)=c("RiskPortfolio","Expected_ReturnPortfolio")ggplot(dataportfolios,aes(x=RiskPortfolio,y=Expected_ReturnPortfolio)) +geom_point(colour="#00abff", alpha=0.5) +labs(y="Portfolio Expected Return", x="Portfolio Expected Risk",title="Risk vs Return of 1,000 random 3-asset portfolios")
With this plot we can see that not all of the random portfolios lie in the Efficient Frontier. Actually, most of the portfolios are not efficient since they are inside the frontier. The portfolios that are NOT in the Frontier are called NON-EFFICIENT portfolios since you can always find another alternative portfolio that offers less risk for the same level of expected return.
In the Efficient Frontier we can find 2 important efficient portfolios:
The Global Minimum Variance Portfolio - The portfolio with the less risk of all feasible portfolios
The Optimal Portfolio - The portfolio that offers the best expected return for each point of risk.
What is the Optimal Portfolio?
4.9 The Sharpe Ratio and the Optimal Portfolio
The Sharpe ratio is a standardized measure of portfolio premium return after considering its risk (volatility).
A premium return is the return above the risk-free rate. In Mexico, the risk-free rate is CETES; in the US, the risk-free rate is the Treasury Bills.
Then, the Sharpe ratio tells us how much portfolio returns (above the risk free rate) we can expect for each 1% point of volatility.
Remember that Portfolio Volatility refers to the standard deviation of portfolio returns.
The Share Ratio can be calculated with historical returns, or with expected return and expected standard deviation of the portfolio.
Then, among feasible portfolios we can estimate their Sharpe-Ratios and the one with the highest Sharpe-Ratio will be the optimal portfolio since this portfolio offers the best return of 1% point of risk!
4.10 Example: Finding the Efficient Frontier, the Optimal and the GMV Portfolios
Now, instead of generating many random portfolios, it is possible to find the optimal portfolios with the minimum possible risk for different levels of expected portfolio returns. We need to use optimization methods to find these portfolios.
Below you can see the Efficient Frontier along with the GMV and the Optimal (Tangency) portfolio with same 3 stocks.
Code
library(IntroCompFinR)#Estimating the GMV portfolio:gmvport =globalMin.portfolio(ER, cov, shorts=FALSE) #gmvport#Estimating the efficient frontier:ef <-efficient.frontier(ER, cov, nport =100, shorts =FALSE)
The weights of the optimal portfolio with a risk-free rate = 4% is the following:
The expected return and risk of portfolios are monthly and in decimal points.
The curved blue line is the Efficient Frontier considering the 3 stocks.
The green line is the Capital Market Line (CML), which is the tangent line that starts in the risk-free rate in the Y-axis and is tangent to the Efficient Frontier (it touches only one Point, which is the Optimal Portfolio).
The brown dot is the Global Minimum-Variance (GMV) Portfolio, which is the portfolio with the lowest expected risk of all possible portfolios.
The red dot is the Optimal Portfolio, also called Tangency Portfolio, which is the portfolio with the highest expected Sharpe Ratio of all possible portfolios.
We can see that the CML is more efficient than the efficient frontier (the blue curved line). There are some risk levels around 5% and 6% of portfolio risk where the portfolios that lie in the CML have higher expected returns compared to the blue efficient portfolios!
Then, when we add the risk-free asset to the Optimal (Tangent) Portfolio, we end up with a more efficient possible Portfolios that line in the CML compared to the curved Efficient Frontier. This is a great finding in Finance that led to the development of the CAPM model.
How can we interpret the CML? The different portfolios that lie in the CML are constructed with 2 assets.
The risk-free asset
The tangency portfolio
If we invest 100% if the risk-free asset and 0% in the tangency portfolio, then we are in the initial point of the CML (at the left); if we invest 0% in the risk-free and 100% in the tangency portfolio, then we are in the tangency point of the CML. Then, if we invest 50% in the risk-free and 50% in the tangency portfolio, we will be in the middle point of the CML between the risk-free portfolio and the tangency portfolio.
The CML portfolios that lie to the right of the tangency portfolio are portfolios that short the risk-free rate and then invest more money in the tangency portfolio (long the tangency and short the risk-free asset). This cannot be done in the real world since we cannot get a loan with a rate equal to the the risk-free rate!
Then, any point in the CML is a combination of weights between the tangency portfolio and the risk-free asset.
If we could create a portfolio considering ALL stocks in the US market and running the same optimization process we did, it is expected that the tangency portfolio will be the Market Portfolio with weights equal to the proportion of market capitalization of each stock compared to the total capitalization of the market. This will be true if we do the following assumptions:
All investors are risk-averse since they always look for the portfolios with the lowest expected risk for different levels of expected returns. In other words, they are 100% rational (they prefer maximize return for each risk level)
All investors calculate in the same way the expected return of each asset, expected risk of each asset, and correlations of all pairs of assets (the covariance matrix)
Then, with these assumptions, if we keep adding stocks to our portfolio of 3 assets until we add ALL of them, then it is expected that the Tangency (optimal) portfolio will be the Market Portfolio.
With this idea of adding stocks to a portfolio, the idea of the CAPM was developed.
Once we add many stocks and estimate the tangency portfolio we will be very close to the Market Portfolio.
4.11 Methods to find the Efficient Frontier, the GMV and the Optimal Portfolio
How can we estimate the set of Efficient Portfolios -the portfolios that lie in the Efficient Frontier? Can we find them without creating random portfolios?
Yes! We need to use an Optimization Method
In this course we are not learn the details of the optimization algorithms, but we will learn how to use software tools to run these algorithms and find optimal portfolios!
The optimization methods to find the optimal (tangent) portolio, the GMV portfolio and the efficient frontier use the same logic, but they are slighly different.
4.11.1 Method to find the Optimal portfolio
The algorithm to find the optimal portfolio works as follows:
Objective: Find the combination of weights so that we get the Portfolio with the highest Sharpe Ratio
Restrictions:
The sum of the weights must add up to 1 (100%)
Optional restrictions:
Each weight should be greater than zero (in case short selling is not allowed)
Define a minimum and/or maximum weight for all assets
4.11.2 Method to find the GMV portfolio
The algorithm to find the GMV -the portfolio with the minimum expected risk- works as follows:
Objective: Find the combination of weights so that we get the Portfolio with the lowest expected portfolio risk. Here the expected return does not matter!
Restrictions:
The sum of the weights must add up to 1 (100%)
Optional restrictions:
Each weight should be greater than zero (in case short selling is not allowed)
Define a minimum and/or maximum weight for all assets
4.11.3 Method to find the Efficient Frontier
The algorithm to find the set of portfolio that lie in the Efficient Frontier works as follows:
Objective: For each level of Feasible Expected Portfolio Returns, find the portfolio with the lowest expected portfolio risk. To find the range of feasible portfolio returns, it is possible to get the minimum and maximum expected return of assets.
Restrictions:
When finding each minimum-variance portfolio, the sum of the weights must add up to 1 (100%)
Optional restrictions:
Each weight should be greater than zero (in case short selling is not allowed)
Define a minimum and/or maximum weight for all assets
4.12 Software tools to do portfolio optimization
The most popular software tools to do portfolio optmization are:
The advantage of Excel is that is very easy to learn, but is limited when doing sophisticated real-world problems related to portfolios
The advantage of open-source languages is that once you learn them, you can do very sophisticated analysis for very hard real-world problems. However, you need more time to learn these tools (only at the beginning!). Learning R or Python for Finance will give you a strong competitive advantage to compete for the best jobs in the World!
The advantage of Refinitiv, Bloomberg, CapitalIQ is that it is quite easy to learn the tool and do very sophisticated analysis, but you need to pay $ a lot for licences (except when you are student of Tec de Monterrey!). The licenses are limited in our Campus, but it is worth learn them!
5 Challenge
Using real monthly data of MSFT, WMT and AMD you have to estimate Annual expected return and risk of each stock. Also, you have to calculate:
Annual Expected Return
Annual Portfolio Expected Risk
for the following Portfolios:
Equally-weighted Portfolio
Optimal portfolio - The portfolio with the highest Sharpe ratio
(this is Optional) - 100 random portfolios - assign random weights to the 3 assets, but the sum of them must be equal to 1
Consider an annual expected risk-free rate = 4%
6 Quiz 3 and W3 submission
You have to submit your Excel file for Workshop 3 through Canvas.
Also, you have to respond Quiz 3 in Canvas. You will be able to try this quiz up to 3 times. Questions in this Quiz are related to concepts of the readings related to this Workshop. The grade of this Workshop will be the average between Quiz 1 grade and the grade of your Excel.
Remember that you have to submit your Excel file through Canvas BEFORE THE FIRST CLASS OF THE NEXT WEEK.