00:00Hello everyone, and welcome again to Nettle, the best platform around for distance learning in business, finance, economics, and much, much more
00:07Please don't forget to subscribe to our channel and click that bell notification button below so that you never miss fresh videos and tutorials you might be interested in
00:14Many thanks to our current Patreon supporters for making this video possible, and we would also greatly appreciate it if you consider supporting us as well, so please check the link in description for more details
00:22My name is Saba, and today we're investigating a key concept in portfolio
00:28Management, that is, how many stocks are required for an optimal diversified portfolio
00:33You might have heard from investment analysts, from academics, that on average, from 30 to 40 stocks is what is desirable for an individual investor when you seek to do passive investing and mimic the market return in market risk, but where does this 30 to 40 figure come from? Some investors, or some practitioners, or even some academics might say that 15 is enough, or even 10 is enough
01:04Where does this disagreement originate from? Today, we're going to investigate a quite simple and intuitive, yet powerful model that is the Mayshar's 1979 model, that allows us to think about where does the optimal number of stocks originate from, the assumptions of the model are quite stringent, but understandable
01:22First of all, we assume that there are infinitely many stocks that have similar characteristics, that have similar expected returns, here we assume it to be equal to 10 percent
01:36They have similar volatilities, here we assume that an annualized volatility of a particular individual stock is 30, which is quite realistic
01:44Again, we can tweak the numbers and see how the model output changes
01:49We also assume that the stocks are correlated
01:53pairwise, and this correlation coefficients between pairs of stocks are the same, and here we just input the value of the pairwise correlation between any pair of stocks as 0.5, so 50% correlation, and we also assume, uh, some parameters for our representative investor, for an investor who seeks to determine how many stocks they should include in their portfolio, and the investor is parameterized using their risk aversion coefficient theta, which means, uh, how much does this particular investor hate risk, so we assume that all investors are risk averse, but some investors hate risk to greater extents, and a Theta, risk aversion parameter of 3.5, is quite, um, an average value, and then we need to also specify what is the investable capital of the investor, how much do they want to invest in their portfolio, and here we set this value at 10,000 US dollars
02:55What is driving the trade-off between including more or less stocks into your portfolio is the transaction cost, and that is the novelty that Mayshar implemented in 1979
03:07Uh, Mayshar assumed that investors have to pay a fixed transaction fee to the broker to include one more position into their portfolio, and that is generally how many brokers work, if you want to
03:18Open another position, so if you want to include another stock, another title into your portfolio, then you have to pay some fixed commission to your broker, and here we assume that this transaction cost is equal to two dollars
03:32So if you include five stocks into your portfolio, you pay ten dollars a year to your broker
03:38If you include twenty stocks, you pay forty dollars, and so on, and so forth, and that drives the logic of the model
03:45As you include more and more stocks, you gain by reducing the volatility of your portfolio as diversification benefits grow, but you also lose more and more as you need to pay more fees
03:58To your broker, and when those trade-offs cancel each other out, optimality is achieved, and the mathematics of it is quite simple, and we'll touch upon the derivation of the model formally in a closed form solution later on in the video
04:12However, first, let's approach it in terms of a simulation, in terms of simple portfolio construction, and consider the covariance matrix between our stocks, and let's say that we'll go as far as 40 stocks in our hypothetical petroleum and choose which portfolio would be the best
04:31Maybe it's 10 stocks, maybe it's 20, maybe it's 30, maybe it depends, we'll figure out how
04:36Sensitive, this optimal number is to different parameters
04:41However, here we are just interested in calculating this matrix, and uh, for the covariance matrix to work, we need to first specify whether we are on the diagonal or not
04:52And if we are on the diagonal, so if our row number is equal to our column number, then uh, the correlation of a stock with itself is one, so we can just input volatility squared as our variance, because the covariance of a stock with itself is its variance, isn't it? And if we are not on a diagonal, then we need to multiply the variance as all stocks have the same volatility as per our Assumptions by the constant pairwise correlation that's given over here by 0.5 in our case, and we can then populate our matrix using Ctrl+R to first populate the first row, and then watermelon click it all the way down to get the matrix
05:37And unsurprisingly, we have got uh 0.09, which is 9% uh annual variance on the diagonal, and 0.045, which is 0.5 times uh the variance as 0.50 correlation on non-diagonal cells of our matrix
05:54And now we can calculate risks and returns of a portfolio that is equally weighted across a particular number of stocks and compare them in terms of investor utility and in
06:07terms of the portfolio volatility
06:09So, first of all, to calculate the volatility of a portfolio consisting of N stocks, we need to figure out what should be the weights in this particular portfolio, and then apply the usual matrix multiplication formula to calculate portfolio variance, and taking the square root, converting it into volatility
06:30So, first of all, we input the MMULT function and initialize an array of portfolio weights, and that's quite easy to do
06:38We have a vector of ones over here, so we can simply refer to this particular cell and lock the column here, so the starting uh cell does not change as We drag it across, then we can refer to the same cell, but not locking it, so as we drag it across the array, that represents weight is going to be, uh, longer and longer, and then we divide it by the number of stocks, as our portfolio is equally weighted, and then, uh, we multiply it on the right by another matrix multiplication result, and here we have to input the covariance matrix of a size n by n, so we always start at this particular cell, B11, locking both the column and the row, and then we refer to the bottom right cell of this matrix, which depends on the number of the stocks in our portfolio, isn't it, so we just refer to the Whole matrix over here, and refer to the number of stocks as the final row and column identifiers, and then the second array in this particular matrix multiplication result is going to be the transposed vector of weights, but we have already inputted the vector of weights, isn't it, uh, at the start over here, so we can just copy and paste it across
07:49And now, having, uh, finalized our calculation of portfolio variance, we can just take the square root of it and enforce the formulas
07:59You should control enter and get a portfolio volatility of 30, which is by all means intuitive as if you invest everything into one
08:07particular stock, then the volatility of your portfolio is going to be equal to the volatility of this stock, which is very, very unsurprising
08:15But now we can drag that across and figure out what the volatility is going to be for a portfolio that consists of N stocks, and we can see that it does gradually decrease, and it decreases quite fast initially
08:30Going from one stock to two stocks is quite beneficial, it reduces the volatility by more than four percentage points, and later on the gains are not that high
08:39You can see that moving from 39 stocks to 40 stocks does not even reduce your portfolio
08:45volatility by a single basis point, so is there any downward limit on how low this volatility can go, or can it go all the way to zero? Well, to do that, we'll have to consider the formal mathematics of the model, but as for now, let's just visualize some of the parameters of our competing portfolios in terms of their optimality, and can now consider the second part of the trade-off, which is the fixed cost that we need to pay to our broker, and we have to pay two dollars, which means that this cell should be locked per the stock in our portfolio, so we just multiplied by the number of stocks, and then we can again drag it all
09:24Across, and then consider what does this particular fixed cost mean for our net return
09:35Well, our net return is just the gross return of the portfolio, which is always equal to just 10, isn't it, because all stocks are the same
09:42We do not reduce or increase the return when including more stocks, we're only reducing volatility by some amount, but then we have to consider how much do we lose in terms of dollar value
09:54So the gross transaction cost, that depends on the number of stocks in our portfolio, and then this needs to be divided by the initial portfolio value as, uh, in percentage terms, that is how you can calculate
10:09The uh, impact of transaction costs on through your retirement, and now we can just again drag it all the way across and see that our net return is constantly decreasing, quite linearly actually, as we include more and more stocks into our portfolio
10:27It is quite close to 10 percent if we have two stocks, three stocks, four stocks, but as we include more and more, if we put 40, the reduction in net return due to trading fees is quite material, and this impact is more material if your portfolio value is smaller
10:48Paying 10 dollars is quite negligible if you have invested a million dollars, but it can be quite destructive
10:57If you only have 500 to invest, so it means that potentially, uh, more affluent investors would have the luxury to form more diversified portfolios, while less affluent investors might need to find peace with a less diversified portfolio of four or five stocks, for example
11:16And now, finally, having calculated the net return and the portfolio volatility, we can use the Arrow-Pratt utility function for an investor that factors in portfolio variance, but following that return, Rp, and the risk conversion parameter, theta, that we have assumed to be equal to 3.5 initially, so we can calculate our Arrow-Pratt
11:38Investor utility by first inputting our net return, Rp, then subtracting the risk conversion parameter, theta, and we'll lock it here, as it doesn't change from portfolio to portfolio
11:49It is constant for a particular investor, divided by two, and multiply by the portfolio variance, which is unsurprisingly portfolio volatility squared
11:58And now we can see how the change in the number of stocks in our portfolio affects our portfolio volatility that we've just calculated, and the investor utility
12:08So here, for this particular parameterization, we can see that as we have already figured out from the numerical
12:14Values in the cells, volatility of a portfolio first responds to an inclusion of an extra stock quite sharply, dropping quite rapidly over here, but then the incremental gains are quite small, whereas the penalty for including more stocks, which is the transaction fee, remains constant, and that is what leads to optimality in this particular framework
12:38As we look at utility, we can see that it is increasing until we have got around 20 stocks in your portfolio, and that it slowly diminishes, and here we can already figure out what affects the optimal number of stocks, isn't it volatility does, as you can
12:55Diversify with more risks, correlation between the stocks does, as if we have less correlated stocks, we can reach more attractive diversification benefits by including more stocks, and obviously fixed costs and the capital the investor has investable do affect the optimal number of stocks as well
13:18Uh, but also risk aversion does affect, um, the particular invest, particular investor's optimal portfolio, as investors hating more risk would be willing to take on more trading fees to reduce the risk by some fixed amount
13:36However, to formally derive the closed form solution, we have to drag us, drag ourselves
13:42Through some not so complicated mathematics, so if we consider the variance of a portfolio consisting of n stocks, we have to calculate the variance of a sum of random variables
13:57And as we've got n stocks in our portfolio, and they will be all weighted in equally with a weight of one over n, and uh, we need to figure out the variance of this particular sum, one over n of x ith, which is um, the i stock from the selection of and stocks
14:18And here, uh, remembering the properties of the variance of sum of random variables, we can drag this one over n in front of the parentheses squared, so we'll have 1 divided by n squared over here
14:33Then we'll have sum of n individual stocks variances, which is going to be n times sigma squared, sigma squared being a variance of a single stock, and n, the number of stocks
14:43And then we would have the sum of all potential pairwise correlations between stocks, and that can be easily calculated using the triangular numbers or the combination of two values of two elements from n, and this formula is n times n minus one over two, which pops out in many unexpected areas in modeling and mathematics and finance and economics, you name it
15:17And this particular uh constant is the number of covariances we that we have to add
15:22Up to this particular value, and uh, keeping in mind how we calculated the covariance between any pair of stocks, we just have to multiply the squared volatility, as volatilities of any stocks are the same, onto the correlation coefficient that is again assumed to be the same, and 0.5 in our model right now
15:48And now we can simplify it and do some trivial algebra over here and arrive at this particular equation
15:56So here we see that we've got a component that does not depend on number of stocks, rho, that is the correlation times sigma squared, and we have got a component that has an in the denominator, which means that This is the component that gets reduced, that gets diversified away, as you include more and more stocks into your portfolio
16:16We can even find the limit of portfolio variance as the number of stocks tends to infinity, as we diversify our portfolio indefinitely, and it's easy to see that this particular expression would tend to zero as the denominator tends to infinity, and this particular expression will stay the same as is independent of n
16:33So we can see that the portfolio variance, as you include more and more stocks in your portfolio, cannot go below rho times sigma squared, and that means that portfolio Volatility, which is the square root of variance, could not go below sigma times the square root of the row, the correlation coefficient, which is the lower bound of our diversification benefits, and that is what leads to the trade-off, um, and the optimality, uh, in terms of the number of stocks
17:02So formally, to find the optimal number of stocks, we can consider the utility function in terms of the expressions we have just discussed
17:11So here we have got our gross return, R, and then we adjust it to our trading costs, and our trading costs in dollar value are just fixed trading costs per lot per position, C, times the Number of stocks, n, and to convert it to return form, we just divide by investable capital, k, and then we just subtract the portfolio variance, which uses this particular formula just derived, multiplied by theta divided by 2
17:41So this is just the Arrow-Pratt utility function parameterized in terms of our variable in question, n, and we can only vary n in this setting because everything else is either fixed or characteristic of our particular investor
17:56So we can find the optimal number of stocks, n, by taking the first derivative of the utility function with respect to n, and here we see that r is the constant, so It goes away
18:05This is a linear function in terms of n, so we just got the coefficient minus c divided by k over here, and right here, we have got this term that's independent of n, so it vanishes
18:19And this particular constant can also be brought forward, and we are left with -1 over n as something that we have to differentiate, and as the derivative of 1 over n is minus 1 over n squared, this minus turns into a plus, and we have got n squared in the denominator, and then we can easily see that if n is small, then this particular component dominates, so it means that initially, when the number of stocks is small, it's beneficial in
18:48Terms of utility to increase the number of stocks in your portfolio, however, and as large, this particular component starts to dominate
18:56As this tends to zero and you lose utility, you make yourself worse off by including extra stocks, and that means that there indeed exists an optimal number of stocks in the portfolio when the value of this particular derivative is equal to zero
19:13And just applying some simple algebra and rearranging the terms, we can express our optimal N, and star as a function of the initial model parameters, and we can see that it's positively related, linearly related to portfolio
19:27Volatility, the more volatile a particular stock is, the more stocks it can be beneficial to include in an optimal portfolio
19:36It is positively related to risk aversion, theta
19:40It is positively related to investors' investable capital, K, as well, and it is negatively, inversely related to the trading costs, C
19:52We can also see that as correlation increases, the optimal number of stocks also goes down, and vice versa, simply because the more correlated stocks are, the less diversification benefits you can get from including more stocks into your portfolio
20:08So let's use this formula and calculate
20:12As a close form solution, the number of stocks that makes our investor the best off possible
20:18So over here, let's keep in mind the formula that we've just derived and translate it into language of Excel
20:22So first of all, we need to uh, take the stock volatility and multiply it by the square root of risk conversion theta times one minus correlation rho times our investable capital K, ten thousand dollars in our case, and divided by two times the transaction cost C, which is two dollars per position in this particular parameterization, and then we enforce the formula and get the optimal number of stocks to be
20:53Approximately 20, and that's exactly what we see here graphically, as the utility curve does indeed seem to peak at around 20
21:06Also, we can change our parameter values and see how the optimal number of stocks will change as well
21:10So, if our transaction costs, for example, reduce to one, then we see that 28 stocks are now optimal, and that's something that immediately is reflected in this particular utility graph
21:25If, on the other hand, we return to the initial setting and increase correlation to be 0.8 instead of 0.5, we see that now 12 and a half stocks approximately are optimal, as less diversification benefits
21:38are achievable in such a setting, and we see that that is indeed the case in terms of our portfolio volatility curve, which does flatten out much sooner than it did before, and our optimal number of stocks is indeed around 12
21:56And if we do, for example, reduce our risk aversion, if we say that we are now less risk-averse, then the optimal number of stocks is 15, as we are less mindful of the rest, and we would rather save a little bit more money on trading fees for our broker, and that is also reflected in the charts as well
22:21Finally, something that, um, I wanted to show before we wrap up the video is how to calculate the
22:26Portfolio volatility in a more concise way with the formula we've just derived over here, and not relying on the bulky covariance matrix
22:34Indeed, we have actually derived the closed form solution for portfolio variance, so the square root of it is going to be portfolio volatility
22:39So we can just take the square root of the first term, and plus the second term, so 1 minus our correlation, which is reported over there, times the variance of a particular stock, so volatility squared divided by the number of stocks, which is reported over here, and that changes with, uh, from portfolio to portfolio, and then we can add rho
23:12Sigma squared, and we've got the row in cell B3, and we've got sigma squared as B2 squared, and then we close the parenthesis, taking the square root, and we can enforce this formula throughout and see that it does indeed capture the same value as the more complicated formula dealing with matrix multiplication, and that's all there is for the Mayshar 1979 model that can be used to derive the optimal number of stocks for a passive investor
23:40Please leave a like on this video if you found it helpful
23:42In the comments below, I mean to see any further suggestions for videos in business, finance, or economics you would
23:48like me to record, and please don't forget to subscribe to our channel, or consider supporting us on Patreon
23:50Thank you very much, and stay tuned.